
77
after every transmission. For efficiency, it is recommended to enable “Cache
Connections”.
Figure 100: Setting the Communication Path
e)
Click “OK” to close the MSG Configuration dialog. At this stage, MainRoutine should look like
Figure 101.
Figure 101: MainRoutine
5)
Assign a tag to the XIO element.
a)
Double-click on the XIO element located to the left of the MSG block. In the drop-down box,
double-click on the “connection.EN” field. Refer to Figure 102. This configuration causes the
MSG instruction to automatically retrigger itself when it completes. While this is acceptable
for the purposes of this example, it can produce high network utilization. In actual practice, it
may be desirable to incorporate additional logic elements to allow triggering the MSG
instruction at a specific rate or under specific conditions.
6)
The program is now complete. Refer to Figure 103.
7)
Save, download and run the program.
a)
To view the values of the function codes being read from the interface card, double-click
“Controller Tags” in the controller organizer view.
b)
Select the “Monitor Tags” tab.
c)
Expand the data_array tag. Refer to Figure 104.
d)
21 function code values starting at function code M01 are being continuously read from the
interface card and placed in the 21 sequential offsets of data_array starting at the 50
th
offset
(data_array[50]). In Figure 104, we can see that data_array[50] (function code M01 / per-unit
frequency reference – final command) has a value of 11860 (11860/20000 = 59.3% of max
frequency), data_array[58] (function code M09 / output frequency) has a value of 3558
(35.58Hz), etc.
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: [email protected]