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

The text of a manual · part 12 of 15

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

Pages 111 to 120 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 111

Chapter 6

PLC Link

6.1.2 Devices used for PLC link The N-400 supports the following PLC devices. To use MELSEC-A series, select the data register or file register. The available memory areas of the MELSEC-A or SYSMAC-C may be smaller than the following data. For details, see the instruction manual for the PLC being used. PLC

Device name

Memory area

KV-10/16

Data memory

DM0000 to DM0999

KV-24/40/80

Data memory

DM0000 to DM1999

KV-300

Data memory

DM0000 to DM8999

MELSEC-A

Data register

DM0000 to D8191

File register

DM0000 to R8191 (according to the setting)

Data memory

DM0000 to DM6143

SYSMAC-C

The MELSEC-A series provides an extension file register. When a block number is specified during the N-400 setup, the specified extension file register is used. When “0” is specified for the block number, the extension file register of the block number specified in the PLC program is used. If no block number is specified (during the N-400 setup and PLC programming), the file register incorporated in the CPU is used.

6

103

Page 112

Chapter 6

6.2

PLC Link

Setup Procedure For setup and connection procedures, see p. 10. This section describes the procedures for setting the N-400, BL series and PLC only.

6.2.1 Setting the BL series 1. Set “Multi-drop Link” to “Enable”. (Click the button.) 2. Enter the ID numbers (1 to 31) for the connected BL series. Be sure not to assign the same ID number to different units. 3. Set the RS-485 communication parameters (baud rate, data length, parity and stop bit length) for the BL series according to the N-400’s settings. The default settings of the BL series and the N-400 are as follows: Baud rate: 9600 bps Data length: 7 bits Parity: Even Stop bit length: 1 bit Note: To increase the response speed, set the BL series’ baud rate to 38400 bps. 4. Setting “Handshaking protocol” or “RTS/CTS” is not effective. 5. Set “Header” to “None”. Setting “Delimiter” is not effective. * To use multi-head scan mode, set the following parameters.

6

Additional setups for multi-head scan mode use 1) To use the N-400 in multi-head scan mode, set the BL series’ reading mode to “Single label”.

2) Set the trigger input signal type to “Level”. 3) Set the read error code according to the N-400’s setting. Normally, the read error code is set to “ERROR” (default setting). 4) Set the reading start command and read end commands according to the N400’s settings. Normally, these commands are set to “LON” and ”LOFF” respectively (default settings). * Change other parameters as required.

104

Page 113

Chapter 6

PLC Link

6.2.2 Setting the N-400 Using the N-400 setup software, set the N-400 as follows: For the difference in settings depending on the type of the link unit or PLC, see “Setting the PLC” on the next page. 1. Set the host mode to multi-drop link mode or multi-head scan mode. (➮ See p. 38.) 2. Set the PLC link on the “PROTOCOL SETUP” screen. (See p. 40) •

• • • •

PLC model name To use the KV-L2 in “Link” mode, select “SYSMAC-C” for the N-400’s setting. DM head address Trigger input through PLC Setting PLC unit number/station number Setting file register to “Enable” or “Disable”

3. Enter the ID numbers for the connected BL series on the “ID SETUP” screen. (➮ See p. 42.) 4. Set the baud rate, data length, parity and stop bit length according to the PLC’s settings on the “RS-232C SETUP” screen. (➮ See p. 42.) Setting "RTS/CTS" protocol is not effective when PLC link is enabled. 5. Set the baud rate, data length, parity and stop bit length according to the BL Series’ settings on the “RS-485 SETUP” screen. (➮ See p. 43.) Note: To increase the response speed, set the RS-485 communication baud rate to 38400 bps. (Set the BL series’ baud rate to this value as well.) *

To use multi-head scan mode, set the following parameters.

Additional setups for multi-head scan mode use 1) In multi-head scan mode, connect the trigger input to the N-400 so that all of the BL series connected to the N-400 are controlled like a single bar code reader. You must also set the “Read mode” and “Trigger input signal type” on the N400. 2) Set the read error code according to the BL series’ setting. Normally, the read error code is set to “ERROR” (default setting). 3) Set the reading start command and read end commands according to the BL series’ settings. Normally, these commands are set to “LON” and ”LOFF” respectively (default settings).

105

6

Page 114

Chapter 6

PLC Link

6.2.3 Setting the PLC Set the PLC or link unit as follows: ■ Setting MELSEC-A series 1. Set the RS-232C communication parameters (baud rate, data length, parity and stop bit length) according to the N-400’s settings. 2. Set the station number according to the N-400’s setting. 3. Set the mode to “Protocol Type 4 ”. 4. Set the main channel to “RS-232C”. 5. Set “Checksum” to “Enable”. 6. Set “Write during running” to “Enable”. 7. Set “Selecting computer link/multi-drop” to “Computer link” (for the AJ71UC24 only). ■ Setting SYSMAC-C series 1. Set the RS-232C communication parameters (baud rate, data length, parity and stop bit length) according to the N-400’s settings. 2. Set the unit number according to the N-400’s setting. 3. Set the command level to “Level 1, 2, 3”. 4. Set “1:1/1:N” to “1:N”.

