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 8 of 15

N-400 User's Manual: Multi-Drop Controller for BL Series, pages 71 to 80

Pages 71 to 80 of 150

The original document is the PDF (1.3 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 N-400

Page 71

Chapter 4 •

Multi-Drop Link Mode Control Procedure

The polling command can be received in either of the following formats: % P mm CR , STX % P mm ETX [LF] can be added to the end of the command. When [ESC] is added to the head of the command, data stored in the N-400’s receiving buffer can be cleared.

•

Specify the read data format by selecting the “Header” and ”Delimiter” from the following formats. (➮ See p. 40.) The read data format can be changed. Header: [ESC], [STX] None Delimiter: [CR], [CR][LF], [ETX]

■ Setting manual polling mode If ID numbers have not been registered with the N-400 setup software, manual polling mode can be used. (When ID numbers have been registered, the N-400 automatically selects auto polling mode.) Reference: Auto polling mode simplifies the host computer’s program since the polling command is constantly sent to each BL series from the N-400, instead of from the host computer.

4.2.3 Capacity of Transmission Buffer ■ Transmission buffer of N-400 The N-400’s transmission buffer can store up to 24 Kbytes (24576 characters). The number of characters stored in the transmission buffer per piece of data is the number of characters of the data (including the additional data such as number of decodings) plus two characters indicating the data attributes.

Example 1 When the number of bar code digits is 10 (with no additional data) 24576 / (10 + 2) = 2048 The transmission buffer can store 2048 pieces of data. Example 2 When the number of bar code digits is 20 (with no additional data) 24576 / (20 + 2) = 1117 The transmission buffer can store 1117 pieces of data. If the number of read data exceeds the buffer capacity, the N-400 sends back the following “BUFFER OVERFLOW” error code to the host computer, and clears all data stored in the transmission buffer. (The N-400 displays error code “97”.) Header % P 00 –

OVER

Terminator

63

4

Page 72

Chapter 4

Multi-Drop Link Mode Control Procedure ■ Transmission buffer of BL series The BL-500/BL-180 series provides a transmission buffer that can store 400 bytes (400 characters). This buffer temporarily stores the BL series’ data and the N-400 executes polling for the data stored in this buffer. The data is stored until polling is executed. Five characters per piece of data indicating the data attributes are added to the number of characters of the data (including the additional data such as number of decodings) when stored in the transmission buffer .

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

If the number of read data exceeds the buffer capacity, the BL series until causing the BUFFER OVERFLOW error sends the following error code to the host computer, and clears all data stored in the BL series. The other BL series units which did not cause the error can continue to operate normally. % P mm CR , STX % P mm ETX * mm = 01 to 31: ID number of BL series The BUFFER OVERFLOW error occurs when the BL series’ reading interval is shorter than the polling interval. To prevent this error, take the following actions:

64

•

Reduce the polling interval by setting the baud rate to 38400 bps (the highest rate) for the RS-485 communication between the N-400 and each BL series unit.

•

Reduce the polling interval by reducing the number of connected BL series units.

•

Reduce the amount of data to be processed by the N-400 by increasing the BL series’ reading interval.

•

In manual polling mode, modify the program so that the polling command is sent to the BL series before the BUFFER OVERFLOW error occurs with the BL series.

•

Erase all ID numbers of disconnected BL series on the “ID SETUP” screen of the N-400 setup software.

Page 73

Chapter 4

Multi-Drop Link Mode Control Procedure

4.2.4 Handshaking protocol The N-400 supports the following four types of data communication modes (handshaking protocols). The handshaking protocols described in the following sections are common to both auto polling mode and manual polling mode.

No handshaking

Read data •••

•

N-400

The N-400 automatically sends read data to the host computer without using any handshaking protocol.

PASS/RTRY protocol

Read data •••

N-400 Response (PASS,RTRY)

•

After sending read data to the host computer, the N-400 waits for the response (PASS or RTRY) from the host computer. When the host computer sends the “PASS (quit)” command to the N-400, communication of one piece of data is completed, and the N-400 is ready to send the next data. The N-400 sends back no data in response to the “PASS” command.

•

If the “RTRY” (request to re-send) command is sent to the N-400 while the N400 is waiting for the “PASS” command, the N-400 sends the same data again, and waits for the “PASS” command. After the N-400 receives the “PASS” command, the N-400 sends back no data even if the “RTRY” command is sent to the N-400.

•

The BL series can read bar code data even when the N-400 is waiting for the “PASS” command. In this case, the read data is stored in the transmission buffer of the N-400. (➮ For the capacity of the transmission buffer, see p. 63.) If the amount of read data exceeds the buffer capacity, the N-400 sends back the “BUFFER OVERFLOW” error code to the host computer (➮ see p. 63), and clears all data stored in the transmission buffer. In this case, the N-400 stops its operation. The N-400’s operation restarts when the “PASS” command is sent to the N-400 in response to the “OVER” code.

65

4

Page 74

Chapter 4

Multi-Drop Link Mode Control Procedure •

The “PASS” and “RTRY” commands can be received in either of the following formats: PASS [CR], or [STX] PASS [ETX] [ESC] can be added to the head of the command, or [LF] can be added to the end of the command.

Note 1: Even when the N-400 is waiting for the “PASS” command, it can still receive any type of command. In this case, the N-400 immediately sends back a response (e.g. “OK”) to the host computer. Note 2: If the “SSET” command (➮ see p. 73) is sent to the N-400 while it is waiting for the “PASS” command, the N-400 clears the data stored in the transmission buffer and goes into SETUP mode.

ACK/NAK protocol •

The ACK/NAK protocol uses [ACK] (06H) instead of “PASS”, and [NAK] (15H) instead of “RTRY” described in the above protocol. The operation is the same as the above protocol; only the response codes are different.

•

When the RTS signal is turned OFF during RS-232C communication, the N-400 becomes ready for data transmission. When the RTS signal is turned ON, the N-400 starts sending data. This cannot stop/start the data transmission once data is being sent. It is effective for controling the transmission of a set of data.

•

Even when the RTS signal is OFF, the BL series can read bar code data. In this case, the read data is stored in the transmission buffer of the N-400. (➮ For the buffer capacity, see p. 63.) If the amount of read data exceeds the buffer capacity, the N-400 clears all data stored in the transmission buffer. In this case, the N-400 stops its operation. The N-400’s operation restarts when the RTS signal is turned ON, or when the N-400 sends back the “OVER” code to the host computer. (➮ See p. 63.)

4 RTS/CTS control

Note 1: The RTS/CTS control can be used together with other handshaking protocols. Note 2: When the RTS signal is OFF, the N-400 does not send back a response (e.g. “OK) to the host computer.

66

Page 75

Chapter 4

4.3

Multi-Drop Link Mode Control Procedure

Command Transmission To BL Series All the serial commands that can be used for the BL series can be sent from the host computer through the N-400 to the BL series. Send these commands in the following sequence and format:

The BL series with ID No. 3 starts the reading rate measurement test mode.

•••

Header % T 03 – TEST1 Terminator

N-400

Header % T 03 – OK Terminator

1. Send a command in the following format from the host computer. Header % T mm – Serial command Terminator

4

2. When the command is received by the BL series, the BL series sends back a response in the following format: Header % T mm – Response Terminator

• mm = 01 to 31: ID number of BL series

•

(Response) = Response to the command (“OK”, “ERROR”, etc.) NC: “Disconnection” error. This error occurs when the BL series with the specified ID number does not exist. SERR: Communication error

*

For the serial commands, the response to the serial commands, and the error codes, see the BL series User’s Manual. The BL series does not send any response to some of the direct control commands (TEST1, LON, etc.). However, the BL series always send back a response when they are used in multidrop link mode. • OK: Normal processing • ERR00: Incorrect command

67

Page 76

Chapter 4

Multi-Drop Link Mode Control Procedure •

When the command format is [Command] [CR], the response format is [Response] [CR]. When the command format is [STX][Command][ETX], the response format is [STX][Response][ETX]. Command

Response

Command CR

Response CR

STX Command ETX

STX Response ETX

*

[LF] can be added to the end of the command. However, [LF] is not added to the response.

*

When [ESC] is added to the head of the command, the N-400’s receiving buffer is cleared. However, [ESC] is not added to the response.

Example: Sending “LON” to start reading the BL series with ID No. 5 Command being sent: % T 05 – LON CR Response: % T 05 – OK CR

4

Command being sent: ESC STX % T 05 – LON ETX Response: STX % T 05 – OK ETX

Note: When the reading rate check mode (TEST1) start command is sent to the BL series, the data is stored in the BL series’ buffer, causing the buffer overflow error, unless auto polling is performed. Even if auto polling is performed, the buffer overflow error may occur because the polling interval is longer than the BL series’ reading interval when many BL series are connected. In this case, send the “Specific ID polling ON” command to the N400 (➮ see p. 72) to control the N-400 directly so that auto polling is performed only for the BL series to be tested. After using the specific ID polling mode, be sure to reset this command.

68

Page 77

Chapter 4

4.4

Multi-Drop Link Mode Control Procedure

N-400 Direct Control Commands You can perform the following controls by sending a command to the N-400. 1) Assigning an ID number to the BL series for which auto polling is performed. 2) Setting auto polling mode to ON/OFF 3) Checking if the BL series is properly connected 4) Reading control command in multi-head scan mode 5) Resetting the N-400 The above control 1) can be set with the N-400 setup software. (➮ See p. 42.) The above control 3) can be performed using the connection test switch provided on the N-400. (➮ See p. 51.)

