Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 31 of 47

Bulletin 2803 VIM Vision Input Module User Manual: 14 - Integration with the PLC, pages 271 to 278

Pages 271 to 278 of 404, from Bulletin 2803 VIM Vision Input Module User Manual

The original document is the PDF (26 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Allen-Bradley 2803-VIM2

Page 271

Chapter

Chapter Objectives

74

This chapter provides guidelines for integrating the VIM2 module with your PLC system. Guidelines are included for: l l

/n tegfa ting the V/M2 M&u/e with the p~c

Integration with the PLC

Using block transfer “read” and “write” commands within a PLC program for: -

Receiving configurations from the VIM2 module.

-

Downloading

-

Receiving comprehensive inspection results and “learn mode” statistics from the VIM2 module.

configurations to the VIM2 module.

Using the “discrete bit” interface between the PLC and the VIM2 module for discrete error or result information, and for helping to define the desired block transfer “read” and “write” information.

The VIM2 module may be integrated with your process to provide feedback for process management and closed-loop process control. This integration can be done through interface with the discrete I/O of the VIM2 swingarm terminal, and /or through communication with a PLC. The VIM2 module has a discrete I/O interface which you can directly connect to through the swingarm terminals (discussed in Chapter 5). Discrete outputs include Decision (inspection accept/reject) and Busy. There is also a strobe output for inspections with strobe lighting. For triggering inspections with an external device, there is a Trigger input. You can use the discrete swingarm I/O with or without the use of a host. You can also transfer discrete information through direct discrete bit interface with the PLC. Discrete bit communications can transfer accept/reject decision and error condition signals; however, no measurement data is communicated. For more complete information communication, you can use block transfer “reads” and “writes” to transfer information between the VIM2 module and the PLC.

Page 272

Chapter 14-2

Defining

Your Met-face Requirements

74

Integration with the /XC

Selecting the best approach for you VIM2 module/process interface (discrete communication or block transfer) depends upon your process and its feedback requirements. First you must determine if you need a single (discrete) accept/reject decision per inspection, or if you need more specific (block transfer) information, such as a list of tool-specific accept/reject decisions, a list of tool-specific numerical measurements, etc. These choices are discussed below: Using Discrete Bit Communication The VIM2 module communicates a workpiece accept/reject decision through the discrete Decision output. You access the decision output through either or both the PLC controller (discrete bits) or through the swingarm Decision terminals. Note: Other information, also transmitted through PLC controller discrete bits, are discussed later in this chapter. The Decision. output signals a reject if any of the acceptance range tests for the line gages, windows, math tools or brightness probe fail. Discrete decision information is ideal if you only need to identify unacceptable units from production, and do not need information regarding the specific cause of the rejection. This is practical for inspection of workpieces simply for completeness and/or correctness of assembly, and for elimination of any unacceptable part from production, regardless of the specific part flaw. Using Block Transfers You can use block transfers to collect specific inspection result values or statistics from the VIM2 module, and you can find out which specific inspection tool(s) failed per inspection. This can provide a more comprehensive information profile for your inspection. You can also use block transfers to collect and store the configuration data from the VIM2 module, or to download (“write”) a stored configuration from the PLC to the VIM2 module. The block transfer approach requires appropriate use of PLC ladder logic and block transfer programming, as well as an understanding of binary, binary coded decimal (BCD), and hexadecimal numbering. Note: The transfer of blocks requires more time than discrete bit communication, and may add to the inspection cycle time in high-speed applications. This is a consideration mainly for high-speed applications (over 5 parts/second).

Page 273

Chapter

Defining Your Interface Requirements (continued)

14 lntegration with the Pf C 74-3

For example, specific measurement feedback you can collect from the VIM2 module through a “results” block transfer include discrete bit accept/reject results for these tools: -Brightness probe -Windows l-4 -X and Y float gages -Line gages 1 through 22 -Math tools 1-12 The results blocks also provide measurements such as:

-Brightness probe gray level, from 0 to 255 -Window area measurements, from 0 to 61,696 pixels - X & Y gage measurements, from 0 to 255 - Line gage measurements, from 0 to 255 -Math tool results, from 0 to 65,535 The commands required for the collection of the above data by a PLC controller are discussed in this chapter (see Chapter 15 for similar information regarding a host connected through the RS-485 serial port). The management and processing of such data, however, is beyond the scope of this manual. Many software, hardware, and communications products are available for this purpose. Contact your local Allen-Bradley PLC supplier for information on data management and information processing options for the PLC controller.

Discrete Bit Communications

This section describes how to transfer discrete data through discrete bit transfer with the PLC. Eight discrete bit lines are used for communicating discrete bit information between the PLC and the VIM2 module. You can use these data lines for transferring information to the VIM2 module (discrete bit outputs) or for collecting information from the VIM module (discrete bit inputs). The discrete bit outputs are used by the PLC for controlling communications and operation of the VIM2 module. The discrete bit inputs are used for communicating discrete results and module status information from the VIM2 module to the PLC.

Page 274

Chapter

14

74-4

Integration with the PLC

Addressing the Discrete Bits Tables 14.A and 14.B list the discrete bit assignments for communication between the PLC and the VIM2 module. Figures 14.1 and 14.2 illustrate addressing discrete bits to include rack and module/group numbers.

Discrete Bit Communications (continued)

Note: The bit addressing shown in this chapter is based on “two-slot addressing.” For other addressing schemes (oneslot and half-slot), refer to Appendix F. Table 14.A VIM2 Module

Discrete Bit Inputs to the PLC

INPUT BIT ADDRESS

FUNCTION

I

I

Module

Fault

(0 = Running OK,

1 = Fault)

11

Configuration

12

Busy (0 = Ready,

13

Decision

14

Probe Error (0 = OK, Normal Operation,

15

X/Y Float Error (0 = OK, Normal Operation,

16

Reserved

17

Configuration

Fault (0 = Configuration

OK,

1 = EEPROM/CONFIG. invalid)

1 = Busy)

(0 = Accept,

1 = Reject) 1 = Error, Probe Out of Range) 1 = Error, Out of Range)

Busy (0 = Ready, 1 = Configuration

Download in progress)

Table 14-B PLC Discrete Bit Outputs to the VIM2 Module OUTPUT BIT ADDRESS

FUNCTION

10

Unlock

11

Last Block (0 = Not last block, 1 = Last Block)

12

Select Configuration

13

Select Block Tvoe (0 = Confiauration/Results.

14

Light Pen Emulation

15

Trigger

16

Binary/BCD Results (0 = Standard Binary Number Format,

17

Configuration

(0 = Lock the Module/Disable

(0 = Configuration

Progrmg.,

1 = Unlock/Enable

1, 1 = Configuration

Progrmg.)

2)

1 = Statistics)

(0 = no assertion, 1 = assertion)

(0 = Stand By,

1 = Initiate an Inspection Cycle)

Storage (0 = RAM Storage,

1 = BCD Format)

1 = EEPROM Storage)

Page 275

Chapter

14

/megration with the PLC 14-5

Discrete Bit Communications (continued) Figure 14.1 Bit Addressing

Scheme (for 2-slot rack addressing) Input (I) or Output

(0)

Rack No. (l-7) Module

Group No. (O-7)

Bit No. (1 O-l 7) (see Tables 14.A and 14.B)

Word Address t t

Bit Address

The PLC controller addresses and controls I/O modules through ladder logic programming. The ladder logic rungs must be programmed to read inputs and write to outputs. These read and write operations are controlled through instruction addresses programmed on the ladder rungs. The address assignments typically appear as shown in Figure 14.1 and Figure 14.2. Figure 14.2 Example Bit Addressing

(for 2-slot rack addressing)

1’

0 = output The VI M2 is here

Rack No. 1

\ Module Group No. 3

Rack No. 1

\

Word Address

I

I

Bit Address Group Nos.

0

1

2

3

4

5

6

Page 276

Chapter 74-6

Discrete Bit Communications (continued)

14

Integration with the PLC

Discrete Bit Inputs to the’PLC Controller There are eight discrete input bits available through the PLC controller. These include (see Table 14-A): l

Decision -This bit indicates the result status of the inspection, where 0 = Accept, and 1 = Reject. For inspection results, read this bit immediately after the Busy bit goes from “1” to “0.” When this bit = 1, the Decision LED goes On. When this bit status goes to “1,” it remains at “1” until an inspection “accept” decision is made by the VIM2 module.

l

Busy - This bit indicates the VIM2 module inspection status, where 0 = Ready (for a trigger), and 1 = Busy (conducting an inspection). This bit is set just after image acquisition has begun. Monitor the status of this bit to determine when to read the Decision bit; read the Decision bit immediately after the Busy bit goes from “1” to “0.” When this bit = 1, the Busy LED goes On (Note: This bit is also set when the VIM2 module is in setup mode).

l

Module Fault -This bit indicates the hardware operating status of the VIM2 module, where 0 = OK, and 1 = Fault. When this bit = 1, no triggers are accepted. Monitor the status of this bit to determine whether the VIM2 module has a fault and is not functioning. When this bit = 1, the CPU Fault LED goes On. Also, the Decision and Busy outputs go Off.

l

Configuration Fault -This bit indicates the VIM2 module configuration status, where 0 = OK, and 1 =Fault. A fault means that either of the two configurations in the VIM2 EEPROM is not valid, or that the downloaded configuration data is not valid, or that the start-up configuration number is not valid. A loss of power during a configuration download to the VIM2 module will also cause a configuration fault. If the VIM2 module indicates a configuration fault after a configuration block transfer, it aborts the transfer attempt, and reloads the transfer buffer with the previous working RAM configuration. To clear this bit, configure the VIM2 module through the light pen interface, or by downloading a valid configuration from the host. When this bit = 1, the Config. Fault LED goes On.

l

Pro be Error - This bit indicates the status of the brightness probe for an inspection, where 0 = reading within range, and 1 = out of range. If this bit = 1, the Decision bit also = 1 (reject), and no other vision tools are evaluated. When this bit = 1, the Acq. Error LED goes On. Monitor the status of this bit to determine when the workstage lighting brightness is out of acceptable range.

Page 277

Chapter

Discrete Bit Com~munications

14

Integration with the PLC 14-7 l

X/Y Float Gage Error -This bit indicates the status of the X and Y float gage readings for an inspection, where 0 = both gages are within range, and 1 = either gage is out of range for this inspection. If this bit = 1, the Decision bit also = 1 (reject). When this bit = 1, the Acq. Error LED goes On. Monitor the status of this bit to determine when the workpiece positioning is out of acceptable range.

l

Configuration Busy -This bit indicates the status of the configuration download process, where 0 = Not Busy, and 1 = Busy (the VIM2 is currently receiving a configuration block from the host). This bit is also set while the VIM2 module processes a block transfer command (see “Command Block” this chapter). While this bit = 1, the VIM2 cannot perform inspections, or receive another configuration block. Monitor the status of this bit to determine when to resume inspection triggers, or when to send the next configuration block.

(continued)

Discrete Bit Outputs to the VIM2 Module There are eight discrete output bits available through the PLC controller. These include (see Table 14-B): Unlock - Assert this bit to unlock the VIM2 module in order to enable manual (or block transfer) configuration the VIM2 module. Otherwise set this bit to 0 to prevent any attempt at configuring the VIM:!. This bit is active only if the PLC is the selected master host.

of

Last Block -Assert this bit just before you send the last block of a configuration block transfer to the VIM2 module. Otherwise set this bit to 0. When this bit is asserted, the VIM2 module performs an internal configuration validation, then either accepts the configuration, or signals a configuration fault (see Configuration Fault bit description). If you do not set this bit to 1 after a block transfer of a configuration, the transferred data will not be loaded into the VIM2 module. Select Configuration - Use this bit to select the configuration number when you are transferring the configuration to or from a VIM2 module EEPROM configuration through a block transfer read or write. Also use this bit when you are changing the startup configuration through a command block transfer. Assert this bit to choose Configuration #2; otherwise, set this bit to 0 to choose Configuration #l.

Page 278

Chapter 14-8

Discrete Bit Communications

14

Integration with the PLC l

Select Block Type - Use this bit to select the type of block (configure or results vs. statistics) you wish to read from the VIM2 module just before you use a block transfer “read” command. Set this bit to 1 to select statistics; otherwise, set this bit to 0. Note: This bit is only effective if the VIM2 module is running in “learn mode.” l

Light Pen Emulation - Assert this bit to change the monitor display when the VIM2 module is in the run mode. Asserting this bit has the same effect as depressing the light pen tip (that is, the VIM2 monitor cycles through the six display modes - see Chapter 6 or 13 for more information). Note: To repeat light pen emulation, you must set this bit to 1, then to 0, then to 1, then to 0, etc.

l

Trigger - Assert this bit to trigger an inspection cycle. Asserting this bit has the same effect as changing the trigger input status (on the swingarm) to high; that is, it will initiate an inspection (provided the VIM2 module is not busy or is not being configured). To repeat the trigger, you must set this bit to 1, then to 0, then to 1, then to 0, etc. Note: The SWG TRIGGER LED does not respond to the discrete bit trigger signal. Also, this bit is only effective if the PLC is the selected master host, and if host triggering is selected (see Chapter 7).

l

Binary/BCD Results - Use this bit when reading results blocks to select the type of numerical format for the results data. Set this bit to 1 to select binary-coded decimal (BCD); otherwise, set this bit to 0 to select binary. Note: Statistics data is only available in binary format. This bit is ignored when reading statistics blocks.

l

Configuration Storage -Use this bit when you send a configuration block transfer “read” or “write” to the VIM2 module. Set this bit with a block transfer write to indicate whether the configuration is stored only in VIM2 module RAM (“O”), or also in one of the two EEPROM configurations (Y”). Set this bit to 1 with a block transfer read to indicate the configuration is read from one of the two EEPROM configurations (setting this bit to “0” to select RAM is not a valid option for block transfer reads). Note: If you set this bit to “1,“you must also indicate which of the two EEPROM configurations you are writing to or reading from by setting or clearing the Select Configuration bit.

(continued)

Use this bit also when you send the command block transfer to load an EEPROM configuration into RAM (the working configuration). Set this bit to “1” to indicate the downloaded EEPROM configuration is the new designated start-up configuration. Otherwise set to “0.”