6

5. Set “I/O port” to “RS-232C”. 6. Set “Trigger input” to “Internal”. 7. Set “Supply 5 V” to “Disable”. 8. Set “CTS” to “0 V (Normally ON).” *

The “I/O port”, “Trigger input”, “Supply 5 V” and “CTS” parameters may not be provided depending on the type of link unit.

■ Setting KV series/handheld programmer port 1. The KV series’ handheld programmer port must always be set to the following values: • Baud rate : 9600 bps • Data length: 8 bits • Parity: Even • Stop bit length: 1 bit Set the RS-232C communication parameters of the N-400 according to the above settings. Set the N-400’s communication mode to “KV”. 2. No other parameters need to be set.

106

Page 115

Chapter 6

PLC Link

■ Settings for KV-L2/KV mode 1. Set the KV-L2’s communication mode to “KV mode”. Set the N-400’s communication mode to “KV”. 2. The KV mode must be always set to the following values: • Baud rate : 9600 bps • Data length: 8 bits • Parity: Even • Stop bit length: 1 bit Set the RS-232C communication parameters of the N-400 according to the above settings. 3. Set the station number to “00”. 4. To use the KV-L2 port 2, set the port 2 selector switch to “RS-232C”. 5. No other parameters need to be set. ■ Settings for KV-L2/Display Interface mode 1. Set the KV-L2’s communication mode to “Display Interface” mode. To use Display Interface mode, select “SYSMAC-C” for the N-400’s setting. 2. Set the baud rate, data length, parity and stop bit length according to the RS232C communication parameters of the N-400. 3. Set the unit number according to the N-400’s setting. 4. To use the KV-L2 port 2, set the port 2 selector switch to “RS-232C”.

6

5. No other parameters need to be set.

107

Page 116

Chapter 6

6.3

PLC Link

Device Assignment The device assignment varies depending on whether the PLC link is used in multidrop link mode or in multi-head scan mode. The following sections describe the device assignment in each mode.

6.3.1 Device assignment in multi-drop link mode The data areas used to control the N-400 are provided in the PLC’s internal memory (D areas or DM areas). When a device head address is specified on the “PLC SETUP” screen of the N-400 setup software, the device numbers are automatically assigned based on the specified head address. ■ Data memory head address for each ID number and reading trigger areas The addresses of “+00” to “+30” (based on the specified head address) indicate the areas where the bar code data for each ID number is stored. The addresses of “+31” to “+61” indicate the areas used to send a reading trigger signal to the BL series. These areas are not assigned if you set “Reading trigger input area” to “Disable” in the N-400 setup software. (In this case, these areas can be used for other purposes.) Address

6

•

108

Description

Reference page

+00

Data memory head address for ID No. 1 p. 108

+01

Data memory head address for ID No. 2

+02

Data memory head address for ID No. 3

: :

: :

+30

Data memory head address for ID No. 31

+31

Reading trigger area for ID No. 1

+32

Reading trigger area for ID No. 2

+33

Reading trigger area for ID No. 3

: :

: :

+61

Reading trigger area for ID No. 31 p. 108

The “+00” to “+30” data memory head addresses can be set to the same number. If the same head address is specified, data from all the BL series is stored in the same area.

Page 117

Chapter 6

PLC Link

■ Data memory areas for each ID number Bar code data read by the BL series for each ID number is stored in the areas of “+00” to “+30” (based on the specified data memory head address). In the following table, “A” indicates the data memory head address. When ten BL series are connected, ten data memory areas exist (if the different data memory head addresses are specified for each ID number). Address

Description

Reference page

A + 00

Data memory flag area pp. 110 and 111

A + 01

Reserved area, A + 02

ID number

A + 03

Number of digits of bar code data

A + 04

1st digit of bar code data

A + 05

2nd digit of bar code data p. 112

A + 06

3rd digit of bar code data

: :

: :

A + 258

255th digit of bar code data

Note: These data areas accept up to 255 digits. However, the BL series can read only 32 digits. Therefore, all the areas for 255 digits are not used for the N-400. Only the areas corresponding to the number of the data digits are used.

Example: When the head address is “100” and three BL series (ID nos. 1 to 3) are connected:

6

Head address: 100 DM100

200

DM101

300

DM102

400

(ID1)

(ID2)

(ID3)

DM200

Flag

DM300

Flag

DM400

Flag

DM201

Reserved

DM301

Reserved

DM401

Reserved

DM202

ID

DM302

ID

DM402

ID

DM203

Number of digits

DM303

Number of digits

DM403

Number of digits

• ••

• ••

• ••

