The text of a manual · part 35 of 47
Bulletin 2803 VIM Vision Input Module User Manual: 15 - Using the RS-485 Port, pages 304 to 312
Pages 304 to 312 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 304
Chapter 15
Using the RS-485 Port
75-70
Serial f ,ine Diagnosis
Use this command to receive diagnostic data from the VIM2 module regarding the serial communications link. Refer also to the Serial Line Error Tracking section in this chapter. This command has the following structure:
>X D [CR] The response includes five words of data, dl - d5: dl (L)-d2(H)-dz(L)-d3(H)-d3(~)' dl WI d4(H)_d4(L)_dS(H)_ds(L)[CR] where each data word consists of two bytes, a high byte (H) and a low byte (L), and each byte is represented by two hexadecimal characters (00-FF), followed by a space. Each hexadecimal characte.r is represented by an ASCII character. Here are descriptions of each data type:
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 two communication resets. Set by the Serial Line Initialization command. Defaults to 500 (decimal) upon power-up, or if 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. d 5: Number of serial line failures. This number is incremented each time a serial line failure occurs (that is, when the d3 value reaches the maximum set by dl). An example response would be:
This response indicates, for example, that dl = 00 64 (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 305
Chapter 15
Using the RS-485 Port 15-11
Echo
Use the echo command to check the serial communications link. This command will return the same same string of characters that are sent out with the command. This command has the following format:
> Ex,data
[CR] X data
= Number of times command is repeated (optional, range O-255, default =l) Note: A value of 0 (zero) is treated as a 1 (for this command only). = Character string to be echoed
For example:
> E2,H ELLO [CR] This command causes the VIM2 module to return: HELLO [CR] [LF] HELLO [CR] [LF]
Host/Mode Stipulations:
non-master
Read Configuration
Valid for either master host or host. Valid in all modes.
Use this command to retrieve specified configuration blocks. You can request the configuration data from either of the two EEPROM configurations. This command has the following format:
> RCn,CBf [CR] or >RCn,CB f&f2 [CR] n f fl-f2
= Selected configuration, where: 1= EEPROM #l 2= EEPROM #2 = Selected block. Valid range of l-4, or use ” * ” to indicate all blocks. = Span of blocks (for example, 2-4, or l-2)
Page 306
Chapter 15
Using the RS-485 Port
15-72
Read IConfiguration (continued)
Response to the Read Configuration command is:
data.. . .d.a.{$ZR][ LF] for first selected block . .I . . . [CR][LF] etc.
for second selected block where data consists of a number of two-byte words. Each byte consists of two hexadecimal characters (00-FF), followed by a space, and each individual hexadecimal character is represented by an ASCII character. Refer to Appendix B for configuration block descriptions and sizes. Host/Mode Stipulations: Valid in standby mode for master host or non-master host. Valid in run mode for master host only.
Write ‘Configuration
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 Configuration 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). After this, you can copy the configuration block(s) to one of the two EEPROM configurations, if desired, using the Save Configuration to EEPROM command. The Write Configuration
>W,C,f[CR] data [CR] ...
data f
[CR] or ;ayiC,fl-f2 ..I command has the following format:
[CR]
= Selected block. Valid range of 1-4, or use * * ” to indicate all blocks.
fl-f2
= Span of blocks (for
.d.aieCR] for first selected block exampze’247 e;;rck’jfor .
second seEected block
Or lw2’
Page 307
Chapter
15
Using the RS-485 Port 75-17
Write Configuration (continued)
Data in the downloaded configuration blocks consists of a number of two-byte words. Each byte consists of two hexadecimal characters (00-FF), followed by a space, and each individual hexadecimal character is represented by an ASCII character. Host/Mode Stipulations: in standby mode only.
Verify
Valid for master host only. Valid
Use this command after you download the configuration block(s) using the Write Configuration command. The Verify command has the following format:
>V[CR] 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 or the Read Discrete Results command for information). Host/Mode Stipulations: in stand by mode only.
Valid for master host only. Valid
Page 308
Chapter
75
Using the RS-485 Port
75-14
Save RAM C:onfiguration 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 following format,:
>Sn[CR] to EEPROM command has the n
= Selected EEPROM, where: 1= EEPROM #1 2= EEPROM #2
For example, to store the RAM configuration #2, send this command:
to EEPROM
>S2 [CR] Host/Mode Stipulations: in stand by mode only.
Load EEPROM Cronfiguration to RAM
Valid for master host only. Valid
Use this command to load 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 you want the selected EEPROM configuration to become the new start-up configuration. The Load EEPROM Configuration following format:
>LO,nl
,n2[CR] to RAM command has the nl = Selected EEPROM, where: 1= EEPROM #1 2= EEPROM #2 n2 = Save new start-up configuration, where: O=No Other = Yes
For example, to load EEPROM #2 to the RAM configuration, and then set EEPROM #2 as the starting configuration, send this command:
>LO,2,1
[CR]
Host/Mode Stipulations: in stand by mode only.
Valid for master host only. Valid
Page 309
Chapter 15
Read Outputs
Using the RS-485 Port
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
>Rx,Of [CR] or Rx,Of 1 -f2 [CR] x f fl-f2 format:
= Number of times command is repeated (optional, default =I) = Selected bit. Valid range of 1-8, OF use ” ‘* ” to indicate al2 bits. = Span of bits (for example, 14)
The discrete bits indicated by the f parameter are as follows:
Bit 1 = Module fault bit Bit 2 = Configuration fault bit Bit 3 = Module busy bit Bit 4 = Decision bit Bit 5 = Probe fault bit Bit 6 = X/Y compensation fault bit Bit 7 = 0 (Not Used) Bit 8 = Configuration busy bit The response to the command has the following format:
data [CR] where data consists of one byte for each of the bits specified in the Read Output command. Each byte consists of two hexadecimal characters, followed by a space, and each hexadecimal character is represented by an ASCII character. The value for each byte is always either 00 (off) or 01 (on). For example, to request the return of all the discrete bits, with no repeat count, you send this command:
>R,O*
[CR]
The example response would include eight bytes (separated by spaces), one byte for each of the eight bits requested:
00~00~00~01~00~00~00~00 T Byte 1 (Bit 1)
[CR] t Byte 8 (Bit 8)
In this example, the fourth byte (the Decision bit) = 01, indicating that in the last inspection the part was rejected. Host/Mode Stipulations: Valid for either master host or non-master host. Valid in all modes.
Page 310
Chapter 15
Using the RS-485 Port
15-76
Read Dkcrete Results
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 a repeat count is included in the command, the VIM2 module provides subsequent responses upon completion of each inspection. The Read Discrete Results command has this format:
> RRx,RD[CR] X
= Number of times command is repeated (optional, default =1)
The VIM2 module response has the following format: byte 1 byte 2 byte 3 byte 4-byte byte 8Ibyte 9Ibyte I~CR]
5-byte
6-byte
7- where each byte consists of two hexadecimal characters (OOFF), followed by a space, and each individual hexadecimal character is represented by an ASCII character. Convert hex values to binary to obtain status (0 = pass, 1 = fail) for each discrete result. Response bytes l-10 are: Byte 1
Description Discrete bit results (see the bit assignments below).
Bit0 = Module fault bit Bit 1 = Configuration fault bit Bit2 = Module busy bit Bit3 = Decision bit Bit4 = Probe fault bit Bit5 = X/Y compensation fault bit Bit6 = 0 (Not Used) Bit7 = Configuration busy bit 2
Brightness probe and window results. Bit 0 = probe status, Bits l-4 = window l-4 status, respectively. Bits 5-8 = 0 (not used).
3
Line gages X, Y, 1, and 2 status: Bit 0 = Float gage X, upper function status Bit 1 = Float gage X, lower function status Bit 2 = Float gage Y, upper function status Bit 3 = Float gage Y, lower function status Bit 4 = Line gage 1, upper function status Bit 5 = Line gage 1, lower function status Bit 6 = Line gage 2, upper function status Bit 7 = Line gage 2, lower function status
Page 311
Chapter 15
Using the RS-485 fort 75-17
Read Discrete Results
Byte Description (continued)
(continued)
4
Line gages 3-6 status: Bit 0 = line gage 3, upper function status, bit 1 = line gage 3, lower function status, bit 2 = line gage 4, upper function status, etc.
5
Line gages 7-10 status
6
Line gages 11-14 status
7
Line gages 15-18 status
8
Line gages 19-22 status
9
Math tools 1-8 status: Bit 0 = math tool 1 status, bit 1 = math tool 2 status, etc.
10 Math tools 9-12 status (bits 4-7 not used) For example, suppose the VIM2 module’s response to the Read Discrete Results command is this (Note: Recall that the response values below would be obtained by converting a hexadecimally-encoded ASCII response to hexadecimal values):
0~~02~~0~00~00~00~00~00~00~00
[CR] Byte10 t Byte 1 f
In this example, Byte 1 = 08. This represents the binary value:
0000 tBit7
1000
TBitO
Byte 1 contains the discrete bit status; according to the binary code, the Decision bit (bit 3, the fourth bit from the right) is asserted, indicating that in the last inspection the part was rejected. Byte 2 = 02. This represents the value 0000 0010 binary. Byte 2 contains the probe and window results. According to the binary code, bit 1 is asserted, meaning window #l failed. Byte 3 = 10. This represents the value 0001 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, bit 4 is asserted, meaning the upper function of line gage 1 failed. Bytes 4-10 = 00. This represents 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.
Page 312
Chapter
15
Using the RS-485 Port
15-18
Read l?esults Blocks
Use this command to have the VIM2 module send the specified results block(s). 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 Results Blocizs command has this format:
>RRx,RBf[CR] X f
= Number of times command is repeated (optional, default =l) = Selected block. Valid range of l-2, or use rr* “to indicate both blocks.
The VIM2 module response has the following format:
data[CR] for first da&(CR] for last block specified block specified where data in the uploaded results blocks consists of a number of bytes, each separated by a space (see Appendix C for detailed results block information). Each byte consists of two hexadecimal characters (00-FF), and each individual hexadecimal character is represented by an ASCII character. Host/Mode non-master
Stipulations: Valid for either master host or host. Valid in run mode only.