The text of a manual · part 7 of 25
Bulletin 5370 CVIM Configurable Vision Input Module Communications Manual: 4 - Using the Remote I/O Link, pages 47 to 55
Pages 47 to 55 of 202, from Bulletin 5370 CVIM Configurable Vision Input Module Communications Manual
The original document is the PDF (723 KB). 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 5370-CVIM
Page 47
Chapter 4 Using the Remote I/O Link (Node Adapter)
Accessing Discrete Bit Information (cont’d)
Table 4.B CVIM Module Remote I/O Outputs (PLC to CVIM Module)if CVIM Module is Rack 02 BIT
07 ––– 17
06 ––– 16
05 ––– 15
04 ––– 14
03 ––– 13
02 ––– 12
01 ––– 11
00 ––– 10
(Reserved)***
(Reserved)***
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
1 = Config Transfer
1 = I/O Request
1 = Light pen Request
1 = Trigger Toolset 2
1 = Trigger Toolset 1
1 = Unlock Setup
1 = Lock Setup
(Not Used)
1 = Display Stat 2 Page
1 = Display Stat 1 Page
1 = Display Results Page
1 = Display I/O Page
1 = Display All Tools
1 = Display Failed Tools
1 = Display Image Only
(Not Used)
(Not Used)
(Not Used)
Halt on Reject
1 = Freeze Next Image
1 = Freeze All Rejects
1 = Freeze First Reject
Go on reject
1 = Enable JMB Forces
1 = Disable JMB Forces
1 = Enable JMB Outputs
1 = Disable JMB Outputs
(Not Used)
(Not Used)
1 = Post TS2 to Remote I/O
1 = Post TS1 to Remote I/O
1 = Credit Card Config. (8’s bit)****
1 = Credit Card Config. (4’s bit)****
1 = Credit Card Config. (2’s bit)****
1 = Credit Card Config. (1’s bit)****
1 = RAM to Credit Card
1 = Credit Card to RAM
1 = RAM to EEPROM
1 = EEPROM to RAM
(Not Used)
(Not Used)
1 =Toolset 2 Request Results Block
1 = Toolset 1 Request Results Block
1 = Last Block (write Only)
Block Transfer Type *
Block Transfer Type *
Block Transfer Type *
1 = Block Trnsfer Block No. (128’s bit)
1 = Block Trnsfer Block No. (64’s bit)
1 = Block Trnsfer Block No. (32’s bit)
1 = Block Trnsfer Block No. (16’s bit)
1 = Block Trnsfer Block No. (8’s bit)
1 = Block Trnsfer Block No. (4’s bit)
1 = Block Trnsfer Block No. (2’s bit)
1 = Block Trnsfer Block No. (1’s bit)
1 = Force JMB Output 8 ON**
1 = Force JMB Output 7 ON**
1 = Force JMB Output 6 ON**
1 = Force JMB Output 5 ON**
1 = Force JMB Output 4 ON**
1 = Force JMB Output 3 ON**
1=Force JMB Output 2 ON**
1=Force JMB Output 1 ON**
(Not Used)
(Not Used)
1 = Force JMB Output 14 ON**
1 = Force JMB Output 13 ON**
1 = Force JMB Output 12 ON**
1 = Force JMB Output 11 ON**
1 = Force JMB Output 10 ON**
1 = Force JMB Output 9 ON**
1 = Force JMB Output 8 OFF**
1 = Force JMB Output 7 OFF**
1 = Force JMB Output 6 OFF**
1 = Force JMB Output 5 OFF**
1 = Force JMB Output 4 OFF**
1 = Force JMB Output 3 OFF**
1 = Force JMB Output 2 OFF**
1 = Force JMB Output 1 OFF**
(Not Used)
(Not Used)
1 = Force JMB Output 14 OFF**
1 = Force JMB Output 13 OFF**
1 = Force JMB Output 12 OFF**
1 = Force JMB Output 11 OFF**
1 = Force JMB Output 10 OFF**
1 = Force JMB Output 9 OFF**
1 = Page Down
1 = Page Up
1 = Resume Control
(Not Used)
1 = Display Toolset 2
1 = Display Toolset 1
1 = Reset Counters
*
1 = Reset Stats
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
(Not Used)
Set these three bits to specify the type of block as follows: 001 = Results, 010 = Configuration, 100 = Template, 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.
4–10
W O R D
20
21
22
23
24
25
26 27
Page 48
Chapter 4 Using the Remote I/O Link (Node Adapter)
Example Program for Accessing/Setting Discrete Bit Data
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, Toolset 1).
• Controlling screen display from a PLC. The program assumes that the CVIM module is located in rack 02 (processor address is 074 octal) and the PLC is in rack 00. 31 December 1989 Page 1 Ladder Listing Processor File: CVIM.ACH Rung 2:0 Rung 2:0 Specify Toolset 1 for remote I/O data – either this bit or 0:22/01 must be set for the PLC to receive results | Post TS1 | | results to | | REM I/O | | O:022 | +––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+ | 00 | Rung 2:1 This rung acquires an image, the CVIM one shots the input (F to T transition) | Trigger | | Trigger TS1 Trigger | | Cam 1 | | I:010 O:020 | +––––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+ | 02 12 | Rung 2:2 The next two rungs control enable or disable the lightpen from entering the setup mode on the black and white monitor. A keyswitch can be used here. | | | Lock Disable | | Setup Setup | | I:010 O:020 | +––––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+ | 00 10 | Rung 2:3 | | | Unlock Enable | | Setup Setup | | I:010 O:020 | +––––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+ | 01 11 |
4–11
Page 49
Chapter 4 Using the Remote I/O Link (Node Adapter)
Example Program For Accessing/Setting Discrete Bit Data (cont’d)
Ladder Listing
31 December 1989 Processor File: CVIM.ACH
Page 1 Rung 2:4
Rung 2:4 When Data Valid bit is high, read the discrete results for window 1, then light the correct status light. | Data Valid | | Toolset 1 Window 1 |Window 1 |Pass | | warning |Fault |light | | I:020 I:021 I:021 O:010 | +––––] [––––––––––––––––––––––––––––––––––––+–––]/[––––––––]/[––––––––( )––––+–+ | 06 | 00 01 10 | | | |Window 1 Fail | | | |Fault light | | | | I:021 O:010 | | | +–––] [–––––––––––––––––––( )––––+ | | | 01 11 | | | |Window 1 Warning | | | |warning light | | | | I:021 O:000 | | | +–––] [–––––––––––––––––––( )––––+ | | 00 12 | Rung 2:5 The next four rungs control the monitor display screen through the PLC link. | Display | | All Tools All Tools | | I:011 O:021 | +––––] [––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+–––(L)––––+–+ | 00 | 02 | | | |I/O Page | | | | O:021 | | | +–––(U)––––+ | | | 03 | | | |All Tools | | | | O:021 | | | +–––(U)––––+ | | 04 | Rung 2:6 | Display | | I/O All Tools | | I:011 0:021 | +––––] [––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+–––(U)––––+–+ | 01 | 02 | | | |I/O | | | | O:021 | | | +–––(L)––––+ | | | 03 | | | |All Tools | | | | O:021 | | | +–––(U)––––+ | | 04 |
4–12
Page 50
Chapter 4 Using the Remote I/O Link (Node Adapter)
Example Program For Accessing/Setting Discrete Bit Data (Cont’d)
31 December 1989 Page 1 Ladder Listing Processor File: CVIM.ACH Rung 2:7 Rung 2:7 | Display All Tools | | Results | | I:011 O:021 | +––––] [––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+–––(U)––––+–+ | 02 | 02 | | | |I/O | | | | O:021 | | | +–––(U)––––+ | | | 03 | | | |All Tools | | | | O:021 | | | +–––(L)––––+ | | 04 | Rung 2:8 This rung is equivalent to pressing the lightpen on the monitor screen. | Display Lightpen | | All Tools Request | | I:011 O:020 | +–+–––] [––––+–––––––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––+ | | 00 | 14 | | |Display | | | |I/O | | | | I:011 | | | +–––] [––––+ | | | 01 | | | |Display | | | |Results | | | | I:011 | | | +–––] [––––+ | | 02 | Rung 2:9 | | +––––––––––––––––––––––––––––––––[END OF FILE]–––––––––––––––––––––––––––––––––+ | | NO MORE FILES
4–13
Page 51
Chapter 4 Using the Remote I/O Link (Node Adapter)
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 three types of blocks that can be transferred:
• Results Blocks • Configuration Blocks • Template Blocks Depending upon the source and destination of the data blocks, the following transfers can be made: Reading Results (CVIM module to SYS Host)
• Results Blocks. There are four inspection results blocks (refer to Appendix A). Three of these blocks have a preconfigured structure. You can configure the fourth block so that only the information you require is transferred. The fourth (configurable) block can be only accessed through the remote I/O port. Transferring Configurations (CVIM module to CFG HOST and/or CFG HOST to CVIM module)
• Configuration Blocks. There are 135 configuration blocks which contain the 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.
• Template Blocks (blocks 136 to n). These blocks (part of the configuration memory) are previously learned image templates not on-line configuration block data, 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 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.
4–14
Page 52
Chapter 4 Using the Remote I/O Link (Node Adapter)
Transferring Results Blocks
Results blocks are transferred using block transfer reads. These blocks contain inspection result information such as: tool results, fault data, etc. Of the four results blocks, three 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 CVIM module of the Block Transfer Type and Block Number by setting discrete bit information using simple ladder programming (refer to Table 4.B):
• Set bit 0 of output word 3 to indicate RESULTS block transfer. • Use bit 4 of output word 3 to indicate Toolset 1. or Set bit 5 output word 3 to indicate Toolset 2.
• Use bits 10, 11, and 12 of output word 3 to indicate which of the four blocks to read. Refer to Appendix A and D.
!
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 – toolset 1 or bit 7 – toolset 2) to detect when new inspection results are available. These bits are described in Chapter 3 (Local I/O). Or as an alternative, you can use the ”total number of triggers” data contained in the results block. Note: Later in this chapter we provide an example PLC program for retrieving results data.
4–15
Page 53
Chapter 4 Using the Remote I/O Link (Node Adapter)
Configuring Results Block 4 and Statistics Block Formats
Both the programmable results block and statistic blocks are configured to contain user specified results. To configure the data in results block #4:
• 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 CVIM module to receive the “program” for results block 4.
• If configuring a statistics block– Set bits 0 and 2 of output word 3. This will set the CVIM module to receive the “program” for the statistics block.
• Perform a Block Transfer Write to transfer the 10 word “program“ from the host to the CVIM module.
• If reading results block– Read results block 4 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.
!
4–16
ATTENTION: The format information for the programmable results block and statistics blocks are stored in 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.
Page 54
Chapter 4 Using the Remote I/O Link (Node Adapter)
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: WINDOW Luminance Object Pixels
FORMAT 16.16* 32 bit 32bit
GAGE Linear Measure Object Pixels Edge Angular Measure
FORMAT 16.16 32 bit 32 bit 32 bit 16.16
Light Probe Reference Line Reference Window Reference Window Theta
16.16 16 bit 16 bit 16.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: Fraction 65536.0
PLC Floating Point Number = Integer +
The following example assumes that you are converting a “16 point 16” value of 2.75. The value 2.75 is stored as follows:
15** 14 13 12 11 10 9 Bit# Integer → N7:1 = 2 Fraction → N7:2 = .75
= 0 = 1
0 1
0 0
0 0
0 0
0 0
0 0
8
7
6
5
4
3
2
1
0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
1 0
0 0
←PLC
** 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–17
Page 55
Chapter 4 Using the Remote I/O Link (Node Adapter)
Converting Results Data (cont’d)
Rung 2:0 This program converts CVIM 16.16 to PLC Floating Point.
4–18