4.4.1 Communication procedure

4

■ Sequence and format for communication

Auto polling ON

•••

POLE00 CR

N-400

OK

CR (For a description of the commands, see the following pages.)

1. Send a direct control command to the N-400 from the host computer. 2. After the N-400 receives the command, the N-400 sends back a response (e.g. “OK” or “NG”) to the host computer. Note: If an incorrect command is sent, the N-400 sends back no response. The ID number is not specified in the command/response format. The N-400 returns the response with the same header and delimieter as it receives. When the command format is [Command][CR], the response format is [Response][CR]. When the command format is [STX][Command][ETX], the response format is [STX][Response][ETX]. Command

Response

Command CR

Response CR

STX Command ETX

STX Response ETX

*

[LF] can be added to the end of the command. However, [LF] is not added to the response.

*

When [ESC] is added to the head of the command, the N-400’s receiving buffer is cleared. However, [ESC] is not added to the response.

69

Page 78

Chapter 4

Multi-Drop Link Mode Control Procedure Example: When the “Polling ON” command is sent to the N-400 When “POLE00 [CR]” is sent to the N-400, the response is “OK [CR]”. When “[STX] POLE00 [ETX]” is sent to the N-400, the response is “[STX] OK [ETX]”. When “[ESC] POLE00 [CR]” is sent to the N-400, the response is “OK [CR].”

