Example program for accessing results data – Rockwell Automation 5370 CVIM Communications Manual User Manual
Page 58

Chapter 4
Using the Remote I/O Link
(Node Adapter)
4–21
Word 1, bits 8 – 15 of the first template block indicate the total number of
template blocks of the configuration. You must always upload or download
all of the template blocks as a unit. You cannot archive only a part of the
template blocks. When uploading templates from the CVIM module, the
program should read the first template block and check word 1, bits 8– 15 to
determine the number of template blocks to follow. The number of blocks
remaining is 1 less than the total number of template blocks. When
downloading templates to the CVIM module, the program must send all
template blocks. Bit 8 – 15 of word 1 determine the number of blocks to
send:
Note: An error in downloading templates will cause the loss of all templates
presently stored in CVIM module RAM.
The following program provides an example of using continuous block
transfer to detect and acquire new data (Reference line#1 X–position) after
an inspection is triggered. The program then counts the total number of
times new results were obtained by the PLC. The program assumes that the
CVIM module is rack 02 and the push buttons are rack 01.
Note: This is not the most efficient method to accomplish this function. A
faster method is to connect the data valid bit output on the 1771-JMB board
to a PLC input (refer to Figure 4.9). You can then use the valid bit output to
trigger a single read. Refer to Chapter 3 for a description of the data valid
bit.
The program has the following structure:
1. Waits for push button trigger.
2. Reads present number of total triggers before sending trigger request to
the CVIM module.
3. Triggers the CVIM module.
4. Continues to read total number of triggers to detect new data.
5. Retrieves new data.
6. Program waits for next push button trigger.
The program begins on the next page.
Transferring Template
Blocks (cont’d)
Example Program for
Accessing Results Data