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

The text of a manual · part 9 of 15

Laser Bar Code Reader BL-500 Series User's Manual: Chapter 4 Serial Communication (RS-232C/RS-422A), pages 55 to 62

Pages 55 to 62 of 116, from Laser Bar Code Reader BL-500 Series User's Manual

The original document is the PDF (1.5 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 Keyence BL-501, Keyence BL-550H, Keyence BL-551H and Keyence BL-500

Page 55

Chapter 4 Serial Communication (RS-232C/RS-422A)

Page 56

4.1 Serial Communication

4.1 Serial Communication The BL-500 communicates with the PC via the RS-232C serial port. This enables you to change the BL-500’s settings from your PC.

Communication Types The BL-500 provides the following two communication types: Data communication Sends read bar code data from the BL-500 to the PC. Command communication Changes the BL-500’s settings by sending a command from the PC to the BL500. All communication is performed using ASCII codes.

4.1.1 Communication Setup Configure the setup for BL-500 and the PC before attempting serial communication. Setup of BL-500 Set the following parameters for the BL-500 using the setup software. Baud rate, Data bits, Parity, Stop bit, Communication protocol, Header/Delimiter, Read error code PC setup Based on the BL-500’s settings, set the communication parameters on the PC using the “Ports” setting in the Windows Control Panel. Note

The following communication parameters are the default settings for the BL-500: Baud rate: Data bits: Parity: Stop bit:

9600 bps 7 bits Even 1 bit

Set the PC according to the above settings before attempting communication. The BL-500 is set, temporarily, to the default settings for 5 seconds after the power switch is turned on. When the current settings of BL-500 is not certain, send the command “SSET” and a [CR] to the BL-500 from your PC with 5 seconds after power-up. This causes the BL-500 to remain at its default settings and you can communicate with the BL-500 at the default settings. For information on checking the BL-500’s current settings, see “Details on Parameter Setting Commands” on page 50. For information on changing the above communication parameters see “Description of Parameter Setting Commands” on page 52. Note

44

All commands should be entered in all uppercase characters. The BL cannot accept lowercase characters.

Page 57

4.2 Details on Data Communication

4.2 Details on Data Communication 4.2.1 Communication Protocols (Hardware handshaking) The BL-500 supports the following four handshaking protocols.

No Handshaking The BL-500 sends read data to the PC without using any handshaking protocol.

Read data

PASS/RTRY Handshaking After sending the read data, the BL-500 waits for a response from the PC. The response is either a PASS command or a RTRY command.

Read data

Response (PASS

C R

, RTRY

C R

)

The PASS command (quit) indicates that the PC has successfully received one data packet. The BL-500 then prepares for the next data transmission. The RTRY command (request to re-send) indicates that the data was not transmitted successfully. The command is a request to the BL-500 to re-send the data. The BL-500 sends the same data again and then waits for the response. After the BL-500 once receives PASS, the BL-500 sends back no data even if RTRY is sent to the BL-500. The BL-500 can continue to read while waiting for the PASS command. The data is stored in the BL-500’s transmission buffer (For the capacity of the transmission buffer, see page 46). If the amount of stored data exceeds the capacity of the transmission buffer, the BL-500 sends back <Header>OVER<Delimiter> to the PC, and clears all data stored in the transmission buffer. For more information, see “Capacity of Transmission Buffer” on page 46. Note

The BL-500 can receives other commands while waiting for the PASS command. In this case, the BL-500 sends back an immediate response (e.g. OK). When the SSET command (see “4.3.3” on page 50) is sent to the BL-500 while the BL-500 is waiting for the PASS command, the BL-500 clears the data stored in the transmission buffer, and enters the setting mode.

ACK/NAK Handshaking The ACK/NAK handshaking uses ACK (06H) and NAK (15H) instead of PASS and RTRY used in the PASS/RTRY handshaking, respectively. With these protocols, the BL-500 sends back different characters, but performs the same operation.

45

Page 58

4.2 Details on Data Communication RTS/CTS Handshaking When the PC’s RTS (BL-500’s CTS) signal turns off, the BL-500 becomes ready for data transmission. When the PC’s RTS signal turns on, the BL-500 starts data transmission. When the PC’s RTS signal is off, the BL-500 can still read. In this case, data is stored in the BL-500’s transmission buffer (see 4.2.2 below). If the amount of stored data exceeds the capacity of the transmission buffer, the BL-500 sends back <Header>OVER<Delimiter> to the PC, and clears all data stored in the transmission buffer. Note

The RTS/CTS handshaking cannot be used for RS-422A communication. The RTS/CTS protocol can be used together with other handshaking protocols. When the PC’s RTS signal is off, the BL-500 does not sends back a response to the PC.

4.2.2 Capacity of Transmission Buffer The BL-500’ s transmission buffer can store 400 bytes (400 characters). The number of characters stored in the transmission buffer for each data packet is the number of characters in the data (including additional data such as the number of decoding match count) plus an additional five characters indicating the data’s attributes. When multi label reading mode 2 or 3 is used, these five attribute characters are added to each data packet. Example 1 When the number of bar code digits is 10 (with no additional data) 400 ÷ (10 + 5) = 26 The transmission buffer can store 26 pieces of data. Example 2 When the number of bar code digits is 20 (with no additional data) 400 ÷ (20 + 5) = 16 The transmission buffer can store 16 pieces of data.

4.2.3 Read Data Format Set the data format of the Header and Delimiter, respectively. Header

Read data

Delimiter

With the setup software, the following formats can be selected. Other than the following formats, you can freely set up to 5 characters. Header ESC (1BH)/STX (02H)/None Delimiter CR (ODH)/CR (ODH) LF (OAH)/ETX (O3H)

46

Page 59

4.2 Details on Data Communication 4.2.4 Read Error Code If the BL-500 fails to read a bar code, the B-500 sends back a read error code. The initial setting of the read error code is as follows: Header

ERROR

Delimiter

The read error code can freely be changed (within 8 characters). The BL-500 can be set to send no error code (see page 36).

47

Page 60

4.3 Command Communication

4.3 Command Communication The BL-500 includes commands to directly operate the BL-500 (direct control commands) and the commands used to change or confirm the BL-500’s settings (parameter setting commands).

4.3.1 Setup of Direct Control Commands Communication procedure Command

Response

1. Send a direct control command from the PC to the BL-500. 2. After receiving the command, the BL-500 sends back an OK response and executes the required operation. When the read operation control command or test mode control command is sent to the BL-500, the BL-500 sends back no response. 3. When an incorrect command is sent to the BL-500, the BL-500 sends back no response. Note

LF can be added after the command being sent. In this case, however, LF is not added to the response data. When ESC is inserted before the command being sent, characters in the BL500’s command receiving buffer are cleared. If the BL-500’s command receiving buffer contains erroneous characters due to data transmission error during communication, add ESC to the command being sent.

Note

48

For command communication, set the time duration between transmission of each character (byte) to up to 30 seconds. If this duration exceeds 30 seconds, the BL-500 cancels the received characters.

Page 61

4.3 Command Communication 4.3.2 Explanation of Direct Control Commands The following describe direct control commands in details.

Read operation control This command specifies the data read timing. [LON]

Trigger on Command: LON Response: None

[LOFF]

Trigger off Command: LOFF Response: None • Even when the read operation is controlled with these commands, the BL-500 performs the same operation as with the trigger input (see page 8 to 10). • “Trigger input: on” corresponds to LON, and “trigger input: off” corresponds to LOFF. • The BL-500 starts read operation on receipt of LON and stops it on receipt of LOFF. • When a bar code can be correctly read and the read data has already been set, you need not send LOFF. • The command characters can be freely changed (within 8 characters).

Test mode control Starts or quits the test mode. [TEST1]

Reading rate check Command: TEST1 Response: None

[TEST2]

Tact check Command: TEST2 Response: None

[QUIT]

Resetting test Command: QUIT Response: None • After using the test mode, be sure to reset it.

OK/NG output control Directly turns on/off the OK/NG output. This enables you to easily check wiring. [OKON]

Turning the OK output on Command: OKON Response: OK

[NGON]

Turning the NG output on Command: NGON Response: OK

[ALLOFF]

Turning the OK/NG outputs off Command: ALLOFF Response: OK

49

Page 62

4.3 Command Communication Clearing transmission buffer [BCLR]

Clears data stored in the transmission buffer. Command: BCLR Response: OK

Shift to setting mode [SSET]

Enters the setting mode (see page 49). Command: SSET Response: OK

Laser off/Resetting Laser off Turns off the laser emission when the laser beam may cause injury to an operator (see page x). [LOCK]

Laser off Command: LOCK Response: OK

[UNLOCK]

Resetting Laser off Command: UNLOCK Response: OK • When the Laser off command is executed, bar code read operation (laser emission) is disabled until the Laser off command is reset by using UNLOCK command. • The Laser off command is retained even after the power is turned off.

4.3.3 Details on Parameter Setting Commands The following describes how to change the BL-500’s settings through command communication. You can use the setup software to change the BL-500’s settings instead of these commands.

Communication Details 1. Send the direct control command SSET to the BL-500. The BL-500 will shift to setting mode. After successfully executing the command, the BL-500 sends back an OK. 2. After the BL-500 shifts to setting mode, send the command (setting change command) corresponding to the item to be changed to the BL-500. After successfully executing the command, the BL-500 sends back an OK. If an error occurs with this command, the BL-500 sends back ERRnn. (nn stands for error code numbers.) 3. To confirm the current settings, send a setting confirmation command. After successfully executing the command, the BL-500 sends back an OK. If an error occurs with this command, the BL-500 sends back ERRnn. 4. To save the current settings in the EEP-ROM, send SAVE to the BL-500. Once you save the settings in the EEP-ROM, the BL-500 will start with these settings when the BL-500 is turned on next. After successfully executing the command, the BL-500 sends back an OK. If an error occurs with this command, the BL-500 sends back ERRnn. 5. To quit the setting mode and perform the normal bar code reading, send SEND to the BL-500. After successfully executing the command, the BL-500 sends back an OK. If an error occurs with this command, the BL-500 sends back ERRnn.

50