The text of a manual · part 33 of 47
Bulletin 2803 VIM Vision Input Module User Manual: 14 - Integration with the PLC, pages 287 to 294
Pages 287 to 294 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 287
Chapter
Command Block
74
Integration with the PLC 14-17
The PLC can send a “command” block to the VIM2 module using a block transfer “write” command in order to change the working configuration. You select the new working configuration by setting or clearing the SeZect Configuration discrete bit before sending the command block to the VIM2 module. You can also use the command block to reset the VIM2 module statistics only (Note: The statistics are reset automatically if you use the command block transfer to change the configuration, or if you write a configuration to the VIM2 module). Table 14-C shows the command block. Table 14.C Command Block Transfer
Command Block Transfer VALUES
FUNCTION
0 = Nochange,
1 = Change
Reserved for Future
Expansion
Reset Statistics Reserved for Future
0 0 = No change,*
1 = Reset Statistics
Expansion
0
Configuration
‘NOte:
Change
Reserved for Future Expansion . . -. _ . rhe StatlStlCS are reset whenever bit U IS set t0 1, Whether
Zero or not
. ..^.
-
Dlt 8 IS Set t0 U.
Writing the Command Block To download the command block data from the PLC to the VIM2 module, use a block transfer “write” command. The VIM2 module must be in standby mode, and the PLC must be the selected master host, in order for the PLC to write the command block. In writing the command block, your program would include these steps: 1. Check the Unlock discrete bit, and set if not set to 1. 2. If a configuration change is requested in the command block, set or clear the Select Configuration discrete bit to select the new working configuration from either EEPROM configuration 1 or EEPROM configuration 2. 3. If a configuration change is requested in the command block, set or clear the Configuration Storage bit to indicate if the selected EEPROM configuration number is to be saved as the new start-up configuration number. 4. Select the command block you are writing by block length (number of words = 5). 5. Monitor the Config Busy and Busy bits; wait until these bits are clear to send the block transfer write command.
Page 288
Chapter 14-18
Block Transfer Example
14
Integration with the PLC
An example of a results block transfer will serve as an example of block transfer programming. The PLC program in Figure 14.5 reads the list of measurement results for each inspection performed. Figure 14.5 Free-Rtrnninn .
.--
.
.
.
.
.
.
.
.
.
..y
T imar .
..I.WI
VIM2 Tri ger 00 9
Latch Trigger
W15
Set Block Type 010 (Ul13 Binary
Select
Re8 F
Bio;"o"
-it
O-
00
16 VIM2
E2 TI#
Unlatch Trigger
-it 12
15 Free
032 {TON j
-i/I
.Ol
15 VIM2
PR 033
BiYJ
To'o",92' 032
-i/H
I
12
15
AC xxx I 010 BLOCK XFER READ DATA: MODULE: LENGTH:
0030
---(EN>-07
59
110
FILE:
0500-0572
100
-bN>07
Page 289
Chapter
Displaying the I?esults Blocks
14 integration with the PLC 14-19
To display the contents of the results blocks, place the blinking cursor on the block transfer instruction and press “DISPLAY 0.” Figure 14.6 shows a typical results block with results displayed in binary form. Figure 14.7 displays the same results block in hexadecimal form. Notice that the display in Figure 14.6 is updated with every inspection cycle. Figure 14.6 Results Block Display in Binary Format
BINARY DATA MONITOR BLOCK XFER READ MODULE ADDR: 110 FILE: lOOO- 1034 FILE DATA 00000000 00011000 00001010 10000000
POSITION 001
002 003 004 005 006 007 008 009 010 011 012 013 014
015
0000000000000000 0000000000000000 0000000000000000 0000000000001001 0000000000000000 0000000000000001 00001000 00000000 00000000 00000000 00000000
00001111 00010000 00000000 00000000 10111111
00000000 00100101
00000000 10111000
RUN/PROGRAM MODE
Results Block Format
The numerical measurements in the results block can be sent to the PLC controller in binary or binary coded decimal (BCD) format. The format is selected by discrete output Bit #16. If the output is set to one, the results will be formatted as four digit BCD numbers. If the output is set to zero, the measurements will be formatted as 16 bit binary numbers. If you are not familiar with the following counting systems, refer to your PLC programming manual.
Page 290
Chapter 74-20
14
Integration with the PLC
Results Block Format (continued) Figure 14.7 Results Block Display in Hexadecimal
/
Format
HEXADECIMAL DATA MONITOR BLOCK XFER READ MODULE ADDR: 110
FILE:
lOOO- 1034
POSITION 006 007 008 009 010
011 012 013 014 015 016 017 018 019
020
FILE DATA 0009 0000 0001 08OF 0010
0000
0000 OOBF
0025
OOB8
0013
OOAD
0010
OOZF
1013
RUN/PROGRAM MODE
Block
Numbering
Transfer Systems
There are four numbering systems used with programmable controllers. They are: -
Binary Decimal Octal Hexadecimal
These numbering systems differ by the counting base used and the resultant differences in place values. The decimal, octal, and hexadecimal numbering systems are represented by binary bit sets at the PLC controller level and converted for display. This coding is referred to as binary-coded decimal (BCD), binary-coded octal (BCO), and hexadecimal.
Page 291
Chapter
Integration
14 with the PLC 14-21
Block Transfer Numbering Systems (continued) Figure 14.8 nary Numbering I
I
1 x27
= 128
128
1 x26 = 64
064
1 x25
= 32
032
0 x 24
= 00
000
I
I
I
I
I
I I
1x23=8
008
1x22=4
004
1x2’
= 2
002 r
1x20=1
001
Base 10 value = 23910
An 8-Bit 8yte
(Two Bytes Per 16-Bit Word)
Binary Format
The binary numbering system uses a number set that consists of two digits: the numbers 0 and 1. All information in memory is stored as an arrangement of O’s and 1’s. Each digit in a binary number has a certain place value expressed as a power of two. The decimal equivalent of a binary number is computed by multiplying each binary digit by its corresponding place value and adding these numbers together, as shown in Figure 14.8. When PLC output bit 16 is set to 0, the results block data will be transferred in binary format (unsigned integer). Each block contains up to 64,l&bit words. Each word contains one or more numbers.
Page 292
Chapter 14-22
Block Transfer Numbering Systems
14
Integration with the PLC
The formats of the configuration, results, and statistics blocks are detailed in Appendices B, C, and D.
(con timed) Figure 14.9 BCD Word Format 16 Bit Word
I
15
14
13
12
11
10
9
8
7
6
5
4
3
210 lllllllllllllll1 WXYZ
Scale Factor
BCD2
BCD3
BCDl
3 Digit BCD Value
BCD Format BCD words, as applied in the VIM2 system, have two parts: the scale factor and the value. The scale factor is used to allow a greater range of numbers than is possible with only three digits. The bits in the scale factor allow the transfer of numbers that are 10, and 100 times greater than the three digit value represented in the three-digit BCD value. The format of the BCD word is shown in Figure 14.9. The Scaling factors represented by the four scale factor bits (bits 12 through 15) are: W is Not Used X is Not Used Y is set to 1 if the value is l/100 the actual value 2 is set to 1 if the value is l/10 the actual value The remaining 12 bits are assigned in groups of four; one group for each digit. This is because it takes four binary number places to reach a decimal count of 9. The numbers displayed in the BCD mode are three digit unsigned decimal integers of 0 through 9. The BCD bits are assigned as follows: BCD3 is the high order digit (bits 8 through 11) BCD2 is the middle digit (bits 4 through 7) BCDl is the low order digit (bits 0 through 3)
Page 293
Chapter
Block Transfer Numbering Systems (con tin ued)
14 integration with the PLC 74-23
You can use X/Y Float Error discrete bit in your PLC program to verify that all tool readings are reported in the results block. If both this bit is clear(O), then the results block will contain measurements from all enabled tools. If the X/Y Float Error bit is set, results of all tools with shift compensation enabled (“float” status selected) will be zero, and the corresponding tool status bits will be set to 1 to indicate failure.
Page 294
Chapter 74-24
74
Integration with the PLC
(This page intentionally left blank)