ICC
Figure 105: Reading Via Multiple MSG Instructions
13.2.11 ControlLogix Example: Reading and Writing
Often times, applications may need to both read data from and write data to the drive. At a minimum, this will require two MSG instructions and two message controller tags. Figure 106 shows an example of two MSG instructions, one for reading and one for writing. The only item of note that differentiates this example from the
Figure 107 shows the configuration details of the example wr_connection MSG instruction. Note that the chosen “Message Type” is “CIP Data Table Write”, and that this instruction will only be writing to one drive register: namely, the frequency command (Destination Element is wr_reg_1008). The Source Element in this case is the 8th element (starting from index 0) of an INT array tag named “wr_data_array”.
Note that when writing data via explicit messaging, use caution to ensure that the commanded registers are not also simultaneously being commanded in the background via I/O messaging. Indeterminate behavior can occur if MSG instructions and background I/O data transfers are both writing to the same registers. In other words, if the I/O messaging example procedure detailed in section 13.2.4 has already been implemented, and the same program is now being modified to implement explicit messaging, then it is recommended to inhibit the target module by selecting the “Inhibit Module” checkbox in the Connection tab of the Module Properties dialog.
92