beautypg.com

Df1 programming example, Command summary (cont‘d) df1 programming example – Rockwell Automation 5370 Color CVIM Communications Manual User Manual

Page 130

background image

Chapter 5
Using the RS–232 Ports

5–62

Table 5.B
DF1 Command Summary (Cont’d)

Command

Command Structure

Field Descriptions

Write Display

0B 02 Data

Data =
01–Image Only
02–Failed Tools
03–All Tools
04–l/O Page
05–Results Page
06–Stats 1 Page
07–Stats 2 Page
08–Page Up Same Display
09–Page Down Same Display

OB 13 Data

Data =
01–Go On Reject
02–Freeze On First Reject
03–Freeze On All Reject
04–Freeze On Next
Inspection
05–Halt On Reject

OB 14 Data

Data =
01–Resume
02–Reset Statistics
03–Reset Counters
04–Page Up
05–Page Down

The following is a sample DF1 program written in Microsoft C, version 6.0.
The program configures the host computer’s serial port for 9600 Baud
communications. The program displays a description and related material,
then asks you to select either COM 1 or COM 2. Next you’ll see a menu
which prompts you to select one of the following operations:

1 Echo the word “HELLO” to test the communications port.

2 Trigger the Color CVIM module to perform an inspection.

3 Read the discrete bit results.

4 Read Results Block #1.

5 Read configuration blocks 1–213.

6 Write to configuration blocks 1–213.

Note: You must first read the configuration before you write it because it is
stored in volatile memory (RAM).

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.

Command Summary (cont‘d)

DF1 Programming Example