﻿<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RSLogix5000Content SchemaRevision="1.0" SoftwareRevision="17.00" TargetName="Multiple_BTs_over_ControlNet" TargetType="Controller" ContainsContext="false" Owner="oksana, Microsoft" ExportDate="Sun Mar 25 21:35:30 2012" ExportOptions="DecoratedData AllProjDocTrans">
<Controller Use="Target" Name="Multiple_BTs_over_ControlNet" ProcessorType="1756-L63" MajorRev="17" MinorRev="2" TimeSlice="10" ShareUnusedTimeSlice="1" ProjectCreationDate="Tue Jul 15 10:25:32 2008" LastModifiedDate="Tue Jul 15 10:25:37 2008" SFCExecutionControl="CurrentActive" SFCRestartPosition="MostRecent"
 SFCLastScan="DontScan" CommPath="TCP-1\1\Backplane\2" ProjectSN="16#0000_0000" MatchProjectToController="false" InhibitAutomaticFirmwareUpdate="0">
<RedundancyInfo Enabled="false" KeepTestEditsOnSwitchOver="false" IOMemoryPadPercentage="90" DataTablePadPercentage="50"/>
<Security Code="0"/>
<SafetyInfo/>
<DataTypes>
<DataType Name="BT_CONFIGURATION" Family="NoFamily" Class="User">
<Members>
<Member Name="REQ_LEN" DataType="INT" Dimension="0" Radix="Decimal" Hidden="false"/>
<Member Name="Slot" DataType="SINT" Dimension="0" Radix="Decimal" Hidden="false"/>
<Member Name="Path" DataType="STRING" Dimension="0" Radix="NullType" Hidden="false"/>
</Members>
</DataType>
</DataTypes>
<Modules>
<Module Name="Local" CatalogNumber="1756-L63" Vendor="1" ProductType="14" ProductCode="56" Major="17" Minor="2" ParentModule="Local" ParentModPortId="1" Inhibited="false" MajorFault="false"
>
<EKey State="ExactMatch"/>
<Ports>
<Port Id="1" Address="2" Type="ICP" Upstream="false">
<Bus Size="7"/>
</Port>
</Ports>
</Module>
<Module Name="Local_CNB" CatalogNumber="1756-CNB/B" Vendor="1" ProductType="12" ProductCode="7" Major="2" Minor="1" ParentModule="Local" ParentModPortId="1" Inhibited="false" MajorFault="false"
 ControlNetSignature="16#0000_0000">
