The text of a manual · part 14 of 15
N-400 User's Manual: Multi-Drop Controller for BL Series, pages 131 to 140
Pages 131 to 140 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 131
Appendices
BL-U1
Approx. 40
100 to 240 VAC (with 3-core plug)
90
98 110
ø6.5, Cable length: 2 m
91 max.
51
Appendices
4 x ø5 mounting hole 150 186
4
4
120°
123
Page 132
Appendices
Appendix C
Sample Programs
Sample programs for multi-drop link The following program (QBASIC) is an example of a serial communication program for multi-drop link mode and multi-head mode. The bar code data read by the BL series, along with the transmitted command and response to the command can be displayed. Enter the commands using the keyboard and press the [Return] key to send the command. Set the N-400 as follows: • Header: None • Delimiter: [CR] • Handshaking protocol: No handshaking or PASS/RTRY protocol
Appendices
100 110 120 130 140 150 160 165 170 180 190 195 200 210 220 320 330 340 400 410 420 440 450 460 470 480 490 500 510 520 1000 1010 1020 1030 1040 1050 2000 2010 2020 2030 2040 2050 2060 2070 2080 2090
124
'***N-400 SAMPLE PROGRAM******************************** 'CLS 3 DAT$ = "": RD$ = "": CM$ = "" OPEN "COM1:9600,E,7,1,RS,CS,DS,CD" FOR RANDOM AS #1 '*BUFFCLR '***CLEARING BUFFER*************************** A = LOC(1) IF A <> 0 THEN R$ = INPUT$(1, #1): GOTO 140 ' '*MAIN '***MAIN ROUTINE********************************* A = LOC(1) K$ = INKEY$ WHILE K$ <> "E" IF K$ <> "" THEN GOSUB 410 IF A = 0 THEN 170 RD$ = INPUT$(1, #1) IF RD$ = CHR$(&HD) THEN GOSUB 1000: GOTO 170 DAT$ = DAT$ + RD$ GOTO 170 ' '*COMMAND :'***TRANSMITTING COMMAND********************* IF K$ = CHR$(&HD) THEN 470 CM$ = CM$ + K$ PRINT K$; RETURN '*SEND PRINT #1, CM$; CHR$(&HD); : 'TRANSMITTING COMMAND PRINT : PRINT CM$; " WAS SENT" CM$ = "" RETURN ' '*RECEIVE :'***RECEIVING******************************* LDAT$ = LEFT$(DAT$, 2) IF LDAT$ = "%P" THEN GOSUB 2000: RETURN IF LDAT$ = "%T" THEN GOSUB 3000: RETURN GOSUB 3000: RETURN ' '*DATA RECEIVE :'***RECEIVING DATA********************* MDAT$ = MID$(DAT$, 6, 4) IF MDAT$ = "OVER" THEN GOSUB 4000: RETURN MDAT$ = MID$(DAT$, 6, 2) IF MDAT$ = "NC" THEN GOSUB 5000: RETURN MDAT$ = MID$(DAT$, 6, 4) IF MDAT$ = "SERR" THEN GOSUB 6000: RETURN MDAT$ = MID$(DAT$, 6, 1) IF MDAT$ = "e" THEN GOSUB 7000: RETURN GOSUB 8000: RETURN
Page 133
2100 ' 3000 '*COMMAND RECEIVE:'***RECEIVING COMMAND**************** 3010 MDAT$ = MID$(DAT$, 6, 2) 3020 IF MDAT$ = "NC" THEN GOSUB 5000: RETURN 3030 MDAT$ = MID$(DAT$, 6, 4) 3040 IF MDAT$ = "SERR" THEN GOSUB 6000: RETURN 3050 GOSUB 9000: RETURN 3060 ' 4000 '*BUFFOVER :'***BUFFER OVER**************************** 4010 PRINT DAT$ 4020 PRINT "THE UNIT #"; MID$(DAT$, 3, 2); " OCCURS BUFFER OVER." 4030 DAT$ = "" 4040 RETURN 4050 ' 5000 '*NOCONNECT :'***CONNECTION ERROR********************** 5010 PRINT DAT$ 5020 PRINT "THE UNIT #"; MID$(DAT$, 3, 2); " IS NOT CONNECTED." 5030 DAT$ = "" 5040 RETURN 5050 ' 6000 '*SRLERR :'***COMMUNICATION ERROR********************** 6010 PRINT DAT$ 6020 PRINT "COMMUNICATION ERROR - PLEASE RETRY" 6030 DAT$ = "" 6040 RETURN 6050 ' 7000 '*EMPTY :'***NO DATA*********************************** 7010 PRINT DAT$ 7020 PRINT "THE UNIT #"; MID$(DAT$, 3, 2); " HAS NO DATA." 7030 DAT$ = "" 7040 RETURN 7050 ' 8000 '*BARCODE :'***DISPLAYING READ DATA******************** 8010 PRINT DAT$ 8020 PRINT "THE UNIT #"; MID$(DAT$, 3, 2); " READS THE DATA AS"; MID$(DAT$, 6) 8030 DAT$ = "" 8040 RETURN 8050 ' 9000 '*RESPONSE :'***DISPLAYING RESPONSE******************** 9010 PRINT DAT$; " WAS RETURNED." 9020 DAT$ = "" 9030 RETURN 9040 WEND 9050 CLOSE #1 9060 END
Note: This sample program is shown for your reference only. Please note that this may not work correctly depending on the version of BASIC you use.
125
Appendices
Appendices
Page 134
Appendices
Sample program for PLC link The following is an example of a PLC link program for multi-drop link mode. Data is stored in the following areas. Process the data using the program as desired. • ID 1: D103 (DM103) and subsequent areas • ID 2: D203 (DM203) and subsequent areas • ID 3: D303 (DM303) and subsequent areas You can use this program based on the following conditions: ● Number of connected BL series: 3 ● N-400’s settings • Mode: Multi-drop link • Using PLC trigger area: Enable
Appendices
● Data memory flag: Sequential processing
126
Page 135
Appendices
Program for the MELSEC-A Series
M9038 M0V
K100
D0
M0V
K200
D1
M0V
K300
D2
M0V
K2
D100
M0V
K2
D200
M0V
K2
D300
M0V
K1
D31
Specify the head address of the data memory area for each ID number.
Specify the data memory flag for each ID number as “2”. (To use the flag, select “Sequential processing”.)
X0 X0 M0V
K0
D31
M0V
K1
D32
M0V
K0
D32
M0V
K1
D33
M0V
K0
D33
Enter “X0” for the reading trigger input of ID No. 1.
X1 X1
Enter “X1” for the reading trigger input of ID No. 2.
X2
LD=
D100
K3
[Data stored in D103 and subsequent areas is processed.]
M0V LD=
D200
K3
D300
K3
D100
[Data stored in D203 and subsequent areas is processed.]
M0V LD=
K2
K2
D200
[Data stored in D303 and subsequent areas is processed.]
M0V
K2
D300
Enter “X2” for the reading trigger input of ID No. 3.
When D100 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in D100. When D200 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in D200.
When D300 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in D300.
END
127
Appendices
X2
Page 136
Appendices
Program for the SYSMAC-C series
M9038
MOV #0064 DM0000 MOV #0008 DM0001
Specify the head address of the data memory area for each ID number. The N-400 processes data as binary data. Specify each DM number in binary format.
MOV #012C DM0002
BCD
Binary
100
64
200
C8
MOV #0002 DM0100
300
12C
MOV #0002 DM0200
Specify the data memory flag for each ID number as “2”. (To use the flag, select “Sequential processing”.)
Appendices
MOV #0002 DM0300 0000
MOV #0001 DM0031
0000
MOV #0000 DM0031
0001
MOV #0001 DM0032
0002
MOV #0000 DM0032
0002
MOV #0001 DM0033
0002
MOV #0000 DM0033
25313
MOV #0100 DM0003
25506
[Data stored in D103 and subsequent areas is processed.]
MOV #0002 DM0100
128
Enter “0000” for the reading trigger input of ID No. 1.
Enter “0001” for the reading trigger input of ID No. 2.
Enter “0002” for the reading trigger input of ID No. 3.
When DM0100 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in DM0100.
Page 137
Appendices
25313
CMP DM0200 #0003
25506
[Data stored in DM0203 and subsequent areas is processed.]
When DM0200 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in DM0200.
MOV #0002 DM0200
25506
CMP DM0300 #0003 [Data stored in DM0303 and subsequent areas is processed.]
When DM0300 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in DM0300.
MOV #0002 DM0300
END
Appendices
25313
129
Page 138
Appendices
Program for the KV series
2008
0000 0000 0001 0001 0002 0002 2002
#0100 DW DM0000 #0002 DW DM0100 #0001 DW DM0031 #0000 DW DM0031 #0100 DW DM0032 #0000 DW DM0032 #0001 DW DM0033 #0000 DW DM0033 #0100 LDA
#0200 DW DM0001 #0002 DW DM0200
#0300 DW DM0002 #0002 DW DM0300
Enter “0001” for the reading trigger input of ID No. 2.
Enter “0002” for the reading trigger input of ID No. 3.
#0003 CMP
[Data stored in DM0103 and subsequent areas is processed.]
2002
Appendices
2010
2002 2010
When DM0200 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in DM0200.
#0003 CMP
[Data stored in DM0303 and subsequent areas is processed.]
#0002 DW DM0300 END
ENDH
130
When DM0100 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in DM0100.
#0003 CMP
[Data stored in DM0203 and subsequent areas is processed.]
#0002 DW DM0200 DM0300 LDA
Specify the data memory flag for each ID number as “2”. (To use the flag, select “Sequential processing”.) Enter “0000” for the reading trigger input of ID No. 1.
2010
#0002 DW DM0100 DM0200 LDA
Specify the head address of the data memory area for each ID number.
When DM0300 becomes “3”, the specified processing is performed. After processing is completed, enter “2” in DM0300.
Page 139
Appendices
Troubleshooting If an abnormal condition occurs while operating this unit, check the following points. If you cannot solve the problem, contact KEYENCE.
Communication is unsuccessful. 1) Check communication between the N-400 and each BL series using the N400’s connection test mode. If communication is unsuccessful, check the following points: 1 Check if the power switches of the N-400 and all BL series are ON. 2 Check if the RS-485 communication parameters (baud rate, data length, parity and stop bit length) for the BL series are the same as the N-400’s settings. 3 Check if the BL series is set to multi-drop link mode. 4 Check if the same ID number is assigned to different BL series. 5 Check if the specified cable is used for the multi-drop link connection, the cable extension is within the specified distance (1.2 km), and the number of connected BL series is within the specified range (thirty one). 6 Check if the multi-drop link connection is not passed through the terminal block or not branched. (➮ See pp. 20 and 25.) 7 Check if the terminators are correctly set in the multi-drop link connection. (➮ See pp. 20 and 25.)
2) Check the communication between the N-400 and the host computer for the following points: 1 Check if the communication parameters (baud rate, data length, parity and stop bit length) for the host computer are the same as the N-400’s settings. 2 Check if the N-400’s handshaking protocol is set as desired. Normally, the handshaking protocol is set to “No handshaking”.
131
Appendices
Appendix D
Page 140
Appendices 3) Check the N-400’s settings for the following points: 1 Check if the ID numbers of all connected BL series have been registered on the “ID SETUP” screen of the N-400 setup software. 2 To use multi-head mode, check the following points in addition to the above. i) Check if the BL series is set to “Single label” reading mode. ii) Check if the BL series’ trigger input signal type is set to “Level”. iii) Check if the BL series’ read error code setting is the same as the N-400. iv) Check if the BL series’ reading start/end commands are the same as the N400’s settings.
“PLC link error” occurs. (The N-400 displays “95” or “96”.)
➮ For details, see p. 116.
“BUFFER OVERFLOW” error occurs with the BL series. (The BL series sends back the “OVER” code.)
Appendices
➮ For details, see p. 64.
132