Df1 programming example – Rockwell Automation 5370 CVIM Communications Manual User Manual
Page 123

Chapter 5
Using the RS-232 Ports
5–53
The following is a sample DF1 program written in C. The program
configures the host computer’s serial port for 9600 Baud communications.
The program then displays a menu which prompts the user to select one of
the following operations:
0. Echo the word “HELLO” to test the communications port.
1. Trigger the CVIM module to perform an inspection using toolset #1.
2. Read the discrete bit results for toolset 1.
3. Read the results block #1 for toolset 1.
4. Read gage #1 statistics for toolset 1.
5. Trigger the CVIM module to perform an inspection using toolset #2.
6. Read the discrete bit results for toolset 2.
7. Read the results block #1 for toolset 2.
8. Read gage #1 statistics for toolset 2.
9. Read configuration block n.
10.. Write configuration block n.
11.. Change display to results page, toolset 1.
12. Page up, toolset 1 display.
13. Page down, toolset 1 display.
14.. Change display to results page, toolset 2.
15. Page up, toolset 2 display.
16. Page down, toolset 2 display.
The program demonstrates a simple implementation of the DF1 protocol.
Your actual application program may require some enhancements such as
increased error checking or time–out conventions.
The sample program begins on the next page.
DF1 Programming Example