Bulletin 5370 Color CVIM
Configurable Vision Input Module
Communications Manual
Important User Information
Solid state equipment has operational characteristics differing from those of
electromechanical equipment. “Safety Guidelines for the Application,
Installation and Maintenance of Solid State Controls” (Publication SGI-1.1)
describes some important differences between solid state equipment and
hard–wired electromechanical devices. Because of this difference, and also
because of the wide variety of uses for solid state equipment, all persons
responsible for applying this equipment must satisfy themselves that each
intended application of this equipment is acceptable.
In no event will the Allen-Bradley Company be responsible or liable for
indirect or consequential damages resulting from the use or application of
this equipment.
The examples and diagrams in this manual are included solely for illustrative
purposes. Because of the many variables and requirements associated with
any particular installation, the Allen-Bradley Company cannot assume
responsibility or liability for actual use based on the examples and diagrams.
No patent liability is assumed by Allen-Bradley Company with respect to use
of information, circuits, equipment, or software described in this manual.
Reproduction of the contents of this manual, in whole or in part, without
written permission of the Allen-Bradley Company is prohibited.
Throughout this manual we use notes to make you aware of safety
considerations.
ATTENTION: Identifies information about practices or
circumstances that can lead to personal injury or death, property
!
damage, or economic loss.
Attentions help you:
• identify a hazard
• avoid the hazard
• recognize the consequences
Important: Identifies information that is especially important for successful
application and understanding of the product.
PLC is a registered trademark of Allen-Bradley Company, Inc.
Pyramid Integrator, DTL and CVIM are trademarks of Allen-Bradley Company, Inc.
VAX is registered trademark of Digital Equipment Corporation.
Read this chapter to familiarize yourself with the rest of the manual. You will
learn about:
• Contents of the manual.
• Intended audience.
• How to use the manual.
This manual describes how to communicate with a Color CVIM module
(Catalog No. 5370–CVIMC) with at least firmware revision A01.
This manual explains how to communicate with the Bulletin 5370 Color
Configurable Vision Input Module (Color CVIM) module using a variety of
peripheral devices.
ChapterTitlePurpose
1Using This ManualProvides an overview.
2Introduction
3Using Local I/O
4
5Using the RS–232 Ports
6
Using the Remote I/O Link
(Node Adapter)
Using the Pyramid
Integrator Backplane
Describes the basic options available for
communications with the Color CVIM module.
Describes how to use the discrete I/O module
(Catalog No. 2801–JMB).
Describes how to access data through the remote
I/O port with a PLC–2
Includes sample programs.
Describes how to access data through the RS–232
interfaces using ASCII and DF1 formatted
commands. Provides sample programs.
Describes how to access shared memory through
the Pyramid Integrator information processor
and/or MicroVAX
, or PLC–3, PLC–5.
. Provides sample programs.
1–1
Chapter 1
Using this Manual
Overview of this Manual
(cont’d)
Chapter
Appendix
A
Appendix
B
Appendix
C
Appendix
D
Appendix
E
TitlePurpose
Results/Configuration Data
Overview
Discrete I/O Results BitsProvides a description of the 256 discrete input bits
Numerical Results DataProvides a description of inspection results data.
Configuration DataProvides information on the configuration blocks.
ASCII Conversion ChartProvides equivalent values for the ASCII character
Glossary
Index
Provides an overview of the configuration and
results data. Describes data formats.
and 256 discrete output bits.
set.
Intended Audience
This manual was written for an experienced PLCR user or computer
programmer. The user of this manual should:
• Know how to program the host device being used to communicate with
the Color CVIM module. For example, if you are using a PLC–5 to
communicate with the Color CVIM module, you must have a background
in programming a PLC–5.
• Know terms common to the computer and programmable controller
industries.
• Understand how to operate and configure the Color CVIM module before
using this manual. You may not understand many of the terms being used
unless you have read the Color CVIM User’s Reference Manual, Catalog
No. 5370–ND009.
1–2
Chapter 1
Using this Manual
Related Publications
Publication No.TitlePurpose of Publication
Catalog No.
5370–ND011
Catalog No.
5370–ND009
1772–6.8.1PLC–2/20 Programming and Operations Manual
1772–6.8.3PLC–2/30 Programming and Operations Manual
1772–6.8.6Mini–PLC–2/05 Programming and Operations Manual
1772–6.8.2Mini–PLC–2/15 Programming and Operations Manual
1775–6.7.1PLC–3 Controller Installation and Operations Manual
1785–6.8.2PLC–5 Family Processor Manual
5000–2.3Allen–Bradley Pyramid Integrator Technical OverviewProvides an overview of the Pyramid Integrator.
5000–2.17Allen–Bradley Pyramid Integrator Technical DescriptionProvides a technical description of the Pyramid Integrator.
5000–2.20MicroVAX Information Processor Technical Description
5000–6.2.10Allen–Bradley Pyramid Integrator Start–up and Integration Manual
Table 1.A lists related publications that you may require:
Table 1.A
Related Publications
Color CVIM Getting Started ManualDescribes the basics of the Color CVIM user interface.
Color CVIM User’s Reference Manual
Provides step–by–step procedures for the installation,
configuration and operation of the Color CVIM module.
Provides instructions on how to program a PLC–2/20
programmable controller.
Provides instructions on how to program a PLC–2/30
programmable controller.
Provides instructions on how to program a
Mini–PLC–2/05
Provides instructions on how to program a
Mini–PLC–2/15
Provides instructions on how to program a PLC–3
programmable controller.
Provides instructions on how to program a PLC–5
programmable controller.
Provides a technical description of the MicroVAX
Information Processor.
Provides instructions on installing Pyramid Integrator
devices.
Provides instructions on how to use Pyramid Integrator
devices.
programmable controller.
programmable controller.
1–3
Chapter 1
Using this Manual
How to Use this Manual
When using this manual, we recommend that you do the following.
1. Become familiar with the Color CVIM module by reading the User’s
Reference Manual, Catalog No. 5370–ND009. If possible, use the Color
CVIM module to become familiar with its operation. Only with a
thorough understanding of the Color CVIM module will you be able to
interpret the data that is stored in its memory.
2. Read Chapters 1 and 2 of this manual. After reading these introductory
chapters, you will be able to determine which of the remaining chapters,
some or all, you will need to read. See note below.
Important Note: This manual is divided into chapters. It is not necessary
to read all of the information contained in this manual. Chapters 1 and 2
are mandatory. You can read the remaining chapters on a “need to know
basis” depending upon the information you want to read or write and the
type of host device you are using.
3. Use the programming examples provided in each section as a guide to
create your own programs. In some applications, you may be able to
simply modify the example provided.
These examples are included solely for illustrative purposes. Because the
many variables and special requirements associated with any particular
installation, Allen–Bradley Company cannot assume responsibility or
liability for their applicability to your own situation.
Nomenclature
Trademarks
1–4
In this Chapter and in subsequent chapters we refer to the Bulletin 5370
Configurable Vision Input Module as the Color CVIM module. In some
tables we use the abbreviation “PI” to indicate the PLC–5/250 Pyramid
Integrator. We have also provided a glossary in the back of this manual. Use
this glossary whenever you are unsure of the meaning of a word.
In this manual, we use the following trademarks:
CVIM is a trademark of Allen–Bradley
PLC, PLC–2, PLC–2/20, PLC–2/30, PLC–2/05,
Microsoft is a registered trademark of Microsoft Corporation
MicroVAX is a registered trademark of Digital Equipment Corporation
GW BASIC is a trademark of Microsoft Corporation
Introduction
Chapter
2
Chapter Objectives
How is Data Stored in
the Color CVIM Module?
How Does the Host Device
Read Configuration/Results
Information?
In this chapter we provide you with an overview of the options for
communicating with the Color CVIM module. We also describe the types of
data that can be accessed or manipulated. The descriptions in this chapter
will enable you to determine the type of communications most suitable for
your application. You then can proceed to the chapter of this manual that
describes the selected option.
The result and command data that you can access with a host device is stored
in an area of Random Access Memory (RAM) inside the Color CVIM
module. Configuration data which controls the operating instructions for the
Color CVIM module is located in a separate area of memory which can be
also be accessed through a host device. Refer to Appendix A for an overview
of configuration/results memory. Appendix B, C, and D contain tables listing
the information stored in results and configuration memory locations.
The remainder of this chapter describes the various options you have for
accessing this information. Refer to Figure 2.1. In summary, your host device
will be linked to the Color CVIM module through one of the following ports:
• Remote I/O (Node Adapter)
• RS–232 Interface(s)
• Pyramid Integrator Backplane
• Local I/O Board
Note: The local I/O board has sixteen discrete I/O lines. Fourteen of these lines are
outputs only . One of the remaining lines is for input, and can be connected to a
presence–sensing device to trigger an inspection process. The other line is not used.
2–1
Chapter 2
Introduction
How Does the Host Device
Read Configuration/Results
Information? (cont’d)
COLOR
Figure 2.1
Color CVIM Module Communications Ports
2801
A
2801
2–2
Chapter 2
Introduction
Remote I/O (Node Adapter)
RS–232 Ports
The remote I/O port (RIO) is located on the front of the Color CVIM module
as shown in Figure 2.1. Using the remote I/O port, you can connect the
following types of devices:
• Allen–Bradley Programmable Controllers (PLC–2, –3, and –5).
• Host Computers which have the Allen–Bradley IBM Bus Scanner
(Catalog No. 6008–SI). The 6008–SI bus scanner is compatible with the
A–B 6121/22 Industrial Computer, Industrial Terminal (Catalog Nos.
1784– T50, 1784–T35), or other IBM PC/AT compatible devices.
As shown in Figure 2.1, the RS–232 ports are located on the I/O Interface
Boxes (Catalog No. 2801–N21, –N27). The I/O Interface Box is connected to
the MODULE I/O port on the front of the Color CVIM module. Using the
RS–232 interface(s) you can connect a variety of devices which use the
RS–232 standard:
• Computers
• Operator Interfaces such as Allen–Bradley Industrial Computers and
Terminals with serial ports.
Local I/O
Pyramid Integrator Backplane
• I/O modules such as the Flexible Interface Module (Catalog No.
2760–RB) or ASCII module (Catalog No. 1771–DA).
As shown in Figure 2.1, the local I/O consists of an I/O Board (Catalog No.
2801–JMB), I/O Interface Box (Catalog No. 2801–N21, –N27), an input and
up to 14 output modules as configured by the user. The Catalog No.
2801–NC17 cable connects the I/O interface box to the Color CVIM module.
Using the Pyramid Integrator backplane, you can directly communicate data
between the Color CVIM module and other devices installed in the Pyramid
Integrator chassis:
• Allen–Bradley PLC–5/250
• MicroVAX Information Processor
2–3
Chapter 2
Introduction
What Types of Information
can be Communicated?
Discrete Bit Information
Depending upon the type of interface in use, you can access some or all of
the information listed below:
• Warning and Pass/Fail data.
• Numerical inspection results.
• Configuration data.
With each inspection that the Color CVIM module performs, individual bits
are set. There are 256 bits that can be read as inputs to a host device. These
bits (part of the inspection results) indicate:
• Master fault.
• Mastership.
• Configuration fault.
• Module Busy flag.
• Missed Trigger flag.
• Results Valid flag.
• Inspection Tool Pass/Fail/Warning flags.
There are 128 bits that can be set as outputs by a host device to control the
operation of the Color CVIM module. These bits control:
For more information on the 256 discrete input and 128 discrete output bits
Note:
refer to Appendix B.
2–4
Chapter 2
Introduction
Results Blocks
Configuration Blocks
Communications Cables
The results data for each inspection are stored in Random Access Memory
(RAM) and overwrite the results of the previous inspection. The data stored
in results blocks contain information regarding reference windows,
inspection gages, inspection windows, etc. For a complete description of the
results blocks, refer to Appendix C.
The user developed inspection parameters of the Color CVIM module are
stored in the Color CVIM module’s memory as configuration blocks. This
area of memory can be read or manipulated through the Remote I/O port,
RS–232 ports (A & B) or Pyramid Integrator backplane. Refer to Appendix
D for a complete description of the configuration blocks and their contents.
If you are not using the Pyramid Integrator backplane for communications,
you will have to physically link the Color CVIM module to the host device.
If you need to create a communications cable, refer to the chapter that
describes the communications port you are using.
Memory Addressing
Depending upon how you access the Color CVIM module results and
configuration memory, you will have to address the data differently. If you
refer to Appendix A, B, and C you will notice that separate columns are
provided for Backplane, RS–232, and Remote I/O communications:
Note:
The RS–232 protocols (ASCII and DF1) do not access data using word and
bit addresses. Data is read/written in blocks. We have grouped the RS–232 and
Remote I/O ports together in Appendix B, C, and D (where appropriate) for your
convenience. You can ignore word and bit addresses if you are using the RS–232
ports (A & B).
2–5
Chapter 2
Introduction
Memory Addressing (cont’d)
When you communicate through the Pyramid Integrator backplane all of the
data words are numbered consecutively and grouped in blocks. When you
use the Remote I/O port, you select a specific block and the first word in
each block is word #0.
Table 2.A
Example of Addressing Results Block 1
Word Number
Pyramid Integrator
Backplane
32–950–63
RS–232 and
Remote I/O
In addition, PLC I/O bit numbers are entered in octal format when
referencing 1771 I/O, while PLC files and backplane communications
specify a decimal bit number. Figure 2.2 illustrates how bits are numbered.
Figure 2.2
Bit Numbering
Bit Number if Accessing Data Through
Remote I/O as a 1771 I/O Rack. (Octal Value)
2–6
Bit Number if Accessing Data Through the Backplane
or Remote I/O Port Using Integer Files. (Decimal V alue)
There are four communications ports which you can use simultaneously to
access Color CVIM module data (Remote I/O, RS–232 Ports A & B, and
Backplane). Only the host can issue commands to control the operation of
the Color CVIM module. You can read discrete bits and numerical results
information through any of the four communications ports, even through
non–host devices.
The Color CVIM can operate with multiple hosts. You can select one host to
perform Color CVIM module/host configuration transfers, and another host
to perform all other Color CVIM/host operations. The first of these two hosts
is referred to as the configuration host (CFG) because it is the sole source of
configuration information. The second, referred to as the system host (SYS),
can tell the system when to trigger and control the user interface. A system
host cannot supply a new configuration.
An example of using multiple hosts is to select RS–232 A as the CFG host,
and Remote I/O as the SYS host. If you select a single device as both CFG
and SYS hosts, then that device must be labeled as such.
Note: Any Color CVIM communications port can be used for reading results
block data regardless of whether or not the device connected to the port is
selected as a host.
Note: You can select the same host (Stand Alone, Pyramid, Remote I/O,
RS–232 A or B) as both the configuration host and the system host.
2–7
Using Local I/O
Chapter
3
Chapter Objectives
Equipment Connections
The objectives of this chapter are to help you plan:
• The number of discrete output lines (up to 14) that your application will
require.
• The function that each output line will perform in your application.
• The assignment of analysis tool “results” to output lines.
• The assignment of status signals to output lines.
• The electrical and mechanical connections of the trigger (input) and
output lines to your production equipment.
The local I/O consists of:
• I/O Interface Box (Catalog No. 2801–N21, –N27)
• I/O Board (Catalog No. 2801–JMB)
• User specified I/O modules (plug into I/O board)
• Communications Cable (2801–NC17)
As shown in Figure 3.1, the communications cable (Catalog No.
2801–NC17) is connected to the MODULE I/O port on the front of the Color
CVIM module and the connector on the I/O Interface box. The I/O board
connector slides into the connector slot on the I/O Interface Box.
3–1
Chapter 3
Using Local I/O
Equipment Connections
(cont’d)
Figure 3.1
Local I/O Equipment Connections
A
Planning Output
Line Assignments
3–2
This section provides a planning sheet that you can use to lay out the function
and tool assignments for output lines.
The term “function assignment” refers to the type of signal information that
you want an output line to carry to your production equipment.
The term “tool assignment” refers to the tool(s) that you assign to an output
line.
Note: Tools can be assigned only to output lines that you have assigned a“results”function. These output lines will carry the “pass/fail”results signals
from the tools during each inspection.
The next section, Planning Output Line Connections, provides electrical and
timing diagrams and data. You will need to use these diagrams to correctly
identify and connect the output lines to your production equipment.
Chapter 3
Using Local I/O
Using the Output Line
Planning Sheet
The Output Line Planning Sheet is a form on which you can lay out your
plans for each output line. On this form you can account for:
• The 14 output lines.
• The six output line functions.
• The 64 gages and their warning and fault outputs.
• The 48 windows and their warning and fault outputs.
• The 6 reference tools and their “pass/fail” outputs.
• The light probe with its separate red, green, and blue warning and fault
outputs.
Here is an example of how an Output Line Planning Sheet could be filled
out:
Table 3.A
Example Color CVIM Output Line Planning Sheet
Output Line Functions and Tool Assignments
9Master Fault
10Data Valid
11Module Busy
12Not Used
13Not Used
14Not Used
No.Rng.No.Rng.No.Rng.No.Rng.LineWin.RedGreenBlue
GageWindow
Reference
Tool
Light Probe
3–3
Chapter 3
Using Local I/O
Using the Output Line
Planning Sheet (cont’d)
The entries for the output lines have the following meanings:
• Output Line 1: The Results function is assigned to line 1. The Warning
Range results (W) for gages 1–4 and windows 1 and 2 are assigned to
output line 1.
• Output Line 2: The Results function is assigned to line 2. The Fault
Range results (F) for gages 1–4 and windows 1 and 2 are assigned to
output line 2.
• Output Line 3: The Results function is assigned to line 3. The “pass/fail”
results for reference line 1 and reference window 1 are assigned to line 3.
• Output Line 4: The Results function is assigned to line 4. The Warning
Range result from the red, blue and green light probe is assigned to line 4.
• Output Line 5: The Results function is assigned to line 5. The Fault
Range result from the red, blue and green light probe is assigned to line 5.
• Output Line 6: The Results function is assigned to line 6. The Warning
and Fault Range results for gages 1 and 2 are assigned to line 6.
• Output Line 7: The Strobe function is assigned to line 7.
• Output Line 8: The Trigger NAK function is assigned to line 8.
• Output Line 9: The Master Fault function is assigned to line 9.
• Output Line 10: The Data Valid function is assigned to line 10.
• Output Line 11: The Module Busy function is assigned to line 11.
• Output Lines 12–14: These lines are not used.
Note: Output lines 1–6 are assigned the Results function. These lines will
carry “pass/fail” results from the analysis tools to your production
equipment. Lines 7– 11 are assigned other functions. Lines 12–14 are not
used.
Here is a brief explanation of the signal functions that you can assign to the
output lines:
• Module Busy: This signal goes high when the Color CVIM system enters
the configuration mode and during a configuration download operation.
Module Busy goes low when the system enters the run mode (whether or
not triggers are present).
You can assign the Module Busy function to only one output line.
3–4
Chapter 3
Using Local I/O
Using the Output Line
Planning Sheet (cont’d)
Note: All of the remaining signal functions (except Strobe, Module Busy,
and Trigger NAKs) can be configured to produce a pulse whose duration
depends on the number of milliseconds that you assign to the Duration
parameter.
• Results: This signal occurs when the results of a tool inspection exceed
the warning and/or fault limits. (The tool must be assigned to an output
line that has already been assigned the Results function.)
You can assign the Results signal function to any unassigned output line.
As noted above, the Results signal function must be assigned to an output
line before any tool can be assigned to that line. Thus, if you wanted
inspection results from Ref. Line # 2 to be assigned to output line #10, you
would first have to assign the Results signal function to output line #10.
Note: You can assign the inspection results from any tool to an output line to
which you have already assigned the Results signal function.
• Data Valid: This signal occurs when the Color CVIM system has
completed an inspection. Data Valid signals (the “data”) are stable on all
output lines assigned to the Results signal function. Data Valid goes low
after the next trigger or the selected Duration time.
Note: Data Valid does not indicate whether an inspection has passed or
failed. That is the task of the output lines assigned to the Results signal
function.
You can assign the Data Valid function to only one output line.
• Trigger NAK: This signal occurs when the Color CVIM system receives
a trigger input signal, but cannot process that trigger. The signal goes low
upon the next “accepted trigger”.
You can assign the Trigger NAK function to only one output line.
• Master Fault: This signal occurs when any (one or more) analysis tools
in the Color CVIM system detects a Fail condition.
You can assign the Master Fault function to only one output line.
3–5
Chapter 3
Using Local I/O
Using the Output Line
Planning Sheet (cont’d)
• Strobe: This signal is used to trigger the strobe flash unit (if used). The
signal occurs within 1 ms after the Color CVIM system receives a trigger
input signal.
You can assign the Strobe function to only one output.
• Duration (n)ms: From 1msec to 2000msec. This value determines the
pulse duration, in milliseconds (and with an accuracy of ±5 milliseconds),
of all pulse–type signals. A setting of zero means the signal will remain in
its present state until updated by a subsequent inspection.
Note: The output duration may vary if subsequent inspections occur before
the specified output duration has elapsed.
In your application, the function and tool assignment(s) for each output line
will of course depend on the specific requirements of your production
equipment.
You will find a full–page, blank copy of the planning sheet on the last page
of this chapter. We suggest that you do not mark that page, but use it instead
as a copy master, and use the copies to prepare your output line plans.
Keep in mind that a completed planning sheet can serve also as a record of
your output line usage. You may find it desirable to store your filled–out
planning sheets in a file folder or loose leaf binder.
3–6
Chapter 3
Using Local I/O
Using Output Signal
Timing Data
To make proper use of the signal data available to the output lines, you must
first understand the timing relationships that exist between the trigger input
signal (which starts each inspection cycle) and the output signals.
Knowing these signal timing relationships enables you to accurately
synchronize the inspection cycles with your production equipment.
Timing charts (Figures 3.2, 3.3, and 3.4) show the timing relationships in
various circumstances.
Figure 3.2 shows the relationship between the trigger leading edge and the
Strobe, Data Valid, and Results signals, where the last three appear as pulses
whose duration you determine during configuration.
Figure 3.2
Timing Diagram — Pulsed I/O
MODULE
BUSY
Min. trigger ≈ 2ms*
Trigger
(Input)
STROBE
DATA
VALID
RESULTS
Trigger
pulse #1
Max. lag ≈ 1ms
*****
*****
Strobe ≈ 2ms
You can select a
pulse width of 1
to 2000ms
DATA VALID will always pulse high
when inspection
processing is complete.
RESULTS signal will
pulse high if an analysis tool range limit
is exceeded.
Trigger
pulse #2
MASTER RANGE
signal will pulse
MASTER
RANGE
* As seen by the Color CVIM when the trigger is directly connected through the JMB
board, and not provided by a host device.
** Minimum acquisition time: 17ms for 256x256 and 512x256 Res; 34 ms for 512x512 res.
*** Analysis time (variable).
*****
high if any tool detects a failure condition.
3–7
Chapter 3
Using Local I/O
Using Output Signal
Timing Data (cont’d)
In Figure 3.3, trigger pulse #2 occurs before the Color CVIM module has
finished the pulsed output duration of the outputs from trigger #1.
Figure 3.3
Timing Diagram — Trigger #2 During Data Valid, Pulsed I/O
MODULE
BUSY
Trigger
(Input)
STROBE
DATA
VALID
RESULTS
Min. trigger ≈ 2ms*
Trigger
pulse #1
Max. lag ≈ 1ms
*****
*****
DATA VALID will always pulse high when
inspection processing is complete
Trigger
pulse #2
Strobe ≈ 2ms
For Trigger #1
You can select
a pulse width
of 1 to 2000 ms
************
Trigger
pulse #3
MASTER
RANGE
* As seen by the Color CVIM when the trigger is directly connected through the JMB
board, and not provided by a host device.
** Minimum acquisition time: 17ms for 256x256 and 512x256 Res; 34 ms for 512x512 res.
*** Analysis time (variable).
****RESULTS will pulse high if an analysis tool range is exceeded.
*****
3–8
Chapter 3
Using Local I/O
Using Output Signal
Timing Data (cont’d)
Whenever these signals go high, they will go low again at the end of the
specified pulse duration (1 to 2000ms).
In Figure 3.4, the Data Valid, and Results signals appear as changes in signallevels. This will occur if, during system configuration, you select a pulse
“duration” of 0 (zero) milliseconds. Data Valid will stay high until the
leading edge of the next valid trigger signal (Trigger Pulse #2). Results stay
in their current state until the leading edge of the next Trigger pulse, then
change depending upon the results.
Figure 3.4
Timing Diagram — Non–Pulsed I/O
MODULE
BUSY
Trigger
(Input)
STROBE
Trigger
pulse #1
Trigger
pulse #2
DATA
VALID
RESULTS
MASTER
RANGE
DATA VALID will go high when inspection proc-
***
***
***
*Minimum acquisition time: 17ms for 256x256 Res.; 34ms for 512x512 Res.
**Analysis time.
essing is complete, and will go low with the
leading edge of the next valid trigger.
RESULTS signal will go
high if an analysis tool
range limit is exceeded.
MASTER RANGE signal
will go high if any tool detects a failure condition.
3–9
Chapter 3
Using Local I/O
Using Output Signal
Timing Data (cont’d)
In Figure 3.5, trigger pulse #2 occurs before the Color CVIM system is
finished processing the inspection cycle started by trigger pulse #1. This
causes the Trigger NAK signal to go high. Trigger NAK will stay high until
leading edge of the next valid trigger pulse (trigger pulse #3).
Figure 3.5
Timing Diagram– Missed Trigger
MODULE
BUSY
See NOTE 1 below
Trigger
(Input)
TRIGGER
NAK
STROBE
DATA
VALID
Trigger
pulse #1
Trigger
pulse #2
TRIGGER NAK goes high because
trigger 2 cannot be processed. (Trigger 1 processing is not yet complete.)
***
NOTE 1: If Trigger 2 occurs within
5ms of Trigger 1, it is assumed to be
trigger “bounce” and is ignored.
See NOTE 2 below
TRIGGER NAK goes low
because trigger 3 can be
processed. (Trigger 1
processing is now complete.)
NOTE 2: In delayed trigger reject (DTR)
mode, the Trigger NAK signal can occur up
to ≈ 15ms after the rising edge of Trigger 2.
Trigger
pulse #3
3–10
Chapter 3
Using Local I/O
Planning Output
Line Connections
Connections to RS–232 Ports
(2801–N27 Interface Box)
P
O
R
T
A
P
O
R
T
B
This section provides diagrams of electrical connections for correctly
connecting your production equipment to the Color CVIM module’s discrete
output and RS–232 lines.
Figure 3.6 shows the cable connectors and their pin numbers on the Catalog
No. 2801–N27 I/O Interface Box.
Tables 3.B through 3.E show the connector pin assignments for the Color
CVIM module connected to Catalog No. 2801–N21, –N27 I/O Interface Box.
ATTENTION:
!
Making discrete I/O connections directly to the front of the
Color CVIM module will result in damage to the equipment
and void your warranty.
Table 3.B
Color CVIM Module I/0 Connector
Pin NumberFunctionPin NumberFunction
1
2Not Used15Not Used
3Output Line #116Output Line #14
4Output Line #217Reserved
5Output Line #318Reserved
6Output Line #419Ground (Power)
7Output Line #520Ground (Power)
8Output Line #621Ground (Chassis)
9Output Line #722Ground (Signal)
10Output Line #823
11Output Line #924
Trigger Input
Line #1
14Output Line #12
TXD (Transmit
Data: RS–232 A)
TXD (Transmit
Data: RS–232B)
12Output Line #1025
13Output Line #1126
RXD (Receive
Data: RS–232 A)
RXD (Receive
Data: RS–232 B)
Table 3.C
I/O Interface Box (Catalog No. 2801–N21):
RS–232 Connector with Series A Color CVIM Module
Pin NumberFunctionPin NumberFunction
1No Connection6No Connection
2
3
4Ground (Chassis)9No Connection
5Ground (Signal)
RXD (Receive
Data: RS–232A)
TXD (Transmit
Data: RS–232A)
7
8
TXD (Transmit
Data: RS–232 B)
RXD (Receive
Data: RS–232 B)
3–13
Chapter 3
Using Local I/O
Color CVIM Module I/O
Interface Box Connections
(cont’d)
Table 3.D
I/O Interface Box (Catalog No. 2801–N27):
RS–232 Port A Connector with Color CVIM Module
Pin NumberFunctionPin NumberFunction
1No Connection6No Connection
2
3
4+ 5V DC*9No Connection
5Ground (Signal)
*Not to be used to power external devices.
Table 3.E
I/O Interface Box (Catalog No. 2801–N27):
RS–232 Port B Connector with Color CVIM Module
Pin NumberFunctionPin NumberFunction
1No Connection6No Connection
2
3
4+ 10V DC*9No Connection
5Ground (Signal)
*Not to be used to power external devices.
RXD (Receive
Data: RS–232A)
TXD (Transmit
Data: RS–232A)
RXD (Receive
Data: RS–232B)
TXD (Transmit
Data: RS–232B)
7+ 5V DC*
8No Connection
7+ 10V DC*
8No Connection
Connections to
2801–JMB Interface
3–14
The 2801–JMB interface board is designed for direct edge connection to the
I/O Interface Box, Catalog Nos. 2801–N21, –N27.
If you intend to use the 2801–JMB board and the I/O Interface Box, you will
need to know the relationship between the discrete I/O line numbers and the
LED numbers, the optic–isolator type, and the terminal block screws
numbers on the 2801–JMB board. These are shown in the figure and table
that follows.
ATTENTION:
!
To power the JMB logic components, you must connect an
external +5VDC power supply to the (+) and (–) terminal
screws shown on the board layout that follows.
Chapter 3
Using Local I/O
Connections to
2801–JMB Interface
(cont’d)
Color CVIM
Module
Overlay
T
R
I
1
G
G
E
2
R
S
1
2
3
Figure 3.8 shows the layout of the 2801–JMB interface board and the
adhesive–backed overlay.
Figure 3.8
Local I/O Board ( Catalog No. 2801–JMB).
Note: A self–adhesive decal is provided with the 2801–JMB Local I/O
board. This decal identifies the I/O lines. Use this chart if the decal is not in
place.
* This input is not used by Color CVIM.
** Not Connected
Chapter 3
Using Local I/O
Connections to
2801–JMB Interface
(cont’d)
LineOutput Line
No.Function
Table 3.G
Color CVIM Output Line Planning Sheet
Output Line Functions and Assignments
GageWindow
No.Rng.No.Rng.No.Rng.No.Rng.LineWin.RedGreenBlue
Reference
Tool
Light Probe
3–17
Chapter
Using the Remote I/O Link
4
Chapter Objectives
Remote I/O Communications
In this chapter we provide:
• Basic description of Remote I/O communications.
• Connection diagrams.
• Description of Color CVIM module setup requirements.
• Three example PLC programs for accessing Color CVIM module data.
• An example 6008–SI program.
As stated earlier, the Remote I/O port is located on the front of the Color
CVIM module and is labeled RIO. This port allows the Color CVIM module
to become a link in an Allen–Bradley Remote I/O network which can be up
to 10,000 feet long. Data on the network can be transmitted at baud rates as
high as 230K.
Maximum
Link Length
(Feet)
10,00057.6K
5,000115.2K
2,500230.4K
Baud Rate
Use twin–axial cable (Catalog No. 1770–CD) to connect the Color CVIM
module to other devices. This cable connects to the Remote I/O port (labeled
RIO) and the next device on the network. Refer to Figures 4.1 through 4.8
for connection diagrams.
4–1
Chapter 4
Using the Remote I/O Link
Remote I/O Communications
(cont’d)
Figure 4.1
PLC–5 to Color CVIM Module– Remote I/O Link
1771 I/O Rack
PLC
5/15
5/25
5/30
5/40
5/60
Catalog No.
1770–CD
Cable
Color
CVIM Module
RIO
Figure 4.2
6008 SI IBM PC/AT Scanner to Color CVIM Module– Remote I/O Link
Color
CVIM Module
6008 SI I/O Scanner
IBM PC/AT
Catalog No.
1770–CD
Cable
Figure 4.3
6008 SV VME Scanner to Color CVIM Module– Remote I/O Link
CVIM Module
6008 SV I/O Scanner
Host
Computer
Catalog No.
1770–CD
Cable
RIO
Color
RIO
4–2
Chapter 4
Using the Remote I/O Link
Remote I/O Communications
(cont’d)
Figure 4.4
6008 SQH1/2 Q–BUS Scanner to Color CVIM Module–Remote I/O Link
Color
CVIM Module
6008 SQH1/2 I/O Scanner
Host
Computer
RIO
Catalog No.
1770–CD
Cable
Figure 4.5
Mini PLC–2 to Color CVIM Module– Remote I/O Link
1771 I/O Rack
MINI PLC–2
2/02
2/15
2/16
2/17
Catalog No. 1771–SN
Sub I/O Scanner Module
Catalog No.
1770–CD
Cable
Color
CVIM Module
RIO
Figure 4.6
PLC–2 to Color CVIM Module– Remote I/O Link
Catalog No. 1772–CS
Cable
Catalog No.
PLC–2/20
–2/30
Catalog No.1771–CJ/CK
Power Cable
1772–SD2
Scanner
Distribution
Module
Catalog No.
1770–CD
Cable
Color
CVIM Module
RIO
4–3
Chapter 4
Using the Remote I/O Link
Remote I/O Communications
(cont’d)
Figure 4.7
PLC–3 to Color CVIM Module–Remote I/O Link
Catalog No. 1775–
S4A/S4BS5/SR/SR5
PLC–3
I/O Scanners
Catalog No.
1770–CD
Cable
Figure 4.8
PLC–5/250 to Color CVIM Module– Remote I/O Link
Pyramid Integrator
Rack
Remote Scanner
PLC–5/250
Color
CVIM Module
RIO
Color
CVIM Module
Catalog No.
1770–CD
Cable
RIO
4–4
Chapter 4
Using the Remote I/O Link
Remote I/O Communications
(cont’d)
2801
Figure 4.9
Typical Hardware Layout for Remote I/O
Color
2705–P11J1 RediPANEL
Note: If the duration of the Data Valid signal is less than 3 PLC
scans, its change of state may not be recognized.
Note: You can also read the data valid signal over the remote I/O link.
4–5
Chapter 4
Using the Remote I/O Link
Remote I/O Communications
(cont’d)
What Functions can be
Performed over the
Remote I/O Network?
When installed on a Remote I/O network, the Color CVIM module acts as a
slave device. Another device such as a PLC or computer will act as a host
device. This means that the Color CVIM module will not initiate the sending
of any data until a request is made by the host. To a host device, the Color
CVIM module will appear simultaneously as both a full I/O rack on the
network (256 input bits and 128 output bits) and as an intelligent module
with block transfer capability in group 0, slot 0 in the same rack. Refer to
Appendix B for a description of discrete bit data.
Note: If the Color CVIM module is the last node on a network, you must
terminate the communication line (refer to Figure 4.9 for an example).
Any Color CVIM communications port can be used by an external device to
read inspection result information. (Refer to Appendices B and C for more
information.) In addition, any device selected as a system (SYS) host can:
Change run–time display menus.
Enable/Disable local I/O board.
Force local I/O On or Off
A host device selected as a configuration host can also:
Upload or download Color CVIM module configurations for inspections.
Refer to Appendix D.
Issue Configuration Read/Write commands between the following Color
CVIM module memory locations:
4–6
Chapter 4
Using the Remote I/O Link
Obtaining Inspection
Result Information
Color CVIM Module
Configuration Instructions
You can obtain inspection result information for each of the inspection tools
over the Remote I/O link. There are two levels of access to this information:
Discrete Bits. These bits indicate pass/fail/warning data. Note that there
are 256 input bits from the Color CVIM to the PLC. That input consists
of two pages of 128 bits each. The first 128 bits refer to the first half of
the toolset, and the second 128 bits refer to the second half of the toolset.
Result Data Words. These words contain actual inspection result data such
as measured lengths, number of black pixels, etc.
Note: Refer to Appendix B for a description of the discrete bit results and
Appendix C for a description of numerical results data blocks.
If you are using the Remote I/O link to communicate with a PLC–2, –3, or
–5 (or PLC–5/250 in another rack), you must configure the Color CVIM
module as follows:
Select the Remote I/O port for communications:
Note: This step is not required if you are only reading results.
1. Select the setup menu <Setup>.
2. Select the environment menu <Envir/Cam>.
3. Select the system menu <System>.
4. Select a Host menu <CFG Host> or <SYS Host>.
5. Select remote I/O option <Remote I/O>.
Note: Unless a separate configuration host is being used, set both the CFG
Host & SYS Host for Remote I/O.
Configure Color CVIM module I/O parameters:
6. Select the I/O menu <I/O>.
7. Select <1771 Remote I/O> option.
8. Enable the Remote I/O port by selecting <Enabled>.
9. Select the rack address (octal) using the keypad.
10.Select the baud rate <57.6Kbaud> or other options.
Select the Color CVIM module trigger source:
11.Select the trigger source menu <Trigger Source>.
12.Select either <I/O>, <Hosted>, or <Internally Triggered> trigger sources.
Note: The example connection diagram shown on Figure 4.9 shows a trigger
using the local I/O board.
4–7
Chapter 4
Using the Remote I/O Link
Accessing Discrete
Bit Information
A PLC can directly access discrete bit information using a simple ladder
program. For example:
You can use the following rung to examine the data valid bit and energize an
output if the data is valid. Refer to Chapter 3 for a description of the local
I/O. This example assumes that the Color CVIM module is in Rack 02 and
the output device is in Rack 01.
Although the same basic information is provided in Appendix B, Tables 4.A
and 4.B illustrate the word and bit locations of the discrete bits that can be
read or manipulated using simple ladder programs. We have organized the
data so that it is formatted similar to a PLC setup screen. Table 4.A shows
the first part of discrete bits results (Color CVIM module to PLC). Table 4.B
shows the second part. You can tell the difference by examining word 0, bit
5, which has a value of 0 for the first part and 1 for the second part. Table
4.C shows the Color CVIM remote outputs (PLC to Color CVIM module).
Important Note: To read results data, you must set one of the following bits
(assuming Color CVIM module is rack 02):
O:22/00 (Post First Part of Results to Remote I/O)
O:22/01 (Post Second Part of Results to Remote I/O)
Note to PLC–2 Users:
When you use any PLC–2 family processor with the Color CVIM module,
you should understand the operation of the PLC Block Transfer Done bits for
Read and Write instructions. PLC–2 family processors use the input image
table for these bits, all other PLCs can specify integer files for this function.
This means that a PLC–2 user must use proper programming techniques to
avoid confusion between the following bits:
Color CVIM module discrete I/O input word 0, bit 6 (data valid) and bit 7
(not used).
PLC–2 family input image table word 0, bit 6 (BTW done bit) and bit 7
(BTR done bit).
Remember that word 27 is a reserved word in the PLC–2 data table, and
should not be used for any other purpose.
4–8
Chapter 4
21
22
23
24
25
26
27
Using the Remote I/O Link
Accessing Discrete
Bit Information (cont’d)
07
–––
17
(Not used)
1 = Master
Fault
1 = Window 4
Fault
1 = Window 8
Fault
1 = Window
12 Fault
1 = Window
16 Fault
1 = Window
20 Fault
1 = Window
24 Fault
06
–––
16
1=Data Valid0=First Bits
1 = Light
Probe Failed
1 = Window 4
Warning
1 = Window 8
Warning
1 = Window
12 Warning
1 = Window
16 Warning
1 = Window
20 Warning
1 = Window
24 Warning
05
–––
15
Results
1 = Reference
Window 3
Failed
1 = Window 3
Fault
1 = Window 7
Fault
1 = Window
11 Fault
1 = Window
15 Fault
1 = Window
19 Fault
1 = Window
23 Fault
Table 4.A
Color CVIM Module Remote I/O Inputs (Color CVIM Module to PLC)
if Color CVIM Module is Rack 02 (First Discrete Bits Results)
04
–––
14
1 = Trigger
Missed
1 = Reference
Window 2
Failed
1 = Window 3
Warning
1 = Window 7
Warning
1 = Window
11 Warning
1 = Window
15 Warning
1 = Window
19 Warning
1 = Window
23 Warning
03
–––
13
1 = Module
Busy
1 = Reference
Window 1
Failed
1 = Window 2
Fault
1 = Window 6
Fault
1 = Window
10 Fault
1 = Warning
14 Fault
1 = Window
18 Fault
1 = Window
22 Fault
02
–––
12
1 = PLC is
Master
1 = Reference
Line 3 Failed
1 = Window 2
Warning
1 = Window 6
Warning
1 = Window
10 Warning
1 = Window
14 Warning
1 = Window
18 Warning
1 = Window
22 Warning
01
–––
11
1 = Config.
Error
1 = Reference
Line 2 Failed
1 = Window 1
Fault
1 = Window 5
Fault
1 = Window 9
Fault
1 = Window
13 Fault
1 = Window
17 Fault
1 = Window
21 Fault
BIT
00
–––
10
(Not Used)
1 = Reference
Line 1 Failed
1 = Window 1
Warning
1 = Window 5
Warning
1 = Window 9
Warning
1 = Window
13 Warning
1 = Window
17 Warning
1 = Window
21 Warning
W
O
R
D
20
1 = Gage 4
Fault
1 = Gage 8
Fault
1 = Gage 12
Fault
1 = Gage 16
Fault
1 = Gage 20
Fault
1 = Gage 24
Fault
1 = Gage 28
Fault
1 = Gage 32
Fault
1 = Gage 4
Warning
1 = Gage 8
Warning
1 = Gage 12
Warning
1 = Gage 16
Warning
1 = Gage 20
Warning
1 = Gage 24
Warning
1 = Gage 28
Warning
1 = Gage 32
Warning
1 = Gage 3
Fault
1 = Gage 7
Fault
1 = Gage 11
Fault
1 = Gage 15
Fault
1 = Gage 19
Fault
1 = Gage 23
Fault
1 = Gage 27
Fault
1 = Gage 31
Fault
1 = Gage 3
Warning
1 = Gage 7
Warning
1 = Gage 11
Warning
1 = Gage 15
Warning
1 = Gage 19
Warning
1 = Gage 23
Warning
1 = Gage 27
Warning
1 = Gage 31
Warning
1 = Gage 2
Fault
1 = Gage 6
Fault
1 = Gage 10
Fault
1 = Gage 14
Fault
1 = Gage 18
Fault
1 = Gage 22
Fault
1 = Gage 26
Fault
1 = Gage 30
Fault
1 = Gage 2
Warning
1 = Gage 6
Warning
1 = Gage 10
Warning
1 = Gage 14
Warning
1 = Gage 18
Warning
1 = Gage 22
Warning
1 = Gage 26
Warning
1 = Gage 30
Warning
1 = Gage 1
Fault
1 = Gage 5
Fault
1 = Gage 9
Fault
1 = Gage 13
Fault
1 = Gage 17
Fault
1 = Gage 21
Fault
1 = Gage 25
Fault
1 = Gage 29
Fault
1 = Gage 1
Warning
1 = Gage 5
Warning
1 = Gage 9
Warning
1 = Gage 13
Warning
1 = Gage 17
Warning
1 = Gage 21
Warning
1 = Gage 25
Warning
1 = Gage 29
Warning
4–9
Chapter 4
21
22
23
24
25
26
27
Using the Remote I/O Link
Accessing Discrete
Bit Information (cont’d)
07
–––
17
(Not used)
1 = Master
Fault
1 = Window
28 Fault
1 = Window
32 Fault
1 = Window
36 Fault
1 = Window
40 Fault
1 = Window
44 Fault
1 = Window
48 Fault
06
–––
16
1=Data Valid1=Second
1 = Light
Probe Failed
1 = Window
28 Warning
1 = Window
32 Warning
1 = Window
36 Warning
1 = Window
40 Warning
1 = Window
44 Warning
1 = Window
48 Warning
05
–––
15
Bits Results
1 = Reference
Window 3
Failed
1 = Window
27 Fault
1 = Window
31 Fault
1 = Window
35 Fault
1 = Window
39 Fault
1 = Window
43 Fault
1 = Window
47 Fault
Table 4.B
Color CVIM Module Remote I/O Inputs (Color CVIM Module to PLC)
if Color CVIM Module is Rack 02 (Second Discrete Bits Results)
*Set these three bits to specify the type of block as follows: 001 = Results, 010 = Configuration, 100 = T emplate, 101 = Statistics,
111 = Programmable Results Block Write
**If both ON & OFF bits are set, the output is forced OFF.
*** Do not write to these bits.
**** The first configuration on the card is 0000. When writing configurations from card to Color CVIM, remember that a card is made up of 32K
slots, and the address is the address number of the slot (a 64K card contains two slots; a 512K card contains 16 slots). A complete image takes
12 slots.
**** *Used for Results and Stats Blocks only. Refer to page 4–17 for additional information.
1 = Force JMB
Output 7 ON**
1 = Force
JMB Output 7
OFF**
1 = Reset
Stats
1 = Force JMB
Output 6 ON**
1 = Force
JMB Output
14 ON**
1 = Force
JMB Output 6
OFF**
1 = Force
JMB Output
14 OFF**
1 = Page
Down
1 = Force JMB
Output 5 ON**
1 = Force
JMB Output
13 ON**
1 = Force
JMB Output 5
OFF**
1 = Force
JMB Output
13 OFF**
1 = Page Up1 = Resume
1 = ForceJMB
Output 4 ON**
1 = Force
JMB Output
12 ON**
1 = Force
JMB Output 4
OFF**
1 = Force
JMB Output
12 OFF**
Control
1 = Force JMB
Output 3 ON**
1 = Force
JMB Output
11 ON**
1 = Force
JMB Output 3
OFF**
1 = Force
JMB Output
11 OFF**
(Not Used) (Not Used) (Not Used)
1=Force JMB
Output 2 ON**
1 = Force
JMB Output
10 ON**
1 = Force
JMB Output 2
OFF**
1 = Force
JMB Output
10 OFF**
1=Force JMB
Output 1 ON**
1 = Force
JMB Output 9
ON**
1 = Force
JMB Output 1
OFF**
1 = Force
JMB Output 9
OFF**
24
26
4–11
Chapter 4
Using the Remote I/O Link
Example Program for
Accessing/Setting
Discrete Bit Data
Program Listing Report PLC–5/15 File CCVIM1 Rung 2:0
Rung 2:0
Specify the half of the toolset you want
| Post first |
| half of |
| the TS |
| O:022 |
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+
| 00 |
Rung 2:1
This rung acquires an image, the Color CVIM one shots the input
| Trigger |
| TS from Trigger |
| outside the Camera |
| B3 O:020 |
+––––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+
| 3 12 |
The following ladder logic program provides examples of:
• Triggering an inspection from a PLC.
• Enabling/Disabling the user access to the setup mode using the lightpen.
• Checking for valid results.
• Reading and displaying pass/fail/warning tool results (Window 1).
Controlling screen display from a PLC.
The program assumes that the Color CVIM module is located in rack 02
(processor address is 074 octal) and the PLC is in rack 00.
4–12
Rung 2:2
The next two rungs control the SETUP bit so that the lightpen can not
get into the Color CVIM.
| Lock the |
| SETUP Disable |
| bit Setup |
| B3 O:020 |
+––––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+
| 1 10 |
Rung 2:9
| |
+––––––––––––––––––––––––––––––––[END OF FILE]–––––––––––––––––––––––––––––––––+
| |
NO MORE FILES
4–14
Chapter 4
Using the Remote I/O Link
Accessing Results and
Configuration Information
A host also has access to actual results block information such as measured
lengths, number of black pixels, etc. Transfer of result and configuration data
is accomplished using block transfers. There are two types of blocks that can
be transferred:
• Results Blocks
• Configuration Blocks
Depending upon the source and destination of the data blocks, the following
transfers can be made:
Reading Results (Color CVIM module to SYS Host)
Results Blocks. There are six inspection results blocks (refer to Appendix
A). Five of these blocks have a preconfigured structure. You can
configure the sixth block so that only the information you require is
transferred.
Transferring Configurations (Color CVIM module to CFG HOST and/or
CFG HOST to Color CVIM module)
Configuration Blocks. There are 213 configuration blocks which contain
the Color CVIM module setup information, tool parameters, operating
environment instructions, camera setups, I/O operation, and operating
modes. Each block transfer is limited to 64 words maximum. You can
request blocks one at a time or in groups. Refer to Appendix A
(Overview) and D (Configuration Data) for a description of the
configuration block data.
Transferring Results Blocks
When transferring blocks of data with the CFG or SYS Hosts, note the
following requirements:
You should assign a length of 0 to all block transfer commands. This
allows the Color CVIM module to specify the length of the block in
words.
All block transfers address the lowest Group and Module Locations (0).
You must set the bits in output word 3 to designate function of Results,
Configuration, or Template transfer.
The SYS or CFG Host must initiate all block transfers.
Results blocks are transferred using block transfer reads. These blocks
contain inspection result information such as: tool results, fault data, etc. Of
the six results blocks, five are pre–configured and one block is user
configurable (refer to next section). This means that you can program the
contents of the block to contain only the specific data you require. Before
transferring a results block you must inform the Color CVIM module of the
Block Transfer Type and Block Number by setting discrete bit information
using simple ladder programming (refer to Table 4.C):
Set bit 0 of output word 3 to indicate RESULTS block transfer.
4–15
Chapter 4
Using the Remote I/O Link
Use bits 10, 11, and 12 of output word 3 to indicate which of the six
blocks to read. Refer to Appendix A and D.
Remember that result block addresses for the Color CVIM start with
Block 01.
ATTENTION: To ensure that your results data is current and
valid, you should use programming logic which synchronizes the
!
transfer of data when inspections occur.
Use the Data Valid bits of input word 0 (bit 6) to detect when new
inspection results are available. These bits are described in Chapter 3
(Local I/O).
Note: Later in this chapter we provide an example PLC program for
retrieving results data.
4–16
Chapter 4
Using the Remote I/O Link
Configuring Results Block 6
and Statistics Block Formats
13.Both the programmable results block and statistic blocks are configured to
contain user specified results. To configure the data in results block #6:
Specify the information you want returned by setting the appropriate bits
in the 10 word “programmable results / statistics block” in the PLC as
shown in Table C.5 (Page C–15). For example, reference window 1 line
gage, window 2, window 3, etc.
If configuring a results block– Set bits 0, 1, and 2 of output word 3. This
will set the Color CVIM module to receive the “program” for results
block 6.
If configuring a statistics block– Set bits 0 and 2 of output word 3. This
will set the Color CVIM module to receive the “program” for the
statistics block.
For the Results Block 6 and Statistics Block transfer writes, set the toolset
active bits as follows:
O:23/04 = 1
05 = 0
06 = 0
07 = 01.
Perform a Block Transfer Write to transfer the 10 word “program“ from
the host to the Color CVIM module.
If reading results block– Read results block 6 and check word 1 for error
bits and words 2 through 63 for valid data.
Note: Refer to Appendix C and verify that your results will not require more
than 62 words, this will ensure that the results will fit in the allocated block.
The results are returned in the ascending order of their appearance in the
programmable block (reference windows before windows, window 1 before
window 2, etc.) It is the responsibility of the programmer to track the order
and location of the data.
ATTENTION: The format information for the programmable
!
results block and statistics blocks are stored in Color CVIM
module RAM. The data does not get saved into the EEPROM
with other configuration information. This means that the data
will be lost when the power is turned off.
To avoid losing data, your program should contain a test for the
Power Up condition. Discovery of this condition should initiate
an automatic download of the configuration for this block.
4–17
Chapter 4
Using the Remote I/O Link
Converting Results Data
Some of the results data described in Appendix C is stored in a “16 point 16”
format while other data is stored as a 32 bit integer. Refer to the following
chart:
WINDOWFORMAT
Luminance16.16*
Object Counting32 bit
Pixel Counting32bit
Color ID32 bit
Color Match32 bit
GAGEFORMAT
Linear Measure16.16
Object32 bit
Pixels32 bit
Edge32 bit
Angular Measure16.16
Light Probe16.16
Reference Line16 bit
Reference Window16 bit
Reference Window Theta16.16
*16.16 means that the first 16 bits indicate the integer and the second 16 bits
the fraction (refer to Appendix A for more information). If you are
transferring results data to a PLC, you may need to convert the “16 point 16”
format to a PLC floating point number. You can convert results data using
the following equation:
PLC Floating Point Number = Integer +
Fraction
65536.0
The following example assumes that you are converting a “16 point 16”
value of 2.75. The value 2.75 is stored as follows:
** This bit is the sign bit in PLC integer files (1 = Negative 0 = Positive)
To help you, we have provided the following sample program. The program
begins on the next page.
4–18
Converting Results Data
(cont’d)
Chapter 4
Using the Remote I/O Link
Rung 2:0
This program converts Color CVIM 16.16 to PLC Floating Point.
The addresses N7:41 and N7:42 are used by gage 1 in results
block 1.
4–19
Chapter 4
Using the Remote I/O Link
Converting Results Data
(cont’d)
Transferring Configuration
Blocks
4–20
You can transfer configuration block data between the Color CVIM module
and CFG Host using block transfer reads and writes. These blocks contain
the operating instructions for the Color CVIM module (refer to Appendix D).
When transferring configuration blocks, note the following:
When the Color CVIM module is receiving configuration blocks from a CFG
Host, the Color CVIM module will leave the active run mode, set the module
busy bit, turn off local I/O, turn off the data valid bit, and ignore any input
triggers (setup menu option is also disabled). After receiving one or more
new configuration blocks (and the last block bit), the Color CVIM module
will validate the entire configuration since many of the operating parameters
are interrelated.
ATTENTION: You must monitor both the input and the output
!
If the Color CVIM module detects an invalid configuration, the new
configuration will be ignored and the Color CVIM module will set the
Configuration Fault bit and operate using the old configuration.
status bits.
Chapter 4
Using the Remote I/O Link
Transferring Configuration
Blocks (cont’d)
Example Program for
Accessing Results Data
You must use the discrete I/O bits in conjunction with block transfers to
inform the Color CVIM module of the Block Transfer Type, Block Number
and, Last Block by setting discrete bit information using simple ladder
programming (refer to Table 4.C):
Set bit 1 of output word 3 to indicate a CONFIGURATION block transfer.
Use bits 10 through 17 of output word 3 to indicate which block to
transfer. Refer to Appendix D for block numbers.
Set bit 3 in output word 3 to tell the Color CVIM to send the last block.
This bit must be set one full scan before sending the last block. If you
forget to set this bit, the Color CVIM module will wait for an indefinite
period of time for more data.
Note: Later in this chapter we provide an example PLC program for
accessing configuration data.
The following program illustrates one way to read Results Blocks from the
Color CVIM. It does the following:
1. Initializes the bits needed to do the Block Transfer of Results Block 1 and
posts the Data Value of the tool on the RIO channel.
2. Triggers the Color CVIM
3. Waits for Data Valid signal for the inspection (Note that the Trigger must
go low before Data Valid can go high).
4. If the Block Transfer enables, resets the enable bit.
5. After the Block Transfer is complete, moves the number of missed
triggers to N7:70.
6. Compares the new value of missed triggers with the old value, and turns
off the output if they are equal.
7. Compares the number of missed triggers with the stored value. If they are
not equal, turns on an output and transfers the output.
Note: We offer the following example only to show you how to use discrete
bits via Remote I/O with a Color CVIM even though using the Data Valid
signal via Remote I/O is not necessarily the preferred method. Due to
real–world timing considerations, you will normally use a hard–wired Data
Valid signal from the 2801–JMB board to your control device.
Note: Be sure to reset the counters on the Color CVIM and set N7:200 to
zero.
The program begins on the next page.
4–21
Chapter 4
Using the Remote I/O Link
Example Program for Accessing
Results Data, Cont’d
Program Listing Report PLC–5/15 File CCVIM2 Rung 2:0
Rung 2:0
Initialize the appropiate bits to read the results block and use Data Valid.
| Specify |
| first half |
| of the |
| toolset |
| O:022 |
+–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+–––(L)––––+–+
| | 00 | |
| |Specify | |
| |results | |
| |block | |
| | O:023 | |
| +–––(L)––––+ |
| | 00 | |
| |Block 1 of| |
| |6 possible| |
| | BLOCKS | |
| | O:023 | |
| +–––(L)––––+ |
| 10 |
Rung 2:1
This rung acquires an image, the Color CVIM one shots the input
| External |
| trigger Trigger |
| bit the Camera |
| B3 O:020 |
+––––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+
| 1 12 |
Rung 2:2
Read results block from the Color CVIM.
| Data Valid Read from |
| for the the Color |
| TS CVIM |
| I:020 B3 +BTR––––––––––––––––––––+ |
+––––] [–––––[ONS]––––––––––––––––––––––––––––––+BLOCK TRNSFR READ +–(EN)–+
| 06 2 |Rack 02| |
| |Group 0+–(DN) |
| |Module 0| |
| |Control Block N7:100+–(ER) |
| |Data file N7:0| |
| |Length 0| |
| |Continuous N| |
| +–––––––––––––––––––––––+ |
Rung 2:3
Clear block transfer read error, if it occurs.
| BTR Error BTR Enable |
| bit bit |
| N7:100 N7:100 |
+––––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––(U)–––––+
| 12 15 |
4–22
Example Program for Accessing
Results Data, Cont’d
Rung 2:4
Set n7:70 to the number of triggers, before giving the system a new trigger.
| See if the |
| number of |
| missed |
| BTR Done triggers |
| bit increased |
| N7:100 +FLL–––––––––––––––+ |
+––––] [––––––––––––––––––––––––––––––––––––––––––––––––––+FILL FILE +–+
| 13 |Source N7:59| |
| |Dest #N7:70| |
| |Length 1| |
| +––––––––––––––––––+ |
Rung 2:5
If the number of missed triggers did not increase turn off the warning light.
| See if the |
| number of |
| missed |
| triggers Pass |
| increased light |
| +EQU–––––––––––––––+ O:000 |
+–+EQUAL +–––––––––––––––––––––––––––––––––––––––––––––––––(U)–––––+
| |Source A N7:70| 10 |
| | 0| |
| |Source B N7:200| |
| | 0| |
| +––––––––––––––––––+ |
Chapter 4
Using the Remote I/O Link
Rung 2:6
If the number of missed triggers are not equal, move the new larger value and
turn on the warning light.
| See if the |
| number of Move the |
| missed new number |
| triggers of missed |
| increased triggers |
| +NEQ–––––––––––––––+ +FLL–––––––––––––––+ |
+–+NOT EQUAL +––––––––––––––––––––––––––––––––––++FILL FILE ++–+
| |Source A N7:70| ||Source N7:70|| |
| | 0| ||Dest #N7:200|| |
| |Source B N7:200| ||Length 1|| |
| | 0| |+––––––––––––––––––+| |
| +––––––––––––––––––+ | Pass | |
| | light | |
| | O:000 | |
| +–––––––––––––(L)––––+ |
| 10 |
Rung 2:7
| |
+––––––––––––––––––––––––––––––––[END OF FILE]–––––––––––––––––––––––––––––––––+
| |
NO MORE FILES
4–23
Chapter 4
Using the Remote I/O Link
Example Program For
Accessing Configuration Data
Rung 2:0
SET O:023/01 TO INDICATE A CONFIGURATION BLOCK. SET APPROPRIATE BTX BITS TO
INDICATE BLOCK 110. THIS COMBINATION OF BITS IDENTIFIES CONFIGURATION BLOCK
110 FOR THE BTR AND BTW USED IN THIS SAMPLE PROGRAM.
MAKE SURE THAT YOUR COLOR CVIM CONFIGURATION HOST IS REMOTE I/O. THE COLOR
CVIM MUST HAVE REMOTE I/O ENABLED, RACK 2 SELECTED AND A BAUD RATE OF 57.6K.
| BTX TYPE |
| O:023 |
+–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+–––( )––––+–+
| | 01 | |
| |BTX 64 BIT| |
| | O:023 | |
| +–––( )––––+ |
| | 16 | |
| |BTX 32 BIT| |
| | O:023 | |
| +–––( )––––+ |
| | 15 | |
| |BTX 8 BIT | |
| | O:023 | |
| +–––( )––––+ |
| | 13 | |
| |BTX 4 BIT | |
| | O:023 | |
| +–––( )––––+ |
| | 12 | |
| |BTX 2 BIT | |
| | O:023 | |
| +–––( )––––+ |
| 11 |
The following program provides an example of using bi–directional block
transfers to:
Transfer Color CVIM module configuration data to a PLC.
Modify the data. In this program we move the location of Window 1 up
or down.
Transfer the reconfigured data back to the Color CVIM module from the
PLC.
4–24
Rung 2:1
| REQUEST TO |
| MOVE WIN 1 MOVE WIN 1 |
| UP UP |
| I:010 B3 B3 |
+––––] [–––––[ONS]–––––––––––––––––––––––––––––––––––––––––––––––––––––(L)–––––+
| 01 11 1 |
Rung 2:2
| REQUEST TO |
| MOVE WIN 1 MOVE WIN 1 |
| DOWN DOWN |
| I:010 B3 B3 |
+––––] [–––––[ONS]–––––––––––––––––––––––––––––––––––––––––––––––––––––(L)–––––+
| 02 12 2 |
Rung 2:7
AFTER READING AND MODIFYING THE CONFIGURATION DATA, SEND THE MODIFIED DATA TO
THE COLOR CVIM. THE MODIFIED DATA WILL HAVE THE NEW WINDOW Y LOCATION. ONCE
THE DATA IS SENT TO THE MODULE, THE NEW POSITION WILL BE DISPLAYED AFTER THE
NEXT TRIGGER.
| BTW WIN 1 |
| |MODULE | CONFIG |
| BTR DONE |BTW ENABLE|BUSY |LAST BLOCK DATA |
| N7:100 N7:110 I:020 O:023 +BTW––––––––––––––––––––+ |
+––––] [––––––––]/[––––––––]/[––––––––] [–––––++BLOCK TRNSFR WRITE +–(EN)+–+
| 13 15 03 03 ||Rack 02| | |
| ||Group 0+–(DN)| |
| ||Module 0| | |
| ||Control Block N7:110+–(ER)| |
| ||Data file N7:0| | |
| ||Length 0| | |
| ||Continuous N| | |
| |+–––––––––––––––––––––––+ | |
| | BTR DONE | |
| | N7:100 | |
| +–––––––––––––––––––––––(U)––––+ |
| 13 |
Rung 2:9
THIS RUNG ALLOWS YOU TO RESET THE PROGRAM IF NECESSARY.
| MOVE WIN 1 |
| UP |
| B3 B3 |
+––] [––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+–––(U)––––+–+
| 3 | 1 | |
| |MOVE WIN 1| |
| |DOWN | |
| | B3 | |
| +–––(U)––––+ |
| | 2 | |
| |LAST BLOCK| |
| | O:023 | |
| +–––(U)––––+ |
| 03 |
4–26
Rung 2:10
| |
+––––––––––––––––––––––––––––––––[END OF FILE]–––––––––––––––––––––––––––––––––+
| |
NO MORE FILES
Chapter 4
Using the Remote I/O Link
Example 6008–SI Program
The following program was written using Microsoft C Version 6.00 with an
Allen–Bradley 6008–SI Series B card. The program will:
Identify the program and display preliminary information about it.
Prompt the user for the 6008–SI card address. This address is determined
by the DIP switch settings on the card.
Prompt the user for the 6008–SI card baud rate multiplier. The multiplier
is 1 for 57.6K Baud, and 2 for 115.2K Baud. (Note that the 6008–SI card
does not support 230.4K Baud.)
Prompt the user for the 6008–SI card interrupt control line. This is
determined by the jumper setting on the board itself.
Initialize the 6006SI card and prompts the user for the Color CVIM
module rack address (0–7). The Color CVIM module address was
configured on the Color CVIM module monitor using the light pen.
Display a five item menu which allows the user to perform the following
functions:
1. Trigger. This initiates an inspection cycle.
2. Read Results. Reads the 128 discrete input bits of first part results.
3. Read Configuration. Uploads the entire Color CVIM module
configuration.
4. Write Configuration. Downloads the entire Color CVIM module
configuration.
5. Quit
4–27
Chapter 4
Using the Remote I/O Link
Example 6008–SI Program
(cont’d)
/* This program was compiled using Microsoft C Version 6.0 */
/* Color CVIM to 6008–SI sample communications program */
/* Copyright Allen–Bradley 1–12–92 jrm, dms */
#include <stdio.h>
#include <stdlib.h>
/* Include the 6008–SI definitions */
#include <h_6008si.h>
#define TRIGGER_1_BIT 0x0400
/* define storage for configuration data */
unsigned config[213][64], configlen[213];
void main()
{
QMR mr_pkt;
unsigned segment; /* segment of 6008–SI card */
int baud, irq_l; /* 6008–SI card baud rate and interrupt line */
unsigned status, err, CVIM_rack, block_num, numblocks, block1;
unsigned block2, last_blk, x, t;
int op_num, block_1;
/* Display Program Execution and Description. */
printf (”\nColor CVIM to 6008–SI sample communication program.\n”);
printf (”Copyright Allen–Bradley 01–12–90 jrm, dms.\n”);
printf (”This program was used and tested on a 33 MHz 386 Computer.\n”);
printf (”The Color CVIM Communication Parameters for this program are:\n”);
printf (” CFG Host: Remote I/O\n”);
printf (” SYS Host: Remote I/O\n”);
printf (” Trigger Source = (Hosted)\n”);
printf (” Remote I/O Enabled\n”);
printf (” Remote I/O Rack Address 2\n”);
printf (” Remote I/O Data Rate 57.6\n”);
printf (” Color CVIM must be in RUNMODE\n”);
/* Prompt – enter address, baud rate, and interrupt line of 6008 card */
printf (”\nColor CVIM to 6008–SI communications sample program\n\n”);
printf (”Enter hex RAM address for 6008–SI card (e.g. D000): ”);
scanf (”%x”, &segment);
printf (”Enter baud rate multiplier for 6008–SI card (e.g. 1=57.6 2=115.2): ”);
scanf (”%d”, &baud);
printf (”Enter interrupt control line for 6008–SI card (e.g. 3 5 10 or 12): ”);
scanf (”%d”, &irq_l);
4–28
/* initialize the 6008–SI */
status = setup_6008(baud, 1, irq_l, segment, &mr_pkt);
if (status != OK)
{
printf (”Setup failed: command=%s, status=%s\n”,
xlat_cmd(status), xlat_conf(mr_pkt.qmr_stat));
Chapter 4
Using the Remote I/O Link
if (status != C_AUTOCONF && status != C_SETUP)
printf (”Scanner fatal error %d\n”, fatal_6008());
abort();
}
/* Place scanner in RUN mode */
mr_pkt.qmr_data[0] = CM_RUN;
status = mr_wait (C_SETMODE, &mr_pkt);
if (status != OK)
{
printf (”Setup failed: command=%s, status=%s\n”,
xlat_cmd(status), xlat_conf(mr_pkt.qmr_stat));
if (status != C_AUTOCONF && status != C_SETUP)
printf (”Scanner fatal error %d\n”, fatal_6008());
abort();
}
/* Disable host watchdog. For sample program ONLY ––
not recommended for any application programs. */
host_active(–1);
/* Get CVIM rack address from the user */
printf (”Enter CVIM remote–I/O rack number (0–7): ”);
scanf (”%d”, &CVIM_rack);
g_oit[8*CVIM_rack + 2] |= 0x0001; /* post tool results */
/* Start of main loop */
do {
printf (”\n\nOperations: \n\n”);
printf (”1. Trigger Tool Set\n”);
printf (”2. Read Results, Part 1\n”);
printf (”3. Read Configuration\n”);
printf (”4. Write Configuration\n”);
printf (”\nEnter operation number (1–4) or –1 to quit: ”);
scanf(”%d”, &op_num ); /* Convert user string input to a number */
err = 0;
switch (op_num)
{
case 1: /* trigger tool set by toggling trigger bit */
{
g_oit[8*CVIM_rack] |= TRIGGER_1_BIT;
for (t=0; t<25000; t++);
g_oit[8*CVIM_rack] &= ~TRIGGER_1_BIT;
err = g_op_stat & SO_FAULT;
} break;
case 2: /* read discrete results part 1 */
{
/* display all 8 input words in hex */
for (x=0; x<8; x++)
printf (”%04X ”, g_ipt[8*CVIM_rack + x]);
printf (”\n”);
/* wait until CVIM busy bit is low */
for (t=65535; t>0 && (g_ipt[8*CVIM_rack] & 8); t––)
for (x=1; x<100; x++);
if (t==0)
{
printf (”Time–out error: CVIM busy\n”);
err = –1;
}
if (g_ipt[8*CVIM_rack] & 2)
printf (”Configuration ERROR.\n”);
else
printf (”Configuration validation OK.\n”);
} break;
} /* end switch (op_num) statement */
if (err)
printf (”Error code: %4x\n”,err);
} while (op_num >= 0);
stop_6008(); /* shut down 6008 before quitting */
}
4–30
/* do a BTR (read) from the CVIM */
int get_CVIM_block (CVIM_rack, block_type, block_num, data, length)
unsigned CVIM_rack, block_type, block_num, *data, *length;
{
static QBT block_pkt;
unsigned err, status,x;
/* display msg for program monitoring */
printf (”get_CVIM_block %d(%d)\n”,block_type, block_num);
Chapter 4
Using the Remote I/O Link
/* Tell CVIM block number and type */
g_oit[8*CVIM_rack + 3] = block_type + block_num * 256;
/* Initiate the block transfer read */
block_pkt.qbt_len = 0; /* request 0 words */
status = bt_read(16*CVIM_rack,&block_pkt);
err = (status != OK);
if (!err)
{
/* wait for completion of BTR */
while (!bt_done(&block_pkt));
err = (block_pkt.qbt_stat != SC_OK);
if (!err)
{
/* store the block data and length */
*length = block_pkt.qbt_len;
memcpy (data, block_pkt.qbt_data, *length * 2);
}
}
return (err);
}
/* performs a BTW (write) to the CVIM */
int send_CVIM_block (CVIM_rack, block_type, block_num, data, length)
unsigned CVIM_rack, block_type, block_num, *data, *length;
{
static QBT block_pkt;
unsigned err, status,x;
/* display msg for program monitoring */
printf (”send_CVIM_block %d(%d)\n”,block_type, block_num);
/* Tell CVIM block number and type */
g_oit[8*CVIM_rack + 3] = block_type + block_num * 256;
/* Initiate the block transfer write */
block_pkt.qbt_len = *length;
memcpy (block_pkt.qbt_data, data, *length * 2);
status = bt_write(16*CVIM_rack,&block_pkt);
err = (status != OK);
if (!err)
{
/* wait for completion of BTW */
while (!bt_done(&block_pkt));
err = (block_pkt.qbt_stat != SC_OK);
}
return (err);
}
4–31
Chapter
Using the RS–232 Ports
5
Chapter Objectives
RS–232 Communications
In this chapter we describe how to:
• Connect RS–232 device(s) to the Color CVIM module.
• Obtain results data using ASCII or DF1 protocols.
• Upload and download configurations.
In addition, this chapter provides example programs.
Using the RS–232 interface you can link a variety of devices to the Color
CVIM module:
• Computers
• Operator Interfaces such as Allen–Bradley Industrial Computers and
Terminals with serial ports.
• I/O modules such as the Flexible Interface Module (Catalog No.
2760–RB) or ASCII module (Catalog No. 1771–DA).
All commands are simple ASCII and/or Hexadecimal strings. Refer to
Appendix E for an ASCII conversion chart. These commands can be
generated using a variety of programming languages (C, Fortran, BASIC).
This chapter provides a sample ASCII program (written in BASIC) and a
sample DF1 program (written in C).
5–1
Chapter 5
Using the RS–232 Ports
ASCII and DF1 Protocols
There are two protocol options when you select an RS–232 communications
port (A or B):
• ASCII
• DF1
This chapter describes both of these options. First we describe the ASCII
protocol (page 5–6) and then the DF1 protocol (page 5–33).
5–2
Chapter 5
Using the RS–232 Ports
Equipment Connections
As shown in Figure 5.1, the RS–232 ports (A & B) are located on the I/O
Interface Boxes (Catalog No. 2801–N21, –N27). The I/O Interface Box is
connected to the MODULE I/O port on the front of the Color CVIM module.
You will need a communications cable to link your host device to the Color
CVIM module. Refer to Figure 5.2 for diagrams of host to I/O Interface Box
cabling.
Figure 5.1
RS–232 Equipment Connections.
COLOR
2801
A
2801
5–3
Chapter 5
Using the RS–232 Ports
Equipment Connections
(cont’d)
DB25 Female (IBM PC/XT, VT–220, etc.)
View from the back of the connector
DB9 Female (IBM PC/A T)
View from the back
Note: Connections for Catalog No. 2801–N27 I/O Interface Box RS–232 Port A with Color CVIM Series A
Module is shown in this illustration. Refer to Chapter 3 (Tables 3.B, 3.C, 3.D, and 3.E) for other RS–232
Connections.
Figure 5.2
RS–232 Cabling.
DB9 Male (I/O Intervace Box)
View from the back
DB9 Male (I/O Interface Box)
View from the back
What Functions can be
performed over the RS–232
Interfaces?
5–4
Any Color CVIM communications port can be used to read inspection result
information. (Refer to Appendices B and C for more information.) In
addition, any device selected as a system (SYS) host can:
• Change run–time display menus.
• Enable/Disable local I/O board.
• Force local I/O On or Off
A host device selected as a configuration host can also:
• Upload or download Color CVIM module configurations for inspections.
Refer to Appendix D.
• Issue Configuration Read/Write commands between the following Color
CVIM module memory locations:
Color CVIM module Random Access Memory (RAM) and Color CVIM
module Electrically Erasable Programmable Read Only Memory
(EEPROM). RAM is volatile and EEPROM is non–volatile.
Chapter 5
Using the RS–232 Ports
Color CVIM module RAM and RAM card. The RAM card slides into a
slot on front of the Color CVIM module. Color CVIM module RAM and
host memory.
Color CVIM Module
Configuration Instructions
If you are using the RS–232 ports (A or B), you must configure the Color
CVIM module as follows:
Set the Baud Rate(s)
1 Select the setup menu <Setup>.
2 Select the environment menu <Envir/Cam>.
3 Select the I/O menu <I/O>.
4 Select RS–232 communications <RS–232 A> or <RS–232 B).
5 Select protocol <DF1> or <ASCII>.
6 Select the Baud rate which matches your host device; from 300 to 19.2K
Baud.
When you select RS–232 communications, the data format is fixed as follows:
Note:
• 8 Data Bits
• 1 Stop Bit
• No Parity
Select the CFG and SYS Hosts
Note: The following steps are not necessary if you are just reading results
data.
1 Select the setup menu <Setup>.
2 Select the environment menu <Envir/Cam>
3 Select the system menu <System>
4 Select a host menu <CFG Host> or <SYS Host>.
5 Select RS–232 port for host communications <RS–232A> or
<RS–232B>.
Select the Protocol
6 Select the I/O menu <I/O>.
7 Select RS–232 communications <RS–232 A> or <RS–232 B>.
8 Select either <ASCII> or <DF1>.
9 Select Baud Rate <300>, <1200>, <2400>, <4800>, <9600>, or
<19,200>.
Select the Color CVIM module Trigger Source
5–5
Chapter 5
Using the RS–232 Ports
10 Select the trigger source menu <Trigger Source>.
11 Select either <I/O>, <Hosted>, or <Auto Trigger> trigger source. Select
hosted trigger if you are using the RS–232 trigger commands. Use I/O
trigger if you are using the discrete I/O inputs as a trigger.
Note: The next section of this chapter describes ASCII protocol followed by
a description of DF1 protocol.
ASCII Protocol
Overview
In describing the ASCII Protocol we use the following conventions:
• Non–printable ASCII control characters are represented as follows:
[CR] = Carriage Return
[LF] = Line Feed
___ = Space
• ASCII commands are provided in large bold characters:
>RR, RB,3 [CR]
Unless _ is specified, there are no spaces between characters. Some
commands have fields which can contain variable data such as number of
times a command is repeated, block numbers, data, etc. These fields are
shown using lowercase lettering:
>W,CBn,d [CR]
In this example, the letters n and d indicate data which is variable. The
other characters indicate fixed data.
After you have made the equipment connections and configured the Color
CVIM module for RS–232 communications, all ASCII strings generated by
the host will be interpreted as commands. The Color CVIM module will then
validate the command structure. If the command has an acceptable structure
the Color CVIM module will reply: [CR][LF]. Refer to Appendix E for an
ASCII conversion chart. If the command has an incorrect structure the Color
CVIM module will respond: ? [CR] [LF]. The Color CVIM module will
process all validated commands and discard any invalid commands. Data
may or may not be returned with a command depending upon the type of
command that was sent.
5–6
Note: A simple way to test the RS–232 links is to send the Color CVIM
module a [CR]. If you have the port properly connected and the Color CVIM
module configured for RS232, the Color CVIM module should send a ?
[CR][LF] in response. If no response is provided, check your connections
and Color CVIM module configuration.
Chapter 5
Using the RS–232 Ports
Note: Some commands cause a continuous flow of returned data. To stop the
flow of data you should send another command (valid or invalid). We
recommend using a [CR] to stop the transmission of data.
ASCII Character Set
Command Structure
The Color CVIM module recognizes the following ASCII characters; all
other characters are ignored.
• Upper and lowercase letters A through Z (case is insignificant).
Each command the host device sends to the Color CVIM module consists of
an ASCII string of characters beginning with > and terminated with a [CR].
Characters in between are separated into fields by commas. The following
shows the structure of a typical command:
HeaderField 1Field 2Field 3Trailer
> OPERATION (X times), (OBJECT), (DATA) CR
( ) Indicates Optional Information
Note: The x times modifier is only used with certain commands to indicate
the number of times the command is to be performed. The range for this
value is between 0 and 255. A value of 0 indicates infinity. If you do not
specify a value, a default of 1 is provided.
5–7
Chapter 5
Using the RS–232 Ports
Command Structure (cont’d)
There are three types of fields:
• Operation Field– This field contains commands directed to the Color
CVIM module. There can only be one operation per command line. Some
operations don’t require any additional fields while others may require an
object field, data field, or both. Note that some commands cannot be used
while the Color CVIM module is in SETUP mode. If an operation cannot
be performed because either the wrong host port has been selected or the
Color CVIM module is in the SETUP mode, the Color CVIM module will
respond to each command with ?[CR][LF].
• Object Field– Object fields specify data that configures the operation of
the Color CVIM module.
The object field contains alphanumeric characters which specify one or
more objects. Individual objects are specified by name. Multiple objects
(of the same type) are specified with an “*” for all objects of this type or
by using a “–” to indicate a range of objects.
In the description of each command we specify the objects that can be
entered into a command.
• Data Field– Contains data.
XON/OFF Flow Control
Deactivate Forces
XON/XOFF characters control the flow of data between the Color CVIM
module and the host. The XON character is transmitted by the receiving
device to indicate that data can be transmitted. The XOFF character is
transmitted when the receiving device cannot accept any more data (data
buffers are filled). When the receiving device can accept more data, it sends
another XON character. The following characters are used: XON =^Q
(CTRL Q) XOFF =^S (CTRL S).
Use the deactivate force command to return outputs on the 2801–JMB local
I/O board to the Color CVIM module assigned functions. The deactivate
forces command is:
>DF [CR]
After executing the command, the Color CVIM module will return:
[CR][LF]. No data is returned If you do not have the proper command
structure, the Color CVIM module will return: ?(CR][LF].
5–8
Chapter 5
Using the RS–232 Ports
Echoing Data
Use the echo command to check the communications link. This command
will return the same same string of characters that are sent out with the
command. This command has the following structure:
>Ex,d [CR]
Where x specifies the number of times the Color CVIM module will echo the
data field back to the host device. If you fail to specify an
value of 1 is assumed.
valid at any time.
For example:
d is the data that is to be echoed. The command is
x value, a default
>E2,HELLO [CR]
This example will cause the Color CVIM module to return the string:
[CR] [LF]
HELLO [CR] [LF]
HELLO [CR] [LF]
If you do not have the proper command structure the Color CVIM module
will return:
?[CR] [LF]
Enable/Disable Outputs
Use this command to enable or disable outputs on the Local I/O Board
(Catalog No. 2801–JMB). Use the following commands:
> EO [CR]This command enables the outputs.
> DO [CR]This command disables the outputs.
After executing the command, the Color CVIM module will return: [CR]
[LF]. No data is returned. If you do not have the proper command structure,
the Color CVIM module will return: ?[CR][LF].
5–9
Chapter 5
Using the RS–232 Ports
Forcing Local I/O
Use the force command to turn the local I/O outputs either on or off. This
function can only be executed once per command. Use one of the following
commands:
> F,On,1 [CR]Forces output(s) on.
> F,On,0 [CR]Forces output(s) off.
Where n is the output being forced on or off, outputs 1 through 14.
n = 1 to 14(individual outputs, can be nonconsecutive)
X – Y(range of outputs X through Y)
*(all of the outputs)
For example:
> F,O*,1 [CR]This example will force all outputs on.
Another example:
> F,O3–9,0 [CR]This example forces outputs 3 through 9 off.
For example:
> F,O4–6,1 [CR]Forces outputs 4–6 on.
> F,O8,1 [CR]Forces output 8 on.
>F,O1–4,0 [CR]Forces ouputs 1–4 off.
Notice that output #4 was forced on and then forced off. The force off takes
precedence over the force on.
After executing a command, the Color CVIM module will return: [CR][LF].
If you do not have the proper command structure the Color CVIM module
will return: ?[CR][LF]. The outputs will remain in their forced states until a
Deactivate Forces command is sent.
5–10
Chapter 5
Using the RS–232 Ports
Loading Configurations
Use the load command to transfer configuration data to the Color CVIM
module’s RAM. Use one of the following commands:
> LO [CR]Transfers configuration from the
EEPROM to the Color CVIM module
internal RAM.
> LO,CC,1 [CR]Transfers memory from the RAM Card
area 1 memory to the Color CVIM module
internal RAM.
> LO,CC,2 [CR]Transfers memory from the RAM Card
area 2 memory to the Color CVIM module
internal RAM.
This function can only be executed once per command. You cannot use this
command when the Color CVIM module is in the SETUP mode.
After executing a command, the Color CVIM module will return: [CR][LF].
No data is returned by the command. If you do not have the proper command
structure or the Color CVIM module is in the SETUP mode, the Color CVIM
module will return: ?[CR][LF].
5–11
Chapter 5
Using the RS–232 Ports
Figure 5.3
Memory Requirements for Images and Configurations
Note: Memory cards are laid out in slots. A 64K card (2801–MD4) has
room for two configurations. The 512K memory card (2801–MD5) has 16
slots, and can store up to 16 configurations. An image must be one of the
first two items stored to the 512K card, and will occupy 12 contiguous free
slots.
Use the lock command to disable the setup menu box so that the SETUP
mode cannot be entered using the light pen. This function can only be
executed once per command. There is no object associated with this
command. The command has the following structure:
Config 3
Config 4
>L[CR]
After executing a command, the Color CVIM module will return: [CR][LF].
No data is returned by the command. If you do not have the proper command
structure the Color CVIM module will return: ?[CR][LF]. Use the unlock
command to enable the setup menu box.
5–12
Chapter 5
Using the RS–232 Ports
Unlock Command
Read Output Status
Use the unlock command to enable the setup menu box so that a user can
access the SETUP mode using the light pen. Use the following command:
>U[CR]
This function can only be executed once per command. There is no object
associated with this command. After executing a command, the Color CVIM
module will return: [CR][LF]. No data is returned. If you do not have the
proper command structure, the Color CVIM module will return: ?[CR][LF].
Use the read data command to read the status of the local I/O. This command
has the following structure:
>Rx,On [CR]
Where n = 1 to 14(individual outputs)
X-Y(range of outputs X through Y)
*(all of the outputs)
This function can be executed more than once per command by specifying an
x times value.
For example:
> R,O14 [CR]This example reads the status of output
#14 once.
Another example:
> R0,O*[CR]This example continuously reads the
status of all fourteen outputs.
After executing a command, the Color CVIM module will return: [CR][LF]
followed by the data. If you do not have the proper command structure, the
Color CVIM module will return: ?[CR][LF]. The format of the requested
data is an ASCII representation of the output state (1 = ON and 0 = OFF).
Each character is followed by a space. The output conditions are transmitted
in numerical order ( output #1 then #2, etc.). The number of characters
returned depends upon the number of outputs that are read. Since there are
fourteen outputs, up to 28 data characters can be returned. After the data is
sent, the Color CVIM module will terminate the data with: [CR][LF]. The
following is an example of returned data from three outputs.
[CR][LF]1 0 0 [CR][LF]
5–13
Chapter 5
Using the RS–232 Ports
Read Configuration Blocks
Use the read configuration command to read configuration data for the
specified blocks (Upload Configurations). The command has the following
structure:
>RC,CBn [CR]
Where n = 1 to 213(individual blocks)
X – Y(range of blocks X through Y)
*(all of the blocks)
This function can only be executed once per command.
Refer to Appendix C for a description of the configuration blocks. You
cannot use this command while the Color CVIM module is in the SETUP
mode.
After executing a command, the Color CVIM module will return: [CR][LF]
followed by the data. If you do not have the proper command structure, the
Color CVIM module will return: ?[CR][LF]. The format of the requested
data is in an ASCII representation of the specified block(s) in bytes. Each
byte is represented by two hexadecimal characters (00 through FF) followed
by a space. The first two words are the signature word indicating block type
and number (refer to appendix D). Twenty bytes of data are transmitted in a
line terminated with a [CR][LF]. The size of the configuration block(s)
determines the number of lines that are returned.
5–14
Chapter 5
Using the RS–232 Ports
Read Configuration Blocks
(cont’d)
Refer to Appendix D for block descriptions and sizes. The following is an
example of how the returned data appears for command >RC,CB1–2 [CR]:
Figure 5.4
Configuration Block Returned Data Format*
*The example above is valid as shown for DF1 Return Data mode. In ASCII mode there are
no spaces.
5–15
Chapter 5
Using the RS–232 Ports
Read Inspection Results
Use this command to read the results of the last inspection. Refer to
Appendix B for a description of the results blocks. Use the following
commands:
>RRx,o,d [CR]
Where:x= Number of times command is
repeated.
o=RL (specifies Reference Line)
RW (specifies Reference Window)
G (specifies Gage)
W (specifies Window)
LP (specifies Light Probe)
d=Gage, Window, Reference Line, or
Reference Window number.
>RR [CR]Reads all discrete bit results.
>RRx,P1 [CR]Reads discrete bit first part results.
x = Number of times command is repeated.
>RRx,P2 [CR]Reads discrete bit second part results.
x = Number of times command is repeated.
>RRx,RB,d [CR]Reads results block(s).
x = Number of times command is repeated.
d = Block number.
5–16
>RRx, S [CR]Reads Color CVIM module status.
Chapter 5
Using the RS–232 Ports
Read Inspection Results
(cont’d)
The read operation can be executed more than once per command by
specifying an x times value. The data in the read results block commands
indicate which results block (1, 2, 3, 4, 5, or 6) is being read (refer to
Appendix C).
>RR0,P1 [CR]This command continuously reads
the first discrete bit results.
(24 bytes returned)
>RR,RB, 3[CR]This command reads results block 3.
This operation is only performed
once in this example.
(128 bytes returned)
>RRx,RL,1[CR]Reads the results of reference line #1.
(4 bytes returned)
>RRx,RW,3[CR]Reads the results of reference window #3.
(28 bytes returned)
>RRx,G,21[CR]Reads the results of gage #21.
(4 bytes returned)
>RRx,W,11[CR]Reads the results of window
#11. (4 bytes returned)
>RRx,LP[CR]Reads the results of light
probe. (12 bytes returned)
>RRx,S[CR]Reads the Color CVIM module status.
(2 bytes returned)
Note: Refer to Appendix B, Table B.1, RS–232 word 0 for a definition of
Color CVIM module status.
After executing a command, the Color CVIM module will return: [CR][LF]
followed by the data. If you do not have the proper command structure, the
Color CVIM module will return: ?[CR][LF]. After reading the results, the
Color CVIM module will return the requested data. The format of the
requested data is in an ASCII representation of the specified block(s) in
bytes.
• If you requested results blocks, each byte is represented by two
hexadecimal characters (00 through FF) followed by a space. Twenty
bytes of data are transmitted in a line terminated with a [CR][LF]. Since
the results blocks are 128 bytes in size, each block requires seven lines.
Refer to Appendix C for block descriptions. The following is an example
of the returned data format:
Figure 5.5
Numerical Results Block Returned Data Format
• If you requested discrete bit information, the returned data will contain
two counters and the discrete bit results. Each counter has 12 positions
(10 characters, 2 spaces) reserved for a maximum value of 4,294,967,295.
Note: Counters are decimal values. All other fields are hexadecimal values.
The counter data is left justified and the remaining field is filled with
spaces. The first counter contains the total number of triggers processed.
The second counter contains the total number of faults. Both counters are
expressed as decimal values. The results bit information (128 bits per
comment, or 256 bits total), which follows the counters, is 16 bytes long.
Each byte is represented by two hexadecimal characters (00 through FF)
followed by a space. The following is an example of the returned data
format:
Figure 5.3
Discrete Bit Results Returned Data Format
Refer to Appendix B for a description of the returned bytes.
5–18
Chapter 5
Using the RS–232 Ports
Save Configuration
Use the Save command to transfer Color CVIM module configuration data to
the local storage area (EEPROM) or the external RAM card (credit card
memory).
Note: Depending upon the card size, up to 16 configurations can be saved to
the RAM card (512K card).
Use one of the following commands:
>S[CR]Transfers configuration data from the
Color CVIM module RAM to the EEPROM.
>S,CC,X [CR]Transfers configuration data from the
Color CVIM module RAM to the RAM card
area X (01 –16).
For example:
>S,CC,15 [CR]Transfers configuration data from the
Color CVIM module RAM to the RAM card
area 15.
You cannot use this command when the Color CVIM module is in the
SETUP mode.
After executing a command, the Color CVIM module will return: [CR][LF].
No data is returned. If you do not have the proper command structure, the
Color CVIM module will return: ?[CR][LF].
5–19
Chapter 5
Using the RS–232 Ports
Figure 5.6
Memory Requirements for Images and Configurations
Note: Memory cards are laid out in slots. A 64K card (2801–MD4) has
room for two configurations. The 512K memory card (2801–MD5) has 16
slots, and can store up to 16 configurations. An image must be one of the
first two items stored to the 512K card, and will occupy 12 contiguous free
slots.
Config 3
Config 4
5–20
Chapter 5
Using the RS–232 Ports
Select Image Displayed
Use the display object commands to select the information that is displayed
on the monitor:
>W,D,d [CR]
Where d is the data that specifies the display to be viewed:
d = 1 (Image only displayed)
or 2 (Failed tools displayed)
or 3 (All tools displayed)
or 4 (I/O page displayed)
or 5 (Results page displayed)
or 6 (Stats 1 page displayed)
or 7 (Stats 2 page displayed)
or 8 (Page up same display)
or 9 (Page down same display)
>W,F,d [CR]
d = 1 (Go on reject)
or 2 (Freeze on 1st r eject)
or 3 (Freeze on all rejects)
or 4 (Freeze on next inspection)
or 5 (Halt on reject)
>w,DC,d [CR]
d = 1 (Resume)
or 2 (Reset stats)
or 3 (Reset counters)
or 8 (Page up)
or 9 (Page down)
Example:
>W,D,2[CR]This example will display failed tools.
After executing the command, the Color CVIM module will return:
[CR][LF]. No data is returned. If you do not have the proper command
structure, the Color CVIM module will return: ?[CR][LF].
5–21
Chapter 5
Using the RS–232 Ports
Set Configurable Results
Use this command to obtain a configurable results block. The results you
want are specified by a list of tools and placed in results block #6. No data is
returned until you use a read inspection results command for block #6. Use
the following command:
>SR,d,d, etc. [CR]
Where d =G1, G2, G3, G1–G3, etc. (specifies Gages)
The returned results block will be 128 bytes including the block signature (2
bytes) and trigger counter (last 4 bytes). Refer to page C–14, the ordering of
the tools and data lengths are the same as the Remote I/O configurable
results block.
Example:
>SR,G1,W2–5[CR]This command places the
results for gage 1 and
Windows 2 through 5 in results block #6.
>RR,RB,6 [CR]This command reads results block #6.
After executing the command, the Color CVIM module will return: [CR]
[LF]. If you do not have the proper command structure, the Color CVIM
module will return: ?[CR][LF]. Refer to Read Inspection Results command
for a description of the returned data format.
5–22
Chapter 5
Using the RS–232 Ports
Set/Read Configurable
Statistics
Use the read command to read statistical data for the light probe, reference
windows, gages, and windows. Use the separate set command to set the
number of samples and configure the statistics block. This command must
be sent by the system host (SYS).
The set statistics command has the following structure:
>SSn,d,d,etc.[CR](Set command)
Where n = Number of samples
Note: If n is 0, the Color CVIM module will continue to use the sample
count configured during setup. Any other value will change the sample count
(if this port is the SYS host).
Where d = G1, G2, G3, G1–G3, etc. (specifies Gages)
The read statistics command has the following structure:
> RSn [CR] (Read Statistics Command)
Where n = Number of times statistics block is read.
Statistics are accumulated until the number of samples is reached, at which
point the statistics begin to reaccumulate. The statistics are accumulated
based upon the number of triggers.
Examples of Set Statistics Command:
>SS50,LP,RW2[CR]This example sets the
number of samples to 50,
configures the block to
contain light probe and
reference window #2
statistics.
>SS100,G5,W12[CR]This example sets the
number of samples to
100, configures the block
to contain gage #5 and
window #12 statistics.
5–23
Chapter 5
Using the RS–232 Ports
Set/Read Configurable
Statistics (cont’d)
Example of Read Statistics Command:
> RS5 [CR]This example reads the statistics block five
times.
The data returned from the statistics block consists of:
• Block signature
• Number of samples, maximum, minimum, average, and standard
deviation for each tool configured in the block.
The block signature is 2 bytes long. The number of samples is a 2 byte
integer. The maximum and minimum values are each 4 bytes. The format of
the data depends upon the operation (e.g. pixel count is an integer and linear
gaging is a 16.16 fixed point value). Refer to page C–24 for data formats.
Standard deviations are also 4 bytes each but are always 16.16 fixed point
values. Averages are 24.8 fixed point values. Therefore, each tool statistic
consists of 18 bytes with the exception of reference windows and the light
probe, which contain 18 bytes for each feature or a total of 54 bytes. The
statistics block is transmitted as two hexadecimal characters for each byte.
The total number of bytes including the block signature should not exceed
128 bytes. The statistics block is read once for every number of specified
samples. This means that if you read the statistics block five times with a
sample number of 50, 250 triggers will have to be processed before the five
reads are completed. The following shows the format of the returned data:
5–24
Figure 5.7
Statistics Block Returned Data Format
Chapter 5
Using the RS–232 Ports
Trigger Operation
Write Configuration (W)
Write Configuration (WC)
Use the trigger operation command to initiate an inspection by the color
CVIM module. Use the following commands:
>T, [CR]Triggers an inspection.
This function can only be executed once per command.
Note: When using this command you should make sure that the module is
configured for a “hosted trigger source”.
After executing a command, the Color CVIM module will return: [CR][LF].
No data is returned. If you do not have the proper command structure, the
Color CVIM module will return: ?[CR][LF].
Use the write command to write data to configuration memory (download
configuration). Use the following commands:
>W,CBn[CR] d
or
>WC,CBn[CR] d
Where n = 1 to 213(individual blocks)
X – Y(range of blocks X through Y)
1–213(all of the blocks)
d = the data that is being written. The format of the data is in an ASCII
representation of the specified block(s) in bytes. Each byte is represented by
two hexadecimal characters (00 through FF) followed by a space.
Note: The WC write command functions like the W write command but
allows listing of configuration blocks.
This function can only be executed once per command.
Refer to Appendix D for a description of the configuration blocks. You
cannot use this command when the Color CVIM module is in the setup
mode. When the Color CVIM module is receiving configuration blocks from
a Host, the Color CVIM module will leave the active run mode and ignore
any input triggers (setup menu option is also disabled). After receiving one
or more new configuration blocks, the Color CVIM module will validate the
entire configuration since many of the operating parameters are interrelated.
Example:
>W,CB1 [CR] 00__F1__etcThis example writes the
data 00, F1, etc into
configuration block #1.
“_” = space character.
Example:
>WC,CB1,CB30–35,CB21[CR](data)*This example
writes the data
into the specified
blocks.
*All blocks and lines of data are separated by a [CR], and a response of [CR][LF] is sent for
every command and data block.
After executing the command, the Color CVIM module will return:
[CR][LF]. No data is returned. If you do not have the proper command
structure, the Color CVIM module will return: ?[CR][LF].
Note: We recommend that you first read Module Busy low, then send the
configuration. When you’re finished downloading the configuration, check
to make sure the “Configuration Fault” bit has not been set. Refer to
Appendix B. You can check this bit by using the read inspection results
command (>RR,S [CR]). No other ports should be active.
5–26
Chapter 5
Using the RS–232 Ports
Command Summary
After you have become familiar with the ASCII commands, you can use the
following command summary as a quick reference guide.
Table 5.A
ASCII Command Summary
CommandCommand StructureField Descriptions
Deactivate Forces>DF [CR]
Disable Outputs>DO [CR]
Enable Outputs> EO [CR]
Echo Data>E, data [CR]Data = ASCII string
Force Outputs>F, On, d [CR]
Load Configuration From
EEPROM to RAM
Load Configuration From RAM
Card to RAM
Lock>L [CR]
Unlock>U [CR]
Read Output Condition>R, On [CR]n =1 to 14
Read Configurable Statistics>RSn [CR]n =number of times read
Read Configuration>RC, CBn [CR]n =1 to 213
Read All Discrete Bit Results>RR [CR]
Read Discrete Bit Results>RR, Pn [CR]n =1 or 2
>LO [CR]
>LO, CC, d[CR]d =1 to 16*
>RR, RB, d [CR]
n =1 to 14
d =0 or 1
d = 1, 2, 3, 4, 5, or 6
Read Results Block
Save to EEPROM from RAM>S [CR]
Save to RAM Card from RAM>S, CC, d [CR]d = 1 to 16*
Set Configurable Results>SR,d,d,etc. [CR]
*The number of configurations that can be stored on a RAM card depends upon the card
size (512K card can hold 16 configurations).
** Refer to Appendix B, Table B.1, RS–232 word 0 for a definition of Color CVIM status.
>RR,o,d[CR]
>RR,S
**
o = RL,RW,G,W,LP
d =gage or window number
S = Status
d =G1,G2,W1,W2,
RW1, RL3, LP, etc.
5–27
Chapter 5
Using the RS–232 Ports
Command Summary (cont’d)
Table 5.A
ASCII Command Summary (Cont’d)
CommandCommand StructureField Descriptions
Set Configurable Statistics>SSn,d,d,etc. [CR]
Trigger Inspection>T,[CR]
Write Display>W, D, data [CR]
>W, F, data [CR]
>W, DC, data (CRI
n =number of samples.
d = G1, G2, W1, W2,
RW1, LP, etc.
Data = 1 to 9
1 = Image only
2 = Failed Tools
3 = All Tools
4 = I/O Page
5 = Results Page
6 = Stats 1 Page
7 = Stats 2 Page
8 = Page Up
9 = Page Down
Data = 1 to 5
1 = Go On Reject
2 = Freeze On First Reject
3 = Freeze On All Rejects
4 = Freeze On Next Inspection
5 = Halt On Reject
Data = 1 to 9
1 = Resume
2 = Reset Statistics
3 = Reset Counters
8 = Page Up
9 = Page Down
5–28
Write Configuration BIock(W)>W, CBn [CR] data
Write Configuration Block(WC)>WC,CBn,CBn,etc. [CR] data
n = 1 to 213
Data= ASCII
configuration data
n = 1 to 213
Data = ASCII
configuration data
Chapter 5
Using the RS–232 Ports
Explanation of ASCII
Programming Example
The following sample program (called CCVIMASC.BAS) was written on an
Allen–Bradley 1784–T47 terminal using GW BASIC. This program obtains
and processes discrete results from the Color CVIM module. The program
will:
• Read the trigger count.
• Trigger an inspection.
• Detect when new data is available.
• Read discrete results part 1.
• Display discrete results part 1.
• Display a screen message if any of the first four windows fail.
A basic outline of the program is as follows:
Lines 10 to 99Program identification and related information.
Initialize program variables, configure the RS–232 port
for 8 bit transmissions, select no parity, select 9600
Baud, and initialize the display monitor.
Lines 100 to 120Prompt user to run program or exit.
Subroutine 2000Reads results to find the current number of total triggers.
Subroutine 1000Triggers the Color CVIM module inspection.
Line 200Causes a continuous read of Color CVIM module block
1 results until new results are detected. New results are
detected by an incrementing of the “total trigger” data.
Subroutine 2500Converts the Color CVIM module results from
hexadecimal to integer.
Lines 240 to 270Analyze the discrete fail bits for windows 1 through 4
and display a message if a failure is detected.
Line 400Sends the program to input line 100.
The program manipulates the returned data as follows:
5–29
Chapter 5
Using the RS–232 Ports
Explanation of ASCII
Programming Example
(cont’d)
Assume the ASCII string from the Color CVIM module is:
R1(17) = 00 = Hexadecimal representation of discrete input word 7 high
byte (Gage 32 Fault/Warning, Gage 31 Fault/Warning, etc).
The decimal display on the monitor will appear as follows after the program
manipulates the array:
2114 389176135162
00000
00000
000
Analysis of R1(4) for window failure:
R1(4) = 162 (decimal). The binary representation is:
1 0 1 0 0 0 1 0
The three ones in this representation indicate fail discrete input conditions in
windows 1, 3, and 4 (bits 1, 5, and 7 of word 1, see Table 4.A.).
To run the program, make sure the GWBASIC.EXE and program files are in
the same directory. Then, at the DOS prompt, type GWBASIC b/
CCVIMASC <CR>.
5–30
Chapter 5
Using the RS–232 Ports
ASCII Programming Example
1 REM RS–232 ASCII COLOR CVIM COMMUNICATIONS SAMPLE PROGRAM
2 REM COPYRIGHT ALLEN–BRADLEY COMPANY, INC. 1992 JRM, DMS
3 :
4 :
10 OPEN”com1:9600,n,8,1,DS”AS#1: REM Open communications channel
20 DIM R1(17): REM Allocate storage for tool set results
30 HE$=”0123456789ABCDEF”: REM Used for hex to decimal conversion
50 CLS
60 PRINT ”RS–232 ASCII TO ALLEN–BRADLEY COLOR CVIM COMMUNICATIONS PROGRAM”
61 PRINT ” COPYRIGHT ALLEN–BRADLEY COMPANY, INC. 1992 JRM, DMS”
62 PRINT
63 PRINT ”THIS PROGRAM WILL PERFORM THE FOLLOWING:”
64 PRINT ” READ THE TRIGGER COUNT”
65 PRINT ” TRIGGER AN INSPECTION”
66 PRINT ” READ TRIGGER COUNT UNTIL IT IS INCREMENTED”
67 PRINT ” READ DISCRETE RESULTS PART 1”
68 PRINT ” DISPLAY THE DISCRETE RESULTS PART 1”
69 PRINT ” DISPLAY THE FAILED WINDOWS 1–4”
70 PRINT
71 PRINT ”THIS PROGRAM WAS USED AND TESTED ON AN ALLEN–BRADLEY”
72 PRINT ” T47 COMPUTER WITH GWBASIC.EXE FROM MS–DOS VER 4.01”
73 PRINT
74 PRINT ”THE COLOR CVIM COMMUNICATION PARAMETERS FOR THIS PROGRAM ARE:”
75 PRINT ” CFG HOST: RS232 A”
76 PRINT ” SYS HOST: RS232 A”
77 PRINT ” TRIGGER SOURCE = (HOSTED)”
78 PRINT ” RS232 A PROTOCOL = ASCII”
79 PRINT ” RS232 A BAUD RATE = 9600”
80 PRINT ” COLOR CVIM MUST BE IN RUNMODE”
90 PRINT
99 :
100 PRINT:INPUT ”ENTER 1 TO RUN PROGRAM AND 2 TO EXIT PROGRAM”;PROCESS
105 PRINT
110 IF PROCESS = 1 THEN GOTO 130
120 SYSTEM
130 GOSUB 2000: REM Read tool set results to get # of triggers processed
140 IF R1(0)<0 THEN 100 ELSE NT = R1(0)
150 GOSUB 1000: REM Trigger an inspection
200 GOSUB 2000: IF R1(0)=NT THEN 200: REM Read until the trigger is processed
210 GOSUB 2500: REM Convert hex result string RE$ to integers
220 IF R1(0) <0 THEN 100: REM Quit on input error
230 PRINT: FOR X=0 TO 17: PRINT R1(X),: NEXT: PRINT: REM Print results
240 IF R1(4) AND 2 THEN PRINT ”Window 1 FAIL”
250 IF R1(4) AND 8 THEN PRINT ”Window 2 FAIL”
260 IF R1(4) AND 32 THEN PRINT ”Window 3 FAIL”
270 IF R1(4) AND 128 THEN PRINT ”Window 4 FAIL”
400 GOTO 100
The following is a sample ASCII program written in BASIC:
5–31
Chapter 5
Using the RS–232 Ports
999 :
1000 REM Subroutine to trigger an inspection on tool set
1050 PRINT#1,”>t”; CHR$(13);: REM Send the command
1080 RETURN
1999 :
2000 REM Subroutine to read discrete results from tool set
2040 IF LOC(1) THEN R$=INPUT$(LOC(1),#1): REM clear out any garbage characters
2050 PRINT#1,”>rr,p1”; CHR$(13);: REM Send the command
2060 CR$=INPUT$(2,#1): REM get CR/LF or ?/CR
2070 IF CR$=CHR$(13)+CHR$(10) THEN 2090
2080 PRINT CR[0]:PRINT”Input error”: R$=INPUT$(LOC(1),#1): R1(0)=–1: RETURN
2090 R$=INPUT$(1,#1): IF ASC(R$)<32 THEN 2090: REM ignore junk
2100 LINE INPUT#1,RE$: RE$=R$+RE$: REM get entire response
2120 R1(0) = VAL(MID$(RE$,1,9)): R1(1) = VAL(MID$(RE$,10,9))
2130 R$=INPUT$(LOC(1),#1): RETURN: REM Clear out any remaining characters
2499 :
2500 REM Subroutine to convert hex values in discrete result string RE$
2501 REM to integer values
2510 FOR RN=0 TO 15
2515 REM The following line converts each pair of hex digits to an integer
2520 D1=INSTR(HE$,MID$(RE$,25+RN*3,1))–1: D2=INSTR(HE$,MID$(RE$,26+RN*3,1))–1
2530 R1(RN+2) = 16*D1+D2: NEXT RN: RETURN
5–32
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.