330180-50 This Appendix serves as a reference to users of the PLC Processors to program their modules. To initiate communication between the analog input and output modules and your PLC processor, you must enter block transfer instructions into your ladder logic program. Use this chapter to enter the necessary block transfer instructions into your ladder logic program. Block Transfer Programming Your module communicates with the processor through bidirectional block transfers. This is the sequential operation of both read and write block transfer instructions. A configuration block transfer write (BTW) is initiated when the analog module is first powered up, and subsequently only when the programmer wants to enable or disable features of the module. The configuration BTW sets the bits which enable the programmable features of the module, such as scaling, alarms, ranges, etc. Block transfer reads are performed to retrieve information from the module. Block transfer read (BTR) programming moves status and data from the module to the processor’s data table. The processor user program initiates the request to transfer data from the module to the processor. The transferred words contain module status, channel status and input data from the module. The following sample programs are minimum programs; all rungs and conditioning must be included in your application program. You can disable BTRs, or add interlocks to prevent writes if desired. Do not eliminate any storage bits or interlocks included in the sample programs. If interlocks are removed, the program may not work properly. Your program should monitor status bits, block transfer read and block transfer write activity. Sample Programs for FLEX I/O Analog Modules The following sample programs show you how to use your analog module efficiently when operating with a programmable controller. These programs show you how to: ATTENTION: If the analog module is not powered up before the remote I/O adapter, the adapter will not recognize the module. Make certain that the analog module is installed and powered before or simultaneously with the remote I/O adapter. If the adapter does not establish communication with the module, cycle power to the adapter. Publication 1794-UM062B-EN-P - March 2020 78 Module Programming • configure the module • read data from the module • update the module output channels (if used) These programs illustrate the minimum programming required for communication to take place. PLC-2 Programming The 1794 analog I/O modules are not recommended for use with PLC-2® family programmable controllers due to the number of digits needed for high resolution. In addition, the data returned from the analog-to-digital converter in the module is 12-bit resolute. This value is left-justified into a 16-bit field, reserving the most significant bit for a sign bit. PLC-3 Programming Block transfer instructions with the PLC-3® processor use one binary file in a data table section for module location and other related data. This is the block transfer control file. The block transfer data file stores data that you want transferred to your module (when programming a block transfer write) or from your module (when programming a block transfer read). The address of the block transfer data files are stored in the block transfer control file. The same block transfer control file is used for both the read and write instructions for your module. A different block transfer control file is required for every module. A sample program segment with block transfer instructions is shown in Figure PLC-3 Family Sample Program Structure for a 1794-IE8 Module. Publication 1794-UM062B-EN-P - March 2020 Module Programming 79 PLC-3 Family Sample Program Structure for a 1794-IE8 Module Program Action At power-up in RUN mode, or when the processor is switched from PROG to RUN, the user program enables a block transfer read. Then it initiates a block transfer write to configure the module if the power-up bit is set. Thereafter, the program continuously performs read block transfers. The push button allows the user to manually request a block transfer write to configure the module. EN BTR BLOCK TRANSFER READ RACK: GROUP: SLOT: DATA FILE: 7 0 0 B4:0 LENGTH: CONTROL: 9 B3:0 05 Pushbutton B3:0 15 DN ER Block Transfer Read Done Bit B3:0 Block Transfer Write Done Bit 12 15 13 Enable Done Error EN BTR BLOCK TRANSFER WRITE RACK: GROUP: SLOT: DATA FILE: 7 0 0 B5:0 LENGTH: CONTROL: 1 B3:0 DN ER 02 05 03 Enable Done Error Power-up Bit1 B4:8 15 1 Power-up bit included in Series B modules only. 1 2 TIP You must create the data file for the block transfers before you enter the block transfer instructions. Publication 1794-UM062B-EN-P - March 2020 80 Module Programming PLC-3 Family Sample Program Structure for a 1794-OE4 Module Program Action At power-up in RUN mode, or when the processor is switched from PROG to RUN, the user program enables a block transfer read. Then it initiates a block transfer write to configure the module and send data values. Thereafter, the program continuously performs read block transfers and write block transfers. PLC-3 Family Sample Program Structure for a 1794-IE4XOE2 Module EN BTR BLOCK TRANSFER READ RACK: GROUP: SLOT: DATA FILE: 7 1 0 B7:0 LENGTH: CONTROL: 1 B6:0 05 B6:0 15 DN ER Block Transfer Read Done Bit B6:0 Block Transfer Write Done Bit 12 15 13 Enable Done Error EN BTR BLOCK TRANSFER WRITE RACK: GROUP: SLOT: DATA FILE: 7 1 0 B8:0 LENGTH: CONTROL: 14 B6:0 DN ER 02 05 03 Enable Done Error 1 2 TIP You must create the data file for the block transfers before you enter the block transfer instructions EN BTR BLOCK TRANSFER READ RACK: GROUP: SLOT: DATA FILE: 7 2 0 B10:0 LENGTH: CONTROL: 5 B9:0 05 B9:0 15 DN ER Block Transfer Read Done Bit B9:0 Block Transfer Write Done Bit EN BTR BLOCK TRANSFER WRITE RACK: GROUP: SLOT: DATA FILE: 7 2 0 B11:0 LENGTH: CONTROL: 8 B9:0 DN ER 1 2 Publication 1794-UM062B-EN-P - March 2020 Module Programming 81 Program Action At power-up in RUN mode, or when the processor is switched from PROG to RUN, the user program enables a block transfer read. Then it initiates a block transfer write to configure the module and send data values. Thereafter, the program continuously performs read block transfers and write block transfers. PLC-5 Programming The PLC-5® program is very similar to the PLC-3 program with the following exceptions: • block transfer enable bits are used instead of done bits as the conditions on each rung. • separate block transfer control files are used for the block transfer instructions. PLC-5 Family Sample Program Structure for a 1794-IE8 Module Program Action At power-up in RUN mode, or when the processor is switched from PROG to RUN, the user program enables a block transfer read. Then it initiates a block transfer write to configure the modul |