• ••

• ••

• ••

109

Page 118

Chapter 6

PLC Link ■ Detailed description on device assignment +00 to +30 Data memory head address for each ID number

Specify the head address of the areas where the read data are stored. (Specify the head address as binary data.) Specify different head addresses for each ID number. (If the same address is specified, all data is replaced with the last data when BL series units with different ID numbers continuously read data.) +31 to +61 Reading trigger area for each ID number

These areas are used to send the trigger input signal to the BL series to start reading bar code data. You can set these areas to “Used” or “Unused”, depending on the N400’s internal setting. (➮ See p. 40.) If you set these areas to “Unused”, users can freely use the areas. When a photoelectric sensor for trigger input is connected to the BL series, do not use these areas. Specify these areas as follows: • Start reading (Trigger ON): 0001 • End reading (Trigger OFF): 0000 Note: Specify these areas as “0000” while the BL series is not reading bar code data.

6

A +00 (A: Data memory head address specified as +00 to +30) Data memory flag area

These areas are used as a flag that indicates if bar code data has been stored in each area. The flag areas can be used for the following two purposes:

110

Page 119

Chapter 6

PLC Link

Real-time control •

To specify the flag areas, use “0000” or “0001”.

•

While the N-400 is writing the bar code data read by the BL series in the PLC’s memory, the flag area is specified as “0001”.

•

When data writing is completed, the flag area becomes “0000”. This indicates that new data has been stored in the A+02 to A+258 addresses. When the A+00 address is “0000”, the stored data is effective.

Example 1 Normally, the A+00 address is set to “0000”. While the N-400 is writing data, the flag area is “0001”. When the flag area becomes “0000”, the data stored in the A+02 to A+258 addresses can be processed. Example 2 Normally, the A+00 address is set to “0001”. When data writing is completed, the flag area becomes “0000”. The data stored in the A+02 to A+258 addresses can then be processed. Set the A+00 address to “0001” immediately after data processing is completed. When the A+00 address becomes “0000”, this indicates that writing new data is completed. Note: When the BL series continuously reads bar codes, the real-time processing mode may replace stored data with new data before the new data is processed in the PLC. To prevent this, use the sequential processing mode as shown below.

6

Sequential processing

Tips

•

To specify the flag areas, use “0002” or “0003”.

•

When the A+00 address is “0002”, new data can be stored.

•

When data writing is completed, the flag area becomes “0003”, and new data has been stored in the A+02 to A+258 addresses.

•

After data processing is completed, set the flag area to “0002”. Writing new data is impossible until the flag area is “0002.

•

Data which cannot be stored in the specified areas is retained in the BL series’ transmission buffer. (In sequential processing mode, data is retained in the BL series’ transmission buffer instead of the N-400’s transmission buffer. For the capacity of the BL series’ transmission buffer, see p. 63.) If the amount of retained data exceeds the buffer capacity, the “BUFFER OVERFLOW” error occurs and the “OVER” code is stored in the corresponding area.

Even when the BL series with ID No. 1 retains data (the flag area is “0003”), data from the BL series with other ID numbers can be stored (if the flag area is “0002”). Thus, the sequential processing for each ID number is performed independently.

111

Page 120

Chapter 6

PLC Link A +02 to +258 Data (ID number, number of digits, data) memory area

•

The ID number of the BL series that read the data is stored in the A +02 address. The number of data digits is stored in the A +03 address as binary data.

•

The read bar code data is stored in the A+04 to +258 addresses using the ASCII codes (Hexadecimal numbers in two digits) by the digit. (➮ See the ASCII code table on p134.)

•

If a read error occurs, the “ERROR” code is stored in the corresponding area. (The read error code can be easily changed according to the BL series’ setting.)

•

If the buffer overflow error occurs with the BL series, the “OVER” code is stored in the corresponding area. A+02

ID number (1 to 31)

A+03

Number of digits of bar code data (1 to 255)

A+04

1st digit of read data

A+05

2nd digit of read data

:

:

A+258

255th digit of read data

Note: These data areas accept up to 255 digits. However, the BL series can read only 32 digits. Therefore, all of the areas for 255 digits are not used for the N-400. Only the areas corresponding to the number of the data digits are used.

Example: When the BL series with ID No. 12 reads bar code data as “KE12”: A + 02

6

ID number

12

Number of digits

A + 03

4

A + 04

$004B

"K"

A + 05

$0045

"E"

A + 06

$0031

"E"

A + 07

$0032

"2"

Specified by ASCII codes (hexadecimal numbers)

Example: When a read error (ERROR) occurs in the BL series with ID No. 4:

112

A + 02

4

ID number

A + 03

5

Number of digits

A + 04

$0045

"E"

A + 05

$0052

"R"

A + 06

$0052

"R"

A + 07

$004F

"O"

A + 08

$0052

"R"

Specified by ASCII codes (hexadecimal numbers)