The text of a manual · part 37 of 47
Bulletin 2803 VIM Vision Input Module User Manual: 15 - Using the RS-485 Port, pages 322 to 330
Pages 322 to 330 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 322
Chapter
15
Using the RS-485 Port
15-28
Serial line Diagnosis
Use this command to receive diagnostic data from the VIM2 module regarding the serial communications link. Refer also to the Serial Line Error Trucking section in this chapter for more information. This command has the following structure: . . ; 12 ; : .. Where:
12 = Serial Line Diagnosis command
The VIM2 module response contains a data field which includes five words of data: ~...‘.......“.“......‘““.“.‘..........................‘.““.”..’.‘“‘.“‘....“.‘.................................................................,.......
; dl (L) ; d2 (H) ; d2 (L) ; d3 (H) : d3 (L) ; d4(H) ; d4(L) ; d5 (H) : d5 (L) ; ..........................................................................................................................................................
! dl (H)
where each word consists of two bytes. Here are descriptions of each word: dl : Maximum number of erroneous messages. Set by the Serial Line Initialization command. Defaults to 100 (decimal) upon power-up, or each time the VIM2 module configuration is changed. d2: Maximum number of inspections between between two communication resets. Set by the Serial Line Initialization command. Defaults to 500 (decimal) upon power-up, or each time the VIM2 module configuration is changed. d3: Current number of consecutive erroneous messages. The VIM2 module increments this counter each time it receives a message which is not recognized as valid. d4: Current number of inspections since last reset. The VIM2 module increments this counter each time an inspection is conducted. d5: Number of serial line failure. The VIM2 module increments this number each time a serial line failure occurs (that is, when the d3 ,value reaches the maximum set by dl ). An example data field in the response would be: . . . . ... . .. . . ..... . . . .... . . . ... .. .. .. . .. . . .. .... . ; 00 i 64 ; 0 1 ; F4 ; 00 ; 02 ; 00 ! C8 ; 00 ; 01 ; This response indicates, for example, that dl = 0064 (100 decimal). That is, the maximum number of erroneous messages is set to 100 (this is the default setting).
Host/Mode Stipulations:
Valid for either master host or non-master host. Valid in all modes.
Page 323
Chapter 75
Using the RS-485 Port 15-29
Echo
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: . ..... . .....-............_. . . ..-....... .... .. i 01 ! x(H) i x(L) _ Data i : . . . . . . . . . .._............_.......... .._............:
Where: x(H)/x(L)
01 = = data
Echocommand Number of times repeated Note: A value of 0000 (zero) is treated as 0001 (for this command only). = Character string to be echoed
For example, this command: ~~~~~~-.~~~~~~.~......~....................................-....___.....,_._._.__,.___........,...............,,~.~~~~,, ; DLE ; STX ; 01 ; 00 ; 02 ; 31 ; 32 ; 33 ; 34 ; 35 ; DLE ; ETX ; Bee ;
will cause the VIM2 module to return: ................................................................................................ ; DLE ; STX ; 31 ; 32 ; 33 : 34 ; 35 ; DLE ; ETX ; BCC i ... ...... .. ........ ... ........ ... ...... ..j .... .........~........................................~ ... ........ ... ..... ... ..... ... ..... . .. ................................................ ......... ; DLE ; STX ; 31 : 32 ; 33 i 34 ; 35 ; DLE ; ETX ; BCC ; . . ............... . ................................................ ..............................
Host/Mode Stipulations: Valid for either master host or non-master host. Valid in all modes.
Page 324
Chapter 15
Using the W-485
Port
1S-30
Read Configuration
Use this command to retrieie specified configuration blocks. You can request the configuration data from either of the two EEPROM configurations (see Appendix B for configuration block data). This command has the following format: .. ... . . . ... _ . : 06 : 07 : .. . . .- . . .. . - ..
n
Where:
. . . .,. . . . i f . . . . . ..
n f
_ :
= Selected configuration, where: Ol= EEPROM #1 02= EEPROM #2 = Selected block(s), where you create a hex value which sets individual bits: Bit 0 = selects block 1 Bit 1 = selects block2 Bit 2 = selects block 3 Bit 3 = selects block 4 Bits 4-7 not used (zero)
For example, to read configuration blocks 2 and 3 from EEPROM configuration # 1, you would send this command:
n\ Jf .....-..........................___._...._.......
; DLE ; STX ; 06 1 07 ; 01 ; 06 ; DLE i E-/-X ! BCC i ... . . . . . . ... . . .. . . . . . . . . . . . . . . . . . .. . . . . ._..~___._____,._.. . .! . . . . 1.......... I . .. . . .._ ..__ _.’ _... .._, . . . .__.’ 00000110 :
‘.
‘_ :
, :
Bits7
+ 4
:
..
Bits 3 + 0 where n = 01 (selects EEPROM 11, and f= 06 (indicating 1 and 2 are set, which select blocks 2 and 3).
bits
The VIM2 module responds by sending a message for each of the selected blocks; the data field of each returned message contains the binary content of the selected block: ; DLE i STX i
.__..__._.. i .._.__....i . . .
f DLE i ET)( i BCC i First selected data ‘.:.: .__.......... :.:.: _... i .._...... f. . . . . . . . ...____.,....! block.
; DLE i ‘jTX i ._._._._..f . .._.... i .._..:.:..dafa..::..:
i DLE i ETX i Bee i Last selected _... i ._._..._..f._....____ i ._.._.____~block.
Host/Mode Stipulations: Valid in standby mode for master host or non-master host. Valid in run mode for master host only.
Page 325
Chapter
75
Using the RS-485 Port 75-37
Write IConfigura tion
Use this command to download a configuration to the VIM2 module. You download specified configuration blocks (see Appendix B for configuration block information). The VIM2 module stores the downloaded configuration block(s) in a “buffer,” or temporary memory location. Note: After you use the Write CorzFguration command, you must send the Verify command in order to have the VIM2 module validate the configuration block(s), and transfer them from the buffer to RAM (the working configuration). The Write Configuration . .. ...... ...~............_............. ; ; 06 ; 07 ; f command has the following format:
:.............. .. .. ..._........... .
Where:
f
= Selected block(s), where you use a hex value which sets individual bits: Bit 0 = selects block 1 Bit 1 = selects block 2 Bit 2 = selects block 3 Bit 3 = selects block 4 Bits 4-7 not used (zero)
Immediately upon sending the Write configuration command, you then follow with additional DFl messages which contain the data for each selected configuration block. For example, to write configuration blocks 1 and 2, you would send this command: ... . ; DLE
.
. .. .
; STX
; OB
.
.
.
. ..
; 07 ; 03 ; DLE i ETX i BCC i ........... .......::,.____...., ~ . ..........! __...._ ‘._
,..‘.
. . . .
_..
. .._
00000011 f=03 . : .: ._.
Bits7 + 4
:
Bits3 + 0 .
where f = 03 (indicating bits 0 and 1 are set, which select blocks 1 and 2). You would then follow the Write Configuration command with two messages -one for each of the selected blocks. The data field of each message would contain the binary content of the respective block: i STX i i DLE i ETX i BCC i data for data ___ Block, ........__.. _...__._._ i___.. ‘.:.: ..__..._..._.____....~ __._.__...~ __.._.._._; ..._._._... ; DLE
........................................................................................ ; DLE ; STX i ... data .__ i DLE i ETX ! BCC j ~~~~kf~r .......... ........ ......... :.................................. ..........
Host/Mode Stipulations: in stand by mode only.
Valid for master host only. Valid
Page 326
Chapter
15
Using the RS-485 Port
Verify
Use this command after you download the configuration block(s) using the Write Configuration command.
75-32
The Verify command has the following format: .
.
_
;
OD
;
1.............
There is no VIM2 module response to this command. When you send this command, the VIM2 module checks the validity of the configuration block(s) stored in the buffer (Note: When you use the Write Configuration command, the VIM2 module stores the downloaded configuration block(s) in a “buffer,” or temporary memory location). If the configuration data in the buffer is valid, the VIM2 module copies the data to RAM (the working configuration). Note: When the configuration is copied to RAM, the configuration previously stored in RAM is overwritten. Also, any statistics that have been stored by the VIM2 module are cleared. If the data is found to be not valid, the VIM2 module’s Configuration Fault discrete bit is set, and the VIM2 module does not copy the configuration block(s) to RAM. Note: Since no response is returned for this command, the Verify operation may fail without any warning other than the Configuration Fault discrete bit. We recommend that you check the Configuration Fault discrete bit after sending the Verify command (refer to either the Read Outputs command or the Read Discrete Results command for information). Host/Mode Stipulations: in stand by mode only..
Valid for master host only. Valid
Page 327
Chapter
15
Using the RS-485 Port 15-33
5a ve RAM Configuration to EEPROM
Use this command to copy the configuration stored in the VIM2 module’s RAM (the working configuration) to the EEPROM configuration specified in the command. The Save Configuration to EEPROM command has the following format: . .. . ... - .. _ i i 08 : 00 i n :............-.......................... Where:
n
= Selected EEPROM: 1= EEPROM #l 2= EEPROM #2
For example, to store the RAM configuration #2, send this command: ..................................
to EEPROM
............................................
; DLE ; STX ; 08 ; 00 ; 02 ; DLE : ETX i BCC i .................... ......... .......... ...... ........... :..........
Host/Mode Stipulations: in stand by mode only.
Load EEPROM Configuration to RAM
Valid for master host only. Valid
Use this command to download one of the two configurations stored in the VIM2 module’s EEPROM to the VIM2 module’s RAM, thus becoming the new working configuration. When sending this command, you select which EEPROM to load (#l or #2), and you also specify whether the selected configuration will become the new start-up configuration. This command has the following format: _ _ _ _ n2 i i 00 i nl ; 03 . . . . ..-............-............ l............ I
Where:
nl = Selected EEPROM, where: 1= EEPROM #l 2= EEPROM #2 n2 = Save new start-up configuration, where: O=No Other = Yes
For example, to store EEPROM #2 to RAM, and then set EEPROM #2 as starting configuration, send this command:
“.hx.. .d.nf....................... .............................. ; DLE ; STX ; 03 ; 00 ; 02 ; 01 ; DLE ; ET)( ; BCC i ........ ....... ....... ... ........ ........ ........ :......... ...........
Host/Mode Stipulations: in stand by mode only.
Valid for master host only. Valid
Page 328
Chapter
15
Using the RS-485 Port
15-34
Read Outputs
Use this command to have the VIM2 module send the status of the specified discrete bits. The VIM2 module responds to the first request as soon as it is not busy. If a repeat count is included in the command, the VIM2 module provides subsequent responses upon completion of each inspection. The Read Outputs command has the following format: . - .. _ . .. _ . . . .. ; ; 05 ; x(H) ; x(L) ; 06 ; f :............-..........................~............I.............
x(H) / X(L) = Number oftimes repeated
Where:
= Selected block(s), where you use a hex value which se2ects bits: Bit 0 = Module fault Bit 1 = Configuration fault Bit 2 = Module busy Bit 3 = Decision Bit 4 = Probe fault Bit 5 = XIY floatgage fault Bit 6 = 0 (Not Used) Bit 7 = Configuration busy f
For example, to read bits O-3 once, send this command: ; DLE :__.,_,_.__:
; STX .,.,__,._.:
; 05 ; 01) ; 01 i 06 ; OF ; DLE .___...:
____...:
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..-.
; ETX
“‘.‘~.,‘~‘~.~.~“:
.
.
.
.
.
.
.
.
.
.
.
.
; BCC .
.
.
.
;
.,........:
.._
-......_,____
-‘..-...______
00001111 f=OF
.:
.-._ ._
Bits7 + 4
Bits3 + 0
The response to the command has the following . . . .. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . .. . . .. . . . . . .. . . . . . . . . ! DLE
: STX i
. . . data . . _
; DLE
; ETX
: : :
. : BCC format:
. i where data consists of the bytes specified in the Read Output command. Each specified discrete bit is represented by one byte; the value is always either 00 (off) or 01 (on). For example, a response to the command shown above might be:
.............................._.___.._.._...___...___.....__..._........._.____. 00 i 00 ! 00 i 01 ~DLE;ETX~BCC:
!DLE~STX;
_. _.-. ....
-._.. ‘_ ‘.. BitsO-
..‘.
in which bit 3 (the Decision bit) is asserted, indicating reject decision.
Host/Mode Stipulations:
a
Valid for either master host or non-master host. Valid in all modes.
Page 329
Chapter 15
Read Discrete Results
Using the RS-485 Port
15-35
Use this command to have the VIM2 module send the on/off status of all the discrete bits, and the pass/fail result of the brightness probe, windows, lines gages, and math tools. The VIM2 module responds to the first request as soon as it is not busy. If the command is to be repeated, the VIM2 module provides subsequent responses after each inspection. The Read Discrete Results command has this format: . .. . .. ..._............-........... ~............. ; 07 i x(H) ; x(L) : . . ._ . . _.. . .
; ; 06 _. .. . . .
x(H) I’X (L) = Number oftimes
Where:
repeated
The VIM2 module response has the following . _ DLE
_ STX
.
. .
_..
.
..
.
.
.
.
~bytel~byte2:byte3~byte4~byte5~byte6~byte7~byte8~byte9
:..........:..........:..........:..........:......
._.,.,..:
. . . . . . . ...’
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
byte10 i DLE . .
L............
format: .
.
1 ETX
I . . . . . . . . . . .
.
: BCC
_
. . . . . . . . . . .
Response bytes l-10 are interpreted as follows (convert hex values to binary to obtain status (0 = pass, 1= fail) for each discrete result): Byte 1
Description Discrete bit results (use the same bit assignments the Read 0 utpu t command).
as listed in
Brightness probe and window results: Bit 0 = probe status, bits l-4 = window l-4 status, respectively. Line gages X, Y, 1, and 2 results, upper and lower functions: Bit 0 = gage X upper, bit 1 = gage X lower, bit 2 = gage Y upper, bit 3 = gage Y lower, bit 4 = gage 1 upper, bit 5 = gage 1 lower, bit 6 = gage 2 upper, bit 7 = gage 2 lower. 4
Line gages 3-6 results, upper and lower functions: Bit 0 = gage 3 upper, bit 1 = gage 3 lower, bit 2 = gage 4 upper, etc. Line gages 7-10 results Line gages 11-14 results Line gages 15-18 results Line gages 19-22 results Math tools l-8 results: Bit 0 = math tool 1 status, bit 1 = math tool 2, etc.
10
Math tools 9-12 results (bits 4-7 not used).
Page 330
Chapter
15
Using the RS-485
Port
15-36
Read Discrete
Resuk
(continued)
For example, suppose the VIM2 module’s response to the Read Discrete Results command is this:
............................................................................
......................................................
:.......... :. ......... : .......... :
; DLE ; STX ; 08 ; 02 ; 20 ; 00 ; 00 ; 00 ; 00 ; 00 ; 00 ; 00 ; DLE ; ETX ; BCC ; ............................ ........................................................................................ ........................................
In this example: Byte 1 = 08. This converts to the value 0000 1000 binary. Byte 1 contains the discrete bit status; according to the binary code (see the Read Outputs command), the Decision bit (bit 3) is asserted, indicating that in the last inspection the part was rejected. Byte 2 = 02. This converts to the value 0000 0010 binary. Byte 2 contains the probe and window results. According to the binary code, window #l failed. Byte 3 = 20. Th is converts to the value 0010 0000 binary. Byte 3 contains the pass/fail result of the upper/lower functions of line gages X, Y, 1, and 2. According to the binary code, the lower function of line gage 1 failed. Bytes 4-10 = 00. This converts to the value 0000 0000 binary. According to the binary codes for these bytes, none of the remaining line gage functions or math tools failed. Host/Mode Stipulations: Valid for either master host or non-master host. Valid in run mode only.