<EKey State="CompatibleModule"/>
<Ports>
<Port Id="1" Address="5" Type="ICP" Upstream="true"/>
<Port Id="2" Type="ControlNet" Upstream="false">
<Bus/>
</Port>
</Ports>
</Module>
<Module Name="Remote_1771" CatalogNumber="1771-ACNR15" Vendor="1" ProductType="12" ProductCode="35" Major="2" Minor="1" ParentModule="Local_CNB" ParentModPortId="2" Inhibited="false" MajorFault="false"
>
<EKey State="CompatibleModule"/>
<Ports>
<Port Id="2" Address="4" Type="ControlNet" Upstream="true"/>
</Ports>
<Communications CommMethod="536870915" PrimCxnInputSize="16" PrimCxnOutputSize="8">
<Connections>
<Connection Name="Standard" RPI="5000" Type="Output" EventID="0" ProgrammaticallySendEventTrigger="false">
<InputTag>
<ForceData>00 00 00 00 01 00 00 00 21 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</ForceData>
<Data Format="Decorated"><Structure DataType="AB:1771_ACN15_16Bytes:I:0">
<DataValueMember Name="RackStatus" DataType="DINT" Radix="Binary" Value="2#0000_0000_0000_0000_0000_0000_0000_0000"/>
<DataValueMember Name="InputGroupsValid" DataType="DINT" Radix="Binary" Value="2#0000_0000_0000_0000_0000_0000_0000_0001"/>
<ArrayMember Name="Data" DataType="INT" Dimensions="4" Radix="Binary">
<Element Index="[0]" Value="2#0000_0000_0010_0001"/>
<Element Index="[1]" Value="2#0000_0000_0000_0000"/>
<Element Index="[2]" Value="2#0000_0000_0000_0000"/>
<Element Index="[3]" Value="2#0000_0000_0000_0000"/>
</ArrayMember>
</Structure>
</Data>
</InputTag>
<OutputTag>
<Data>00 00 00 00 00 00 00 00</Data>
<ForceData>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00</ForceData>
<Data Format="Decorated"><Structure DataType="AB:1771_ACN15_8Bytes:O:0">
<ArrayMember Name="Data" DataType="INT" Dimensions="4" Radix="Binary">
<Element Index="[0]" Value="2#0000_0000_0000_0000"/>
<Element Index="[1]" Value="2#0000_0000_0000_0000"/>
<Element Index="[2]" Value="2#0000_0000_0000_0000"/>
<Element Index="[3]" Value="2#0000_0000_0000_0000"/>
</ArrayMember>
</Structure>
</Data>
</OutputTag>
</Connection>
</Connections>
</Communications>
</Module>
</Modules>
<AddOnInstructionDefinitions/>
<Tags>
<Tag Name="BTR" TagType="Base" DataType="MESSAGE">
<Data Format="Message">
<MessageParameters MessageType="Block Transfer Read" RequestedLength="0" ConnectionPath="Remote_1771" CommTypeCode="4" Channel="&apos;$00&apos;" Slot="0" LocalIndex="0" LocalElement="BTR_int_buffer_read" CacheConnections="FALSE"/>
</Data>
</Tag>
<Tag Name="BTR_cfg" TagType="Base" DataType="BT_CONFIGURATION" Dimensions="4">
<Data>07 00 00 00 04 00 00 00 01 05 02 04 02 04 7C 01 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
21 00 00 00 20 00 00 00 6C 81 9A 02 B8 E7 7C 01 
4E 24 00 00 02 00 00 00 00 00 00 00 04 00 00 00 
50 00 00 00 21 00 00 00 84 0F 9F 66 38 CE 7C 01 
01 00 00 00 01 00 00 00 00 00 00 00 05 00 01 00 
04 00 00 00 01 05 02 04 02 04 2F 00 01 00 00 00 
91 00 00 00 F0 85 39 00 70 85 39 00 30 00 00 00 
21 00 00 00 B0 9D 89 5F 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 10 B6 9A 02 50 00 00 00 
21 00 00 00 74 8A 18 00 00 00 00 00 00 00 00 00 
02 00 00 00 AC 85 00 00 05 00 02 00 04 00 00 00 
01 05 02 04 02 04 7C 01 10 00 00 00 51 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 05 00 03 00 04 00 00 00 01 05 02 04 
02 04 00 00 D3 00 00 00 00 00 00 00 00 00 00 00 
B0 96 39 00 60 00 00 00 21 00 00 00 24 19 18 00 
00 00 00 00 70 00 00 00 31 00 00 00 B0 9D 89 5F 
00 00 00 00 89 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 10 00 00 00 00 00 00 00 EC 96 00 00</Data>
<Data Format="Decorated"><Array DataType="BT_CONFIGURATION" Dimensions="4">
<Element Index="[0]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="7"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="0"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
<Element Index="[1]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="5"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="1"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
<Element Index="[2]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="5"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="2"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
<Element Index="[3]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="5"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="3"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
</Array>
</Data>
</Tag>
<Tag Name="BTR_index" TagType="Base" DataType="DINT" Radix="Decimal">
<Data>00 00 00 00</Data>
<Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</Data>
</Tag>
<Tag Name="BTR_ints_to_dints" TagType="Base" DataType="CONTROL">
<Data>00 00 00 00 00 00 00 00 00 00 00 00</Data>
<Data Format="Decorated"><Structure DataType="CONTROL">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="POS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="EU" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="EM" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="UL" DataType="BOOL" Value="0"/>
<DataValueMember Name="IN" DataType="BOOL" Value="0"/>
<DataValueMember Name="FD" DataType="BOOL" Value="0"/>
</Structure>
</Data>
</Tag>
<Tag Name="BTR_int_buffer_read" TagType="Base" DataType="INT" Dimensions="5" Radix="Decimal">
<Data>02 00 FE FF 00 00 FE FF 08 00</Data>
<Data Format="Decorated"><Array DataType="INT" Dimensions="5" Radix="Decimal">
<Element Index="[0]" Value="2"/>
<Element Index="[1]" Value="-2"/>
<Element Index="[2]" Value="0"/>
<Element Index="[3]" Value="-2"/>
<Element Index="[4]" Value="8"/>
</Array>
</Data>
</Tag>
<Tag Name="BTW" TagType="Base" DataType="MESSAGE">
<Data Format="Message">
<MessageParameters MessageType="Block Transfer Write" RequestedLength="0" ConnectionPath="Remote_1771" CommTypeCode="4" Channel="&apos;$00&apos;" Slot="0" LocalIndex="0" LocalElement="BTW_int_buffer_write" CacheConnections="FALSE"/>
</Data>
</Tag>
<Tag Name="BTW_cfg" TagType="Base" DataType="BT_CONFIGURATION" Dimensions="4">
<Data>03 00 00 00 04 00 00 00 01 05 02 04 02 04 00 00 
20 00 00 00 51 00 00 00 68 9D 38 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 08 9E 38 00 60 CD 38 00 
00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 
04 00 00 00 01 05 02 04 02 04 00 00 20 00 00 00 
51 00 00 00 C4 35 37 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 02 00 02 00 04 00 00 00 
01 05 02 04 02 04 38 00 20 00 00 00 51 00 00 00 
28 D8 38 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
C8 D8 38 00 E0 CA 38 00 00 00 00 00 00 00 00 00 
00 00 00 00 05 00 03 00 04 00 00 00 01 05 02 04 
02 04 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 20 00 00 00 41 00 00 00 00 00 00 00 
00 00 00 00 07 00 8A 01 8C 69 30 00 DC 31 38 00 
5F 00 43 00 40 00 00 00 E8 31 38 00 84 0F 9F 66 
38 CE 38 00 00 00 00 00 00 00 00 00 00 00 00 00</Data>
<Data Format="Decorated"><Array DataType="BT_CONFIGURATION" Dimensions="4">
<Element Index="[0]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="3"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="0"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
<Element Index="[1]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="1"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="1"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
<Element Index="[2]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="2"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="2"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
<Element Index="[3]">
<Structure DataType="BT_CONFIGURATION">
<DataValueMember Name="REQ_LEN" DataType="INT" Radix="Decimal" Value="5"/>
<DataValueMember Name="Slot" DataType="SINT" Radix="Decimal" Value="3"/>
<StructureMember Name="Path" DataType="STRING">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="4"/>
<DataValueMember Name="DATA" DataType="STRING" Radix="ASCII">
<![CDATA['$01$05$02$04']]>
</DataValueMember>
</StructureMember>
</Structure>
</Element>
</Array>
</Data>
</Tag>
<Tag Name="BTW_dints_to_ints" TagType="Base" DataType="CONTROL">
<Data>00 00 00 00 00 00 00 00 00 00 00 00</Data>
<Data Format="Decorated"><Structure DataType="CONTROL">
<DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="POS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="EU" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="EM" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="UL" DataType="BOOL" Value="0"/>
<DataValueMember Name="IN" DataType="BOOL" Value="0"/>
<DataValueMember Name="FD" DataType="BOOL" Value="0"/>
</Structure>
</Data>
</Tag>
<Tag Name="BTW_index" TagType="Base" DataType="DINT" Radix="Decimal">
<Data>00 00 00 00</Data>
<Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</Data>
</Tag>
<Tag Name="BTW_int_buffer_write" TagType="Base" DataType="INT" Dimensions="5" Radix="Decimal">
<Data>00 00 00 00 00 00 00 00 00 00</Data>
<Data Format="Decorated"><Array DataType="INT" Dimensions="5" Radix="Decimal">
<Element Index="[0]" Value="0"/>
<Element Index="[1]" Value="0"/>
<Element Index="[2]" Value="0"/>
<Element Index="[3]" Value="0"/>
<Element Index="[4]" Value="0"/>
</Array>
</Data>
</Tag>
<Tag Name="BT_input" TagType="Base" DataType="DINT" Dimensions="4 5" Radix="Decimal">
<Data>00 00 00 00 FE FF FF FF 00 00 00 00 FE FF FF FF 
0A 00 00 00 02 00 00 00 FE FF FF FF 00 00 00 00 
FE FF FF FF 0A 00 00 00 02 00 00 00 FE FF FF FF 
00 00 00 00 FE FF FF FF 0A 00 00 00 02 00 00 00 
FE FF FF FF 00 00 00 00 FE FF FF FF 0A 00 00 00</Data>
<Data Format="Decorated"><Array DataType="DINT" Dimensions="4,5" Radix="Decimal">
<Element Index="[0,0]" Value="0"/>
<Element Index="[0,1]" Value="-2"/>
<Element Index="[0,2]" Value="0"/>
<Element Index="[0,3]" Value="-2"/>
<Element Index="[0,4]" Value="10"/>
<Element Index="[1,0]" Value="2"/>
<Element Index="[1,1]" Value="-2"/>
<Element Index="[1,2]" Value="0"/>
<Element Index="[1,3]" Value="-2"/>
<Element Index="[1,4]" Value="10"/>
<Element Index="[2,0]" Value="2"/>
<Element Index="[2,1]" Value="-2"/>
<Element Index="[2,2]" Value="0"/>
<Element Index="[2,3]" Value="-2"/>
<Element Index="[2,4]" Value="10"/>
<Element Index="[3,0]" Value="2"/>
<Element Index="[3,1]" Value="-2"/>
<Element Index="[3,2]" Value="0"/>
<Element Index="[3,3]" Value="-2"/>
<Element Index="[3,4]" Value="10"/>
</Array>
</Data>
</Tag>
<Tag Name="BT_input_modules" TagType="Base" DataType="DINT" Radix="Decimal">
<Data>00 00 00 00</Data>
<Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</Data>
</Tag>
<Tag Name="BT_output" TagType="Base" DataType="DINT" Dimensions="4 5" Radix="Decimal">
<Data>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</Data>
<Data Format="Decorated"><Array DataType="DINT" Dimensions="4,5" Radix="Decimal">
<Element Index="[0,0]" Value="0"/>
<Element Index="[0,1]" Value="0"/>
<Element Index="[0,2]" Value="0"/>
<Element Index="[0,3]" Value="0"/>
<Element Index="[0,4]" Value="0"/>
<Element Index="[1,0]" Value="25"/>
<Element Index="[1,1]" Value="0"/>
<Element Index="[1,2]" Value="0"/>
<Element Index="[1,3]" Value="0"/>
<Element Index="[1,4]" Value="0"/>
<Element Index="[2,0]" Value="25"/>
<Element Index="[2,1]" Value="0"/>
<Element Index="[2,2]" Value="0"/>
<Element Index="[2,3]" Value="0"/>
<Element Index="[2,4]" Value="0"/>
<Element Index="[3,0]" Value="25"/>
<Element Index="[3,1]" Value="0"/>
<Element Index="[3,2]" Value="0"/>
<Element Index="[3,3]" Value="0"/>
<Element Index="[3,4]" Value="0"/>
</Array>
</Data>
</Tag>
<Tag Name="BT_output_modules" TagType="Base" DataType="DINT" Radix="Decimal">
<Data>00 00 00 00</Data>
<Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</Data>
</Tag>
</Tags>
<Programs>
<Program Name="MainProgram" TestEdits="false" MainRoutineName="MainRoutine" Disabled="false">
<Tags/>
<Routines>
<Routine Name="MainRoutine" Type="RLL">
<RLLContent>
<Rung Number="0" Type="N">
<Comment>
<![CDATA[
All information provided  - No Warranty or implied merchantability. 
Refer to the RSLogix 5000 End User License Agreement (EULA) in the Release Notes

]]>
</Comment>
<Text>
<![CDATA[NOP();]]>
</Text>
</Rung>
<Rung Number="1" Type="N">
<Comment>
<![CDATA[Rungs 1 - 5 use a single MSG instruction to read blocks of integers from a series of block transfer modules. The rungs use a user-defined data type and three arrays.

User-Defined Data Type - BT_CONFIGURATION
The user-defined data named BT_CONFIGURATION contains a member for each property of the message that needs to change for each module: number of elements (INTs) to read or write, slot number of the module, and path to the 1771-ACN module.

Configuration Array - BTR_cfg
The BTR_cfg array stores the configuration properties for each BT module (number of elements, slot number, etc). It uses the BT_CONFIGURATION data type. The number of elements in the array is equal to the maximum number of modules that the MSG instruction reads.

Temporary Buffer - BTR_int_buffer_read
Block transfer instructions read 16-bit integers (INTs). Logix5000 controllers work best with 32-bit integers (DINTs). To convert the INTs to DINTs, the MSG instruction read the integers into BTR_int_buffer_read, which is an array of INTs. The number of elements in the array is equal to the maximum number of elements that the MSG reads from any module.

Data Array - BT_input
A two-dimensional array stores the data from the modules for use by other instructions. The data type of the array is DINT[x,y], where x equals the number of modules to read and y equals the length of the temporary buffer (size of the largest block from any of the modules).
]]>
</Comment>
<Text>
<![CDATA[NOP();]]>
</Text>
</Rung>
<Rung Number="2" Type="N">
<Comment>
<![CDATA[The SIZE instruction determines the number of elements in the first dimension (Dim 0) of the BT_input array. Since this dimension contains one element for each BT module, this instruction determines how many modules the MSG instruction must read. A subsequent rung uses this number to determine the end of the sequence of MSGs.]]>
</Comment>
<Text>
<![CDATA[SIZE(BT_input[0,0],0,BT_input_modules);]]>
</Text>
</Rung>
<Rung Number="3" Type="N">
<Comment>
<![CDATA[The MSG instruction reads the input values from a BT module and stores the values in BTR_int_buffer_read.

Each time the instruction is done, it automatically restarts and sends another message.

Prior to each message, the series of MOV and COP instructions load the appropriate configuration properties into the MSG instruction so it can read the next BT module. The configuration properties load from the BTR_cfg array.
 
After each MSG, a subsequent rung increments the BTR_index tag. This loads the configuration properties for the next module into the MSG instruction before it executes again.
]]>
</Comment>
<Text>
<![CDATA[XIO(BTR.EN)MOV(BTR_cfg[BTR_index].REQ_LEN,BTR.REQ_LEN)MOV(BTR_cfg[BTR_index].Slot,BTR.Slot)COP(BTR_cfg[BTR_index].Path,BTR.Path,1)MSG(BTR);]]>
</Text>
</Rung>
<Rung Number="4" Type="N">
<Comment>
<![CDATA[After the MSG instruction reads data from a module (BTR.DN is on), this rung converts the INT values from the BT module to DINT values for use in the project:

The MOV instruction sets the length of the FAL instruction equal to the number of elements that the MSG reads.

The FAL instruction then loads the values from BTR_int_buffer_read into BT_input. This converts the values to DINTs for use in the project.

BTR_index determines where in the first dimension of BT_input to store the values. Each element of this dimension corresponds to a specific BT module.

]]>
</Comment>
<Text>
<![CDATA[XIC(BTR.DN)RES(BTR_ints_to_dints)MOV(BTR.REQ_LEN,BTR_ints_to_dints.LEN)FAL(BTR_ints_to_dints,?,?,all,BT_input[BTR_index,BTR_ints_to_dints.POS],BTR_int_buffer_read[BTR_ints_to_dints.POS]);]]>
</Text>
</Rung>
<Rung Number="5" Type="N">
<Comment>
<![CDATA[After the MSG instruction reads data from a module and the FAL converts it to DINTs (BTR_ints_to_dints.DN is on), the ADD instruction increments the BTR_index. This lets the MSG instruction read the next module.
]]>
</Comment>
<Text>
<![CDATA[XIC(BTR_ints_to_dints.DN)ADD(1,BTR_index,BTR_index);]]>
</Text>
</Rung>
<Rung Number="6" Type="N">
<Comment>
<![CDATA[If the EQU instruction is true, the MSG instruction has read the last BT module. The CLR instruction resets BTR_index to zero. This lets the MSG instruction start the series of reads again, starting with the first module.
]]>
</Comment>
<Text>
<![CDATA[EQU(BTR_index,BT_input_modules)CLR(BTR_index);]]>
</Text>
</Rung>
<Rung Number="7" Type="N">
<Comment>
<![CDATA[Rungs 7 - 11 use a single MSG instruction to write blocks of integers to a series of block transfer modules. The rungs use a user-defined data type and three arrays.

User-Defined Data Type - BT_CONFIGURATION
The user-defined data named BT_CONFIGURATION contains a member for each property of the message that needs to change for each module: number of elements (INTs) to read or write, slot number of the module, and path to the 1771-ACN module.

Configuration Array - BTW_cfg
The BTW_cfg array stores the configuration properties for each BT module (number of elements, slot number, etc). It uses the BT_CONFIGURATION data type. The number of elements in the array is equal to the maximum number of modules to which the MSG instruction writes.

Temporary Buffer - BTW_int_buffer_write
Block transfer instructions write 16-bit integers (INTs). Logix5000 controllers work best with 32-bit integers (DINTs). To convert DINTs from the project to INTs for the MSG, an FAL instruction converts the DINTs to INTs and stores them in BTW_int_buffer_write. This is an array of INTs. The number of elements in the array is equal to the maximum number of elements that the MSG writes to any module. The MSG then writes the values in BTW_int_buffer_write.

Data Array - BT_output
A two-dimensional array stores the data for the modules. The data type of the array is DINT[x,y], where x equals the number of modules to which to write and y equals the length of the temporary buffer (size of the largest block for any of the modules).

]]>
</Comment>
<Text>
<![CDATA[NOP();]]>
</Text>
</Rung>
<Rung Number="8" Type="N">
<Comment>
<![CDATA[The SIZE instruction determines the number of elements in the first dimension (Dim 0) of the BT_output array. Since this dimension contains one element for each BT module, this instruction determines how many modules to which the MSG instruction must write. A subsequent rung uses this number to determine the end of the sequence of MSGs.]]>
</Comment>
<Text>
<![CDATA[SIZE(BT_output[0,0],0,BT_output_modules);]]>
</Text>
</Rung>
<Rung Number="9" Type="N">
<Comment>
<![CDATA[Before the MSG instruction writes data to a module (BTW.EN is off), this rung converts the DINT values from the project to INT values for module:

The MOV instruction sets the length of the FAL instruction equal to the number of elements that the MSG must write to this module.

The FAL instruction then loads the values from BT_output into BTW_int_buffer_write. This converts the values to INTs for the MSG.

BTW_index determines from where in the first dimension of BT_ output to get the data for the FAL Each element of this dimension corresponds to a specific BT module.

]]>
</Comment>
<Text>
<![CDATA[XIO(BTW.EN)RES(BTW_dints_to_ints)MOV(BTW_cfg[BTW_index].REQ_LEN,BTW_dints_to_ints.LEN)FAL(BTW_dints_to_ints,?,?,ALL,BTW_int_buffer_write[BTW_dints_to_ints.POS],BT_output[BTW_index,BTW_dints_to_ints.POS]);]]>
</Text>
</Rung>
<Rung Number="10" Type="N">
<Comment>
<![CDATA[After the FAL instruction converts the DINTs to INTs (BTW_dints_to_ints.DN is on), the MSG instruction sends the values in BTW_int_buffer_write to the BT module.

Prior to each message, the series of MOV and COP instructions load the appropriate configuration properties into the MSG instruction so it can write to the next BT module. The configuration properties load from the BTW_cfg array.
 
After each MSG, a subsequent rung increments the BTW_index tag. This loads the configuration properties for the next module into the MSG instruction before it executes again.

]]>
</Comment>
<Text>
<![CDATA[XIC(BTW_dints_to_ints.DN)MOV(BTW_cfg[BTW_index].REQ_LEN,BTW.REQ_LEN)COP(BTW_cfg[BTW_index].Path,BTW.Path,1)MOV(BTW_cfg[BTW_index].Slot,BTW.Slot)MSG(BTW);]]>
</Text>
</Rung>
<Rung Number="11" Type="N">
<Comment>
<![CDATA[After the MSG instruction writes to a module (BTW.DN is on), the ADD instruction increments the BTW_index. This lets the MSG instruction write to the next module.
]]>
</Comment>
<Text>
<![CDATA[XIC(BTW.DN)ADD(1,BTW_index,BTW_index);]]>
</Text>
</Rung>
<Rung Number="12" Type="N">
<Comment>
<![CDATA[If the EQU instruction is true, the MSG instruction has written to the last BT module. The CLR instruction resets BTW_index to zero. This lets the MSG instruction start the series of writes again, starting with the first module.
]]>
</Comment>
<Text>
<![CDATA[EQU(BTW_index,BT_output_modules)CLR(BTW_index);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
</Routines>
</Program>
</Programs>
<Tasks>
<Task Name="MainTask" Type="CONTINUOUS" Priority="10" Watchdog="500" DisableUpdateOutputs="false" InhibitTask="false">
<ScheduledPrograms>
<ScheduledProgram Name="MainProgram"/>
</ScheduledPrograms>
</Task>
</Tasks>
<CommPorts>
<SerialPort Channel="0" BaudRate="19200" Parity="No Parity" DataBits="8 Bits of Data" StopBits="1 Stop Bit" ComDriverId="DF1" RTSOffDelay="0" RTSSendDelay="0" ControlLine="No Handshake" RemoteModeChangeFlag="false" ModeChangeAttentionChar="27"
 SystemModeCharacter="83" UserModeCharacter="85" DCDWaitDelay="0">
<ASCII XONXOFFEnable="false" DeleteMode="0" EchoMode="0" TerminationChars="65293" AppendChars="2573" BufferSize="82"/>
<DF1 DuplicateDetection="true" ErrorDetection="BCC Error" EmbeddedResponseEnable="Autodetect" DF1Mode="Pt to Pt" ACKTimeout="50" NAKReceiveLimit="3" ENQTransmitLimit="3" TransmitRetries="3" StationAddress="0" ReplyMessageWait="5" PollingMode="Message Based (slave can initiate messages)"
 MasterMessageTransmit="Between station polls" NormalPollNodeFile="&lt;NA&gt;" NormalPollGroupSize="0" PriorityPollNodeFile="&lt;NA&gt;" ActiveStationFile="&lt;NA&gt;" SlavePollTimeout="3000" EOTSuppression="0" MaxStationAddress="31" TokenHoldFactor="1" EnableStoreFwd="false" StoreFwdFile="&lt;NA&gt;"
/>
</SerialPort>
</CommPorts>
<CST MasterID="0"/>
<WallClockTime LocalTimeAdjustment="0" TimeZone="0"/>
<Trends/>
</Controller>
</RSLogix5000Content>