4.4.2 Description of commands The following is a description of each command.

Registering and checking the ID numbers of the BL series for which auto polling is performed. Registers ID numbers for auto polling and checks which ID numbers are registered. *

4

The following commands are intended for the N-400. These commands do not check whether the BL series of the registered ID number is connected.

● Registering all ID numbers Command: ID00nnnnn... n = 0: Do not register n = 1: Register Response: OK ERR07... :“n” is any value other than “0” or “1”. Description: “n” corresponds to the ID number (1 to 31) in ascending order. (Thirty-one “n”s are required.) If you need to register ID numbers 2, 3 and 4, the command is ID000111000..... ● Checking all ID numbers Command: IDCHK Response: nnnnn... n = 0: Not registered n = 1: Registered Description: “n” corresponds to the ID number (1 to 31) in ascending order. (Thirty-one “n”s are required.) ● Registering individual ID number Command: IDmmn... mm = 01 to 31 (ID number) n = 0: Do not register n = 1: Register Response: OK ERR01...: “mm” exceeds the range of “01” to “31”. ERR07: “n” is any value other than “0” or “1”.

70

Page 79

Chapter 4

Multi-Drop Link Mode Control Procedure

● Checking individual ID number Command: IDCHKmm [mm = 01 to 31 (ID number)] Response: ON: Registered OFF: Not registered ERR01: “mm” exceeds the range of “01” to “31”. ● Registering serial ID numbers Command: IDMAXmm [mm = 01 to 31 (ID number)] Response: OK ERR01: “mm” exceeds the range of “01” to “31”. Description: Registers all ID numbers not more than “mm”. When “mm” is “00”, registering serial numbers is disabled. ● Checking serial ID numbers Command: IDMAX

4

Response: MAXmm mm = 01 to 31 (ID number) mm = 00 : Not registered mm = 99: The registered ID numbers are not serial numbers. Description: Registers all ID numbers not more than “mm”. When the registered ID numbers are not serial numbers, the response is “99”.

Saving registered ID numbers The registered ID numbers for auto polling are saved in the N-400. Command: IDSAVE Response: OK

Controlling auto polling Setting auto polling mode to ON or OFF. ● Auto polling ON Command: POLE00 Response: OK

Example: Sending the command to start auto polling (When ten BL series units are connected) 1. Send “ID001111111111000000000000000000000 [CR]” (or “IDMAX10 [CR]”). 2. The N-400 sends back “OK [CR]”. 3. Send “POLE00 [CR].” 4. The N-400 sends back “OK [CR]”.

71

Page 80

Chapter 4

Multi-Drop Link Mode Control Procedure ● Specific ID polling ON Command: POLEmm [mm = 01 to 31 (ID number)] Response: OK ERR01: “mm” exceeds the range of “01” to “31”. The “Specific ID polling ON” command is used to execute polling for the BL series with the specified ID number only. When the N-400 executes polling for several BL series in reading rate check mode, a large amount of data is continuously sent from the BL series, which causes the buffer overflow error because the polling interval is longer than the reading interval. To perform the reading rate check, use the “Specific ID polling ON” command. ● Checking auto polling Command: POLE Response: mm OFF mm = 01 to 31 (ID number) Auto polling is performed for the BL series specified by “IDmm” only. mm = 00: Auto polling ON OFF: Auto polling OFF

4

● Auto polling OFF Command: POFF Response: OK

Checking connections in multi-drop link mode Checks if the RS-485 communication between the N-400 and each BL series is normal. Command: SRCmm [mm = 01 to 31 (ID number)] Response: OK: Connection is correct. NC: “Disconnection” error SERR: Communication error ERR01: “mm” exceeds the range of “01” to “31”.

Controlling reading operation Used to activate the reading trigger signal using a command in multi-head scan mode. * This command can be used in multi-head scan mode only. ● Starting reading Command: LON Response: None ● Ending reading Command: LOFF Response: None You can start/end reading operation by sending the above command in the same way as when using trigger input. These commands can be used in multi-head mode only.

72