Communication Manual PDF
Communication Manual PDF
Foreword
This manual contains text, diagrams and explanations which will guide the reader in the cor-
rect installation and operation of the communication facilities of FX series. It should be read
and understood befre attempting to install or use the communication facilities of FX series.
If in doubt at any stage of the installation of the communication facilities of FX series always
consult a professional electrical engineer who is qualified and trained to the local and
national standards which apply to the installation site.
If in doubt about the operation or use of the communication facilities of FX series please
consult the nearest Mitsubisi Electric distributor.
FX COMMUNICATION
(RS-232C, RS-485)
USERS MANUAL
Brand and product names describeed by/in this manual are trademarks or registered trade-
marks of the irrespective owners.
i
FX communication
ii
FX communication
FAX BACK
Mitsubishi has a world wide reputation for its efforts in continually developing and pushing
back the frontiers of industrial automation. What is sometimes overlooked by the user is the
care and attention to detail that is taken with the documentation. However,to continue this pro-
cess of improvement, the comments of the Mitsubishi users are always welcomed. This page
has been designed for you,the reader,to fill in your comments and fax them back to us. We
look forward to hearing from you.
What condition did the manual arrive in? Good Minor damage Unusable
Will you be using a folder to store the manual? Yes No
What do you think to the manual presentation?Tidy Un-friendly
Are the explanations understandable? Yes Not too bad Unusable
Which explanation was most difficult to understand: ..................................................................
....................................................................................................................................................
Are there any diagrams which are not clear? Yes No
If so,which: ..................................................................................................................................
What do you think to the manual layout? Good Not too bad Un-helpful
If there one thing you would like to see improved,what is it? ......................................................
....................................................................................................................................................
....................................................................................................................................................
Could you find the information you required easily using the index and/or the contents,if possi-
ble please identify your experience:............................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
Do you have any comments in general about the Mitsubishi manuals? .....................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
Thank you for taking the time to fill out this questionnaire. We hope you found both the product
and this manual easy to use.
iii
FX communication
iv
FX communication
Guidelines for the Safety of the User and Protection of the programmable con-
trollers
This manual provides information for the use of the FX series communication unit. The manual
has been written to be used by trained and competent personnel. The definition of such a per-
son or persons is as follows;
a) Any engineer who is responsible for the planning, design and construction of automatic
equipment using the product associated with this manual should be of a competent
nature, trained and qualified to the local and national standards required to fulfill that
role. These engineers should be fully aware of all aspects of safety with regards to auto-
mated equipment.
b) Any commissioning or service engineer must be of a competent nature, trained and qual-
ified to the local and national standards required to fulfill that job. These engineers
should also be trained in the use and maintenance of the completed product. This
includes being completely familiar with all associated documentation for the said prod-
uct. All maintenance should be carried out in accordance with established safety prac-
tices.
c) All operators of the completed equipment should be trained to use that product in a safe
and coordinated manner in compliance to established safety practices. The operators
should also be familiar with documentation which is connected with the actual operation
of the completed equipment.
Note : Note: the term completed equipment refers to a third party constructed device which
contains or uses the product associated with this manual.
Notes on the Symbols Used in this Manual
At various times through out this manual certain symbols will be used to highlight points of
information which are intended to ensure the users personal safety and protect the integrity of
equipment. Whenever any of the following symbols are encountered its associated note must
be read and understood. Each of the symbols used will now be listed with a brief description of
its meaning.
Hardware Warnings
1) Indicates that the identified danger WILL cause physical and property damage.
2) Indicates that the identified danger could POSSIBLY cause physical and property
damage.
Software Warnings
4) Indicates special care must be taken when using this element of software.
5) Indicates a special point which the user of the associate software element should
be aware of.
v
FX communication
Under no circumstances will Mitsubishi Electric be liable responsible for any consequential
damage that may arise as a result of the installation or use of this equipment.
All examples and diagrams shown in this manual are intended only as an aid to understand-
ing the text, not to guarantee operation. Mitsubishi Electric will accept no responsibility for
actual use of the product based on these illustrative examples.
Owing to the very great variety in possible application of this equipment, you must satisfy
yourself as to its suitability for your specific application.
vi
FX communication
Table of Contents
vii
FX communication
viii
FX communication
8. Commands.............................................................................................. 8-1
8.1 Batch Read of Bit Device (BR command)..............................................................8-2
8.2 Batch Read of Word Device (WR command) ........................................................8-3
8.3 Batch Write of Bit Device (BW command) .............................................................8-5
8.4 Batch Write of Word Device (WW command)........................................................8-6
8.5 Test of Bit Device (BT command)..........................................................................8-8
8.6 Test of Word Device (WT command) ....................................................................8-9
8.7 Remote RUN/STOP (RR, RS commands) ..........................................................8-10
8.7.1 Operation of Remote RUN/STOP ........................................................................................... 8-10
8.7.2 Conditions for Valid Execution of Remote RUN/STOP........................................................... 8-10
8.7.3 Control Specification and Examples of Remote RUN/STOP .................................................. 8-11
8.8 Reading The Programmable Controller Type (PC command).............................8-12
8.8.1 Type Codes ............................................................................................................................ 8-12
8.8.2 Control Specification and Example ......................................................................................... 8-13
8.9 Global Function (GW command) .........................................................................8-14
8.9.1 Control Specification and Example of Global Function........................................................... 8-14
8.10 On-demand Function .........................................................................................8-15
8.10.1 Special Devices Used in On-demand Function .................................................................... 8-15
8.10.2 On-demand Control Protocol ................................................................................................ 8-16
8.10.3 Specification and Example of On-demand............................................................................ 8-18
8.11 Loopback Test ...................................................................................................8-21
ix
FX communication
9. RS instruction.......................................................................................... 9-1
9.1 Function and Operation .........................................................................................9-1
9.1.1 Send and Receive Program...................................................................................................... 9-1
9.1.2 Operation of RS Instruction....................................................................................................... 9-2
9.1.3 Related Flags and Data Registers ............................................................................................ 9-3
9.2 Hardware Hand Shake Operation..........................................................................9-5
9.2.1 FX, FX2C, FX0N, FX1S, FX1N and FX2N (earlier than V 2.00).................................................... 9-5
9.2.2 FX2N, FX2NC (V 2.00 or later) ................................................................................................... 9-9
9.3 Number of Communication Data .........................................................................9-12
9.3.1 Deal with 16 bits Data ............................................................................................................. 9-12
9.3.2 Deal with 8 bits Data ............................................................................................................... 9-13
9.4 Example Program ................................................................................................9-14
9.4.1 Personal Computer ................................................................................................................. 9-14
9.4.2 Printer ..................................................................................................................................... 9-16
9.5 Supporting RS Instruction and Programming Protocol ........................................9-18
9.5.1 Programmable Controller and Version.................................................................................... 9-18
9.5.2 Operating Conditions and Format Set Content....................................................................... 9-18
x
FX communication
Appendix A:
Further Information Manual List ........................................................................... A-1
Appendix B:
ASCII code Lists................................................................................................... B-1
xi
FX communication
xii
FX Series Programmable Controllers Introduction 1
1 Introduction 1
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
1. Introduction
1
1-1
FX communication Introduction 1
When not using FX2N-485-BD or FX1N-485-BD in the system, total extension distance Max. 500m.
(Use : Max. 50m)
Total station of this network is Max. 8 stations.
*2 When including FX1N-485-BD in system configuration, total extension distance max 50m.
3 ) FX1S (Shielded twisted-pair cable)
1-2
FX communication Introduction 1
Note;
Parallel link is possible between the same series PLCs, or between other series in the
same group. However, parallel link between each group cannot be achieved.
Groups are separated as follows.
Group No. Series
Group 1 FX2N, FX2NC
Group 2 FX1N
Group 3 FX1S
Group 4 FX0N
Group 5 FX, FX2C
Computer
RS232C
RS485(422)
FX-485PC-IF FX2,
FX2C
FX0N-485ADP
FX0N, FX2NC, FX-485ADP FX2N + FX2N-485-BD, A series PLC + A(1S)J71UC24
FX2N + FX2N-CNV-BD, FX1S + FX1N-485-BD,
FX1S + FX1N-CNV-BD, FX1N + FX1N-485-BD
FX1N + FX1N-CNV-BD
When not using FX2N-485-BD or FX1N-485-BD in the system, total extension distance is
Max. 500m. (Use : Max. 50m)
Total station of this network is Max. 16 stations.
2 ) Use RS232C
FX2N : FX2N-232-BD,
FX2N-CNV-BD + FX0N-232ADP
FX2NC, FX0N : FX0N-232ADP
Computer
FX1N, FX1S : FX1N-232-BD,
FX1N-CNV-BD + FX0N-232ADP
FX2, FX2C : FX-232ADP
1-3
FX communication Introduction 1
RS232C
Personal computer *3 *3 *3
FX2N + FX2N +
FX2N-CNV-BD FX2N-232-BD FX2NC
FX0N-232ADP FX0N-232ADP
*4 FX0N *4 FX1N + *4
FX1N + FX1N-232-BD
FX, FX2C FX1N-CNV-BD FX1S +
Max 15m *1 FX1S + FX1N-232-BD
FX1N-CNV-BD
Bar code reader FX-232ADP FX0N-232ADP
FX2N, FX1N,
FX2NC + FX2NC-CNV-IF
FX2N-232IF
RS485(422)
*4 *3
FX2N + FX2N-CNV-BD
Printer FX1N + FX1N-CNV-BD FX2N + FX2N-485-BD
FX1S + FX1N-CNV-BD
FX0N, FX2NC
*1 RS485/RS232C signal convertor becomes necessary for a case of RS485 interface for com-
puter connection.
*2 When using FX1N-485-BD, FX2N-485-BD in system, total extension distance max 50m.
But, RS485/RS232C signal convertor become necessary for a case of RS232C interface for
computer connection.
*3 This system configuration can achieve full-duplex communication or the half-duplex communi-
cation.
*4 This system configuration achieve only half-duplex communication.
1-4
FX Series Programmable Controllers Wiring 2
1 Introduction
2 Wiring 2
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
2. Wiring
For the terminal layout when using a communication unit, refer to the individual units manual.
2
2.1 Caution
2.1.1 Common
1 ) This system is designed to read and write data (forced on/off) while the programmable con-
troller is running.
If abnormal data is written into the programmable controller, due to effects of noise, the pro-
grammable controller may malfunction and cause machine trouble or an accident. There-
fore, observe the following cautions.
Do not lay signal cables near high voltage power cables or put them in the same trunking
duct.
Otherwise effects of noise or surge induction are likely to take place. Keep a safe dis-
tance of more than 100 mm from these wires.
Ground the shield wire or shield of a shielded cable at one point on the programmable
controller. Do not, however, ground at the same point as high voltage lines.
2 ) Cut off phases of power source externally, before installation or wiring work in order to avoid
electric shock or damage of product.
3 ) Replace the provided terminal cover before supplying power and operating the unit after
installation or wiring work in order to avoid electric shock.
2.1.2 FX2N-485-BD
To connect the RS485(422) unit, use a shielded twist-pair cable. The cable model must be
AWG 26 to 16, and the maximum tightening torque must be 0.6 Nm (6 kgfcm). If a cable other
than the AWG 26 to 16 is used, normal communication cannot be assured because the termi-
nal may be imperfectly contacted. It is recommended to insert a cable integrated by a crimping
tool into the terminal.
6mm
2-1
FX communication Wiring 2
2.1.3 FX0N-485ADP
1 ) The terminal screws of the FX(0N)-485ADP are M3 screws and therefore the crimp style ter-
minal (see drawing) suitable for use with these screws should be fitted to the cable for wir-
ing.
For M3 For M3
6.2mm 6.2mm
(0.24 inches) (0.24 inches)
or less or less
2 ) The terminal tightening torque is 0.5 to 0.8 Nm(5 to 8 kgfcm), tighten securely to avoid
malfunction.
2.1.4 FX2-40AW
1 ) The terminal screws for the terminal block of the FX2-40AW are M3.5 screws and therefore
the crimp style terminal (see drawing) suitable for use with these screws should be fitted to
the cable for wiring.
For M3.5 For M3.5
6.8mm 6.8mm
(0.27 inches) (0.27 inches)
or less or less
2 ) The terminal tightening torque is 0.5 to 0.8 Nm (5 to 8 kgfcm), tighten securely to avoid mal-
function.
2-2
FX communication Wiring 2
Note;
When using ER and DR signals, please also check if RS and CS signals are needed according to
the RS232C device specifications.
Note;
The FX0N-232ADP does not monitor the CD pin (pin8).
3 ) Computer link
Please refer to 2.2.1 1) for wiring.
2-3
FX communication Wiring 2
2-4
FX communication Wiring 2
2-5
FX communication Wiring 2
2-6
FX communication Wiring 2
R*1 R*1
SDA SDA SDA SDA
2
SDB SDB SDB SDB
R*1 R*1
RDA RDA RDA RDA
*1 R is the terminating resistor. Connect the terminating resistor (110) between terminals SDA
and SDB.
*2 Connect the shield of the FX2N-485-BD, FX1N-485-BD using shielded twist-pair cable to
ground (100 or less).
Please adjust the grounding only to one side.
*3 Connect terminal FG to each terminal of the programmable controller body, grounded with
resistance of 100 or less. However, for the computer link unit of the A series programmable
controller, see the manual of the computer link unit.
*4 If an RS485/232 adapter is required, please use the FX-485-PC-IF. When using the FX-
485PC-IF with this wiring method, either take account for or ignore the echo of the com-
mands sent by the computer.
2-7
FX communication Wiring 2
R*1 R*1
SDA SDA SDA SDA
*1 R is the terminating resistor. Connect the terminating resistor (330) between terminals SDA
and SDB, and terminals RDA and RDB.
*2 Connect the shield of FX2N-485-BD, FX1N-485-BD using shielded twist-pair cable to ground
(100 or less).
Please adjust the grounding only to one side.
*3 Connect terminal FG to each terminal of the programmable controller main body grounded
with resistance of 100 or less. However, as for the computer link unit of the A series pro-
grammable controller, see the manual of the computer link unit.
*4 When using RS232/485 or RS232/422 adapter, please the adapter use FX-485PC-IF.
2-8
FX communication Wiring 2
SDB SDB
RDA RDA
T erm inating T erm inating
resistance registance
110 RDB RDB 110
LIN K
SG
SG
F G *1
2 ) Two-pair Wiring
F X 2N -485-B D
F X 0N -485A D P
F X 1N -485-B D
SDA SDA
SDB SDB
RDA RDA
T erm inating T erm inating
resistance registance
330 RDB RDB 330
LIN K
SG
SG
F G *2
2-9
FX communication Wiring 2
F X 0N -485A D P F X 0N -485A D P
SDA SDA
SDB SDB
RDA RDA
T erm inating T erm inating
resistance registance
110 RDB RDB 110
LIN K LIN K
SG SG
FG F G *1
2 ) Two-pair Wiring
F X 0N -485A D P F X 0N -485A D P
SDA SDA
SDB SDB
RDA RDA
T erm inating T erm inating
resistance registance
330 RDB RDB 330
LIN K LIN K
SG SG
FG F G *2
2-10
FX communication Wiring 2
RDA RDA
T erm inating T erm inating
resistance registance
110 RDB RDB 110
SG SG
2 ) Two-pair Wiring
F X 2N -485-B D F X 2N -485-B D
F X 1N -485-B D F X 1N -485-B D
SDA SDA
SDB SDB
RDA RDA
T erm inating T erm inating
resistance registance
330 RDB RDB 330
SG SG
2-11
FX communication Wiring 2
2.4.5 FX2-40AP
FX2-40AP FX2-40AP
T R
R T
Optical glassfiber
cable
Note;
Keep optical fibers away from wire cables carrying high loads.
Including where the cables are terminated.
2-12
FX Series Programmable Controllers Specifications 3
1 Introduction
2 Wiring
3 Specifications 3
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
3. Specifications
3-1
FX communication Specification 3
Note;
If N:N network is used, the scan time of each station programmable controller
becomes about 10 percent longer regardless of the number of link station or using
communication device pattern.
3-2
FX communication Specifications 3
Note;
Please refer to following table for the relation between reading word points and communication
time.
Message time = 0ms, Maximum scan time = 20ms, Dedicated protocol format = format 1,
Command = WR, Baud rate = 9,600 or 19,200 bps
Baud rate (bps)
Reading word points
9,600 19,200
10 0.3 s 0.2 s
32 0.4 s 0.3 s
64 0.5 s 0.4 s
3-3
FX communication Specification 3
MEMO
3-4
FX Series Programmable Controllers N:N network 4
1 Introduction
2 Wiring
3 Specifications
4 N:N network 4
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
4. N:N Network
For diagnostics, please refer to chapter 12.
Auxiliary relays
Response
Attribute FX0N, FX1N, FX2N, Name Description
type
FX1S FX2NC 4
N:N network Used to set N:N network
R M8038 M, L
parameter setting parameters
Communication error of When communication error is
R M504 M8183 L
master station in master station, this is ON. *1
M505 to M8184 to Communication error of When communication error is
R M, L
M511 *2 M8190 *2 slave station in slave station, this is ON. *1
When communicate to other
R M503 M8191 Data communication M, L
station, this is ON.
Note;
Devices M503 to M511 in the FX0N and FX1S cannot be applied for other usage in the
user program. These devices are used by the N:N network.
4-1
FX communication N:N network 4
Auxiliary relays
Response
Attribute FX0N, FX1N, FX2N, Name Description
type
FX1S FX2NC
R D8173 Station No. Saves its own station No. M, L
Total number of slave Saves total number of
R D8174 M, L
stations slave stations
R D8175 Refresh range Saves refresh range M, L
W D8176 Station number setting Sets its own station No. M, L
Total slave station number Sets total number of
W D8177 M
setting slave stations
W D8178 Refresh range setting Sets refresh range M
W/R D8179 Retry count setting Sets retry count M
W/R D8180 Comms time-out setting Sets comms time-out M
Saves current network
R D201 D8201 Current network scan time M, L
scan time
Maximum network scan Saves maximum network
R D202 D8202 M, L
time scan time
Number of communica-
Number of communication
R D203 D8203 tion error at master sta- L
error at master station
tion *1
Number of communica-
D204 to D8204 to Number of communication
R tion error at slave station M, L
D210 *2 D8210 *3 error at slave station
*1
Code of communication Code of communication
R D211 D8211 L
error at master station error at master station *1
D212 to D8212 to Code of communication Code of communication
R M, L
D218 *2 D8218 *3 error at slave station error at slave station *1
D219 to
D255
Not used For internal processing
Note;
Devices M503-M511 and D201-D255 in the FX0N and FX1S cannot be applied for other
usage in the user program. These devices are used by the N:N network.
4-2
FX communication N:N network 4
4.2 Setting
Each settings for the N:N network become valid when the program is run or when the power of
the programmable controller is turned on.
4-3
FX communication N:N network 4
Refresh range
Communication Pattern 0
device Pattern 1 Pattern 2
(FX0N, FX1S, FX1N,
(FX1N, FX2N, FX2NC) (FX1N, FX2N, FX2NC)
FX2N, FX2NC)
Bit device (M) 0 point 32 points 64 points
Word device (D) 4 points 4 points 8 points
Note;
Please set the refresh range to pattern 0. When setting it other than pattern 0, all FX0N
and FX1S series units in the system experience a communications error.
In this case, please note that link time becomes long as the FX0N and FX1S communi-
cation error is occurring.
Device No.
Station No. Bit device (M) Word device (D)
0 point 4 points
No.0 D0 to D3
No.1 D10 to D13
No.2 D20 to D23
No.3 D30 to D33
No.4 D40 to D43
No.5 D50 to D53
No,6 D60 to D63
No.7 D70 to D73
4-4
FX communication N:N network 4
Device No.
Station No. Bit device (M) Word device (D)
32 points 4 points
No.0 M1000 to M1031 D0 to D3
No.1 M1064 to M1095 D10 to D13
No.2 M1128 to M1159 D20 to D23
No.3 M1192 to M1223 D30 to D33
No.4 M1256 to M1287 D40 to D43
No.5 M1320 to M1351 D50 to D53
No,6 M1384 to M1415 D60 to D63 4
No.7 M1448 to M1479 D70 to D73
Device No.
Station No. Bit device (M) Word device (D)
64 points 8 points
No.0 M1000 to M1063 D0 to D7
No.1 M1064 to M1127 D10 to D17
No.2 M1128 to M1191 D20 to D27
No.3 M1192 to M1255 D30 to D37
No.4 M1256 to M1319 D40 to D47
No.5 M1320 to M1383 D50 to D57
No,6 M1384 to M1447 D60 to D67
No.7 M1448 to M1511 D70 to D77
4-5
FX communication N:N network 4
Make sure to write the program above from step 0 as the N:N network parameter setting program.
This program does not require to be executed, because it becomes effective automatically when it
is programmed in this position.
Note;
Setting of the parameters for the N:N network is started at step 0 (LD M8038), and fin-
ished when any instruction or device other than the program above is processed.
4-6
FX communication N:N network 4
FX 2N FX 2N
4.3.2 Operations
The following operations are performed in the system configuration above.
1 ) The input points X000 to X003 (M1000 to M1003) in the master station are output to the out-
put points Y010 to Y013 in the stations Nos.1 and 2.
2 ) The input points X000 to X003 (M1064 to M1067) in the station No.1 are output to the output
points Y014 to Y017 in the master station and the station No.2.
3 ) The input points X000 to X003 (M1128 to M1131) in the station No.2 are output to the output
points Y020 to Y023 in the master station and the station No.1.
4 ) The data register D1 in the master station is specified as the set value of the counter C1 in
the station No.1.
The contact (M1070) status of the counter C1 is reflected on the output point Y005 in the
master station.
5 ) The data register D2 in the master station is specified as the set value of the counter C2 in
the station No.2.
The contact (M1140) status of the counter C2 is reflected on the output point Y006 in the
master station.
6 ) The value of the data register D10 in the station No.1 and the value of the data register D20
in the station No.2 are added in the master station, and saved to the data register D3.
7 ) The value of the data register D10 in the master station and the value of the data register
D20 in the station No.2 are added in the station No.1, and saved to the data register D11.
8 ) The value of the data register D10 in the master station and the value of the data register
D10 in the station No.1 are added in the station No.2, and saved to the data register D21.
4-7
FX communication N:N network 4
Data communication
M8191
Y003
* A station cannot recognise its own error. An error program for each station is not necessary.
4-8
FX communication N:N network 4
RUN monitor
M8000
MOV K1X000 K1M1000 Operation 1)
Slave 1
communication error
M8184
MOV K1M1064 K1Y014 Operation 2)
Slave 2
communication error
M8185
MOV K1M1128 K1Y020 Operation 3) 4
Slave 1
communication error
M8184
MOV K 10 D 1
Slave 2
communication error
M8185
MOV K 10 D 2
END
4-9
FX communication N:N network 4
Counter input
X000
C1
D1
C1 Operation 4)
Y005
M1070
Slave 2 Contact of
communication slave 2 C2
error device
M8185 M1140
Y006 Operation 5)
Slave 2
communication
error
M8185
ADD D 0 D 20 D 11 Operation 7)
END
4-10
FX communication N:N network 4
Counter reset
X001
RST C 2
Master
communication
error
M8183
MOV K1M1000 K1Y010 Operation 1)
Slave 1
communication
error
M8184
MOV K1M1064 K1Y014 Operation 2)
4
Counter input
X000
C2
D2
C2
Y006 Operation 5)
M1140
END
4-11
FX communication N:N network 4
MEMO
4-12
FX Series Programmable Controllers Parallel link 5
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link 5
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
5. Parallel link
Data transfer with FX2N, FX2NC, FX1N, FX, FX2C programmable controllers can be performed on a
1:1 basis for 100 auxiliary relays and 10 data registers. Data transfer with FX 1S, FX0N program-
mable controller can be performed on a 1:1 basis for 50 auxiliary relays and 10 data registers.
For system configuration, refer to subsection 1.2.2.
5-1
FX communication Parallel link 5
5-2
FX communication Parallel link 5
Note; 5
Parallel link is possible between PLCs in the same series, or in other series as long as
they are in the group. However, parallel link between each different group cannot be
achieved.
Groups are separated as follows.
Group No. Series
Group 1 FX2N, FX2NC
Group 2 FX1N
Group 3 FX1S
Group 4 FX0N
Group 5 FX, FX2C
5-3
FX communication Parallel link 5
M8162 M8162
M8000
M8000 CMP D490 K100 M10
ADD D0 D2 D490 M10
X010 Y010
T0 X010
D500 MOV D10 D500
END END
Note;
In the normal mode, FNC 81 PRUN instruction can be used for .
However, This instruction is only supported FX, FX2C, FX2N, FX2NC.
5-4
FX Series Programmable Controllers Communication format (D8120) 6
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
6-1
FX communication Communication format 6
6-2
FX communication Communication format 6
6-3
FX communication Communication format 6
MEMO
6-4
FX Series Programmable Controllers Computer link 7
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link 7
9 RS instruction
10 FX2N-232IF
12 Diagnostics
7. Computer Link
This chapter explains the details and methods of specifying dedicated protocol used for linking of
the FX programmable controller and computer. The dedicated protocol is available in two types,
format 1and format 4 (the format names conform to the dedicated protocols used in the computer
link unit of the A series programmable controller).
In this chapter FX2N-232-BD, FX1N-232-BD, FX 0N-232ADP and FX-232ADP refer to 232ADP,
FX2N-485-BD, FX1N-485-BD, FX0N -485ADP and FX-485ADP refer to 485ADP, FX-485PC-IF
refer to 485PC-IF.
When interface of programmable controller using RS232, please after read 232ADP instead of
485ADP.
*OS (operating system) is the software for operating (or using) effectively the resources such as
the CPU, memory, terminal, file and network.
7-1
FX communication Computer link 7
*OS (operating system) is the software for operating (or using) effectively the resources such as
the CPU, memory, terminal, file and network.
7-2
FX communication Computer link 7
Caution;
When using RS485 wiring (one pair, see section 2.3.3) remember to take account of/or
ignore the echo of the commands sent from the computer.
7-3
FX communication Computer link 7
A C
E A
Computer N Data C Data
Q K
S
Programmable T Data
controller X
a ) Areas A and C indicate transmission from the computer to the programmable controller.
b ) Area B denotes transmission from the programmable controller to the computer.
c ) The computer program is created so that the data is transmitted in the order read from left
to right, and the protocol determines that the data is sent in the sequence A, B, C.
(Example: In area A, ENQ is transmitted followed by all other data, starting to the right, after
the ENQ.)
2 ) When writing data from the computer into the programmable controller
(computer programmable controller)
E
Computer N Data
Q
Programmable A
C Data
controller K
7-4
FX communication Computer link 7
Control code
Station No.
PC No.
Command
Message wait
Character 7
*1 Whether or not to add sum check code can be selected using the communication format spe-
cial data register D8120.
*2 Whether or not to add terminating CR + LF codes is determined by the protocol selected.
7-5
FX communication Computer link 7
PC No.
N A K
Station
No.
Transmission sequence
*
or
PC No.
Command
wait time
Message
PC No.
Character
E N Q
A C K
Station
Station
area A
check
code
Sum
No.
No.
To read data
Computer
from the pro-
grammable Programmable
PC No.
Character
Station
S T X
E T X
area B
check
code
Sum
controller to
No.
controller
the computer
or
*
PC No.
N A K
Station
Error
code
No.
*
No.
Station
PC No.
Command
wait time
Message
Character
E N Q
area C
check
code
Sum
Transmission sequence
ACK
Error code
NAK
1 ) Sum check code is used when the sum check flag is set Yes (b13=1 in special data register
D8120), and not used when set to No (b13=0).
2 ) When the sum check flag is set to Yes, the sum check is made on the characters in the aster-
Remarks isked area.
3 ) In the diagram, the contents of character area A, character area B, and character area C
depend on the individual system, but do not differ depending on the format of control protocol.
For details of each character area, see the link contents.
7-6
FX communication Computer link 7
L
PC No.
C
N A K
Station
No.
Transmission sequence
R
F
*
or
L
PC No.
Command
wait time
Message
PC No.
C
Character
E N Q
A C K
To read data
Station
Station
area A
check
code
Sum
No.
No.
from the pro-
R
F
F
grammable Computer
controller to Programmable
L
PC No.
C
Character
Station
S T X
E T X
area B
check
code
Sum
No.
the computer controller
R
F
or
*
L
PC No.
Error code
C
N A K
Station
No.
R
F
*
PC No.
Command
wait time
Message
code
check
Sum
C
L
Character
E N Q
Station
area C
No.
R
F
Transmission sequence
Station
ACK
puter to the
No.
controller
programma-
R
F
ble controller
or
PC No.
C
L
Station
NAK
Error
code
No.
R
F
1 ) Sum check code is used when the sum check flag is set Yes (b13=1 in special data register
D8120), and not used when set to No (b13=0).
2 ) When the sum check flag is set to Yes, the sum check is made on the characters in the aster-
Remarks isked area.
3 ) In the diagram, the contents of character area A, character area B, and character area C
depend on the individual system, but do not differ depending on the format of control protocol.
For details of each character area, see the link contents.
7-7
FX communication Computer link 7
Code Code
Signal Description Signal Description
(Hexadecimal) (Hexadecimal)
STX 02H Start of Text LF 0AH Line Feed
ETX 03H End of Text CL 0CH Clear
EOT 04H End of Transmission CR 0DH Carriage Return
ENQ 05H Enquiry NAK 15H Not Acknowledge
ACK 06H Acknowledge
a ) The programmable controller initializes the transmission sequence when receiving any
one of ENQ, ACK, NAK, and starts.
b ) When EOT, or CL code is received as follows, the programmable controller initializes the
transmission sequence. At this time, no response is made from the programmable con-
troller.
Format 1 Format 4
E E C L
O O
T T R F
or or
C C C L
Computer L
Computer L R F
Programmable Programmable
controller controller
7-8
FX communication Computer link 7
2 ) Station number
The station number is the number provided at the programmable controller in order to deter-
mine which programmable controller the computer accesses. In the FX series programmable
controller, the station number is set by the special data register D8121(special D8121 herein-
after). The setting range is 00H to 0FH. In the case of FX0N series turn on M8120 when using
the special D8121. For the setting method of an A series programmable controller, see the A
series manual.
Computer
FX FX FX FX
series series series series
The following instructions can be used to set the station number of station 0 in the above system.
M8002
MOV H0 D8121
Notes
7
1 ) When setting station numbers, don't set the same number at more than 1 station.
Otherwise, transmission data may become confused and communication irregular.
2 ) Station numbers need not be set in numerical order, but are free to be set within the spec-
ified range(00H to 0FH). For example, setting in a random order or skipping numbers is
acceptable.
3 ) PC number
The PC number is the number identifying the programmable controller CPU on the A
series MELSECNET(II) or MELSECNET/B.
Accordingly, the PC number for an FX series programmable controller is FFH, and is rep-
resented as two ASCII characters; i.e. FF. When using the on-demand function the PC
number is automatically converted to FFH by the programmable controller.
For the PC number of programmable controller CPU on the MELSECNET(II), MELSEC-
NET/B see the computer link manual for A series programmable controllers.
4 ) Command
Used to specify the operation required, e.g. read, write, etc. Commands are defined using
two ASCII characters.
For a description of the available commands, see section 7.7.1.
7-9
FX communication Computer link 7
5 ) Message wait
This is a delay time required by some computers to switch between send and receive states.
The message wait time determines the minimum delay before the programmable controller
sends data after receiving a message from the computer. Set the wait time according to the
computer specifications.
The message wait time may be set between 0 to 150 ms in 10 ms increments. The value is
set using a single ASCII character (0 to F) representing 0H to FH (0 to 15).
When using the 485PC-IF in a 1:n system always set the message to be 70 ms or longer (7
or more). If scan time of programmable controller is 70 ms or more on the network, message
wait time need to set maximum scan time or more.
Example: Setting the message wait time
Message wait (100 ms)
"A"
Computer
Programmable
controller
Transmission starts more than 100 ms later. Wait time must be longer than two-scan time.
7-10
FX communication Computer link 7
It must be noted that the time-out check time is not updated until the next character is received,
and hence must be set to at least more than the time necessary to receive one character at the 7
baud rate (transmission speed) in use. When 1 character = 12 bits, the minimum setting of time-
out check time is as follows.
Baud rate (bps) Time to receive one character (ms) Time-out check time (set value)
300 40 50ms (5)
600 20 30ms (3)
1200 10 20ms (2)
2400 5 10ms (1)
4800 2.5 10ms (1)
9600 1.25 10ms (1)
19200 0.625 10ms (1)
7-11
FX communication Computer link 7
ENQ
ACK
Computer
Wait(TW) T3 T4 T5
Interface
STX
More than two-scan
Read process delay is needed.
This time becomes 0 when the message wait time is not set or
when the wait time is less than the processing time needed by
Programmable the programmable controller.
controller T0 T1 T2
Programmable
controller program
END Step 0 END Step 0 END Step 0 END
If the wait time has expired the response is sent at completion of the
END process, otherwise the wait time is checked again during the next
END process.
Computer
Wait(TW) T3
Interface
Writing data
Write process
This time becomes 0 when the message wait time is not set or
when the wait time is less than the processing time needed by
Programmable the programmable controller.
controller T0 T1 T2
Programmable
controller program
END Step 0 END Step 0 END Step 0 END
If the wait time has expired the response is sent at completion of the
END process, otherwise the wait time is checked again during the next
END process.
7-12
FX communication Computer link 7
T1 = max. 1 scan time (during RUN, message processing is done at END processing, a
maximum delay of 1 scan could occur depending on message timing; during STOP,
T1 is 1 ms)
T2 = END process time of programmable controller during data communication
T4 = A delay of at least 2 scans is required. However, using one-pair wiring on the 1:N
system configuration, this time need to set Time-out timer value (D8129) + 1 scan
time or more.
TW = set time when message wait is set.
7
2 ) When writing data from the computer to the programmable controller
Communication time = T0 + (T1 + T2 or TW, whichever is longer) + T3
T0, T3 = 1/baud rate number of bits in 1 character (1 + 7(8) + 0(1) + 1(2))
number of characters
T1 = max. 1 scan time (during RUN, message processing is done at END processing, a
maximum delay of 1 scan could occur depending on message timing; during STOP,
T1 is 1 ms)
T2 = END process time of programmable controller during data communication
TW = set time when message wait is set.
7-13
FX communication Computer link 7
05H 30H 30H 46H 46H 42H 52H 05H 30H 30H 46H 46H
Indicating M14 is ON
Indicating M13 is OFF
Indicating M12 is ON
A B 1 2 3 4 C D
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
1 0 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 0 1 1 0 1
M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
Lowest bit
Head device:
of 2nd word
Lowest bit of 1st word
1:Represents ON
0:Represents OFF
7-14
FX communication Computer link 7
5 6 A B 1 7 0 F
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 1 1 1 1
No.of
Head device
device
Data Data
7
points
C N 2 0 0 0 1 1 2 3 4 5 6 7 8
44H 30H 33H 35H 30H 30H 31H 31H 32H 33H 34H 35H 36H 37H 38H
1 2 3 4 5 6 7 8
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0
7-15
FX communication Computer link 7
7-16
FX communication Computer link 7
Notes
1 ) When using bit devices specified in word units (WR, WW, WT), the number of the
head device must be a multiple of 8 (or if an octal device end in 0) e.g. X30, M24.
2 ) The special auxiliary relays (M8000 to M8255) and special data registers (D8000
to D8255) can be read only, write only, and received for system use.
If an attempt is made to write outside the write enable range, an error may occur in
the programmable controller. Accordingly, for details of special auxiliary relays and
special data registers, see the programmable controller manual.
7-17
FX communication Computer link 7
Item Description
Communication Half-duplex communication
method method
Synchronizing Start-stop synchronization
method method
Baud rate 9600 bps
4
Start bit 1 bit
Data format
8
Data length 7 bit FX series
Personal 485 5
programmabl
Parity bit None computer PC-IF A
e controller
D
Stop bit 1 bit
P
Sum check Sum check is used
Station No. Station No.0
Exclusive protocol
Format 1
format
According to the above transmission specification, the transmission specification and trans-
mission procedure of the programmable controller are set as follows.
D8120 = H6080
D8121 = H0000 For setting and details, see chapter 6, and section 7.4.
D8129 = K0
2 ) Program example
10 T0 = 3000 : Reception wait counter (adjusted depending on computer speed)
20 STCNT = 14 : Normal data length
30 NACNT = 7 : Data length of error code (NAK statement)
40 ERFLG = 0
50 ENQ$ = CHR$(5) Transmission data
60 STX$ = CHR$(2)
70 ETX$ = CHR$(3) 00 FF TT 2 04 ABCD 34
80 NAK$ = CHR$(&H15)
: Data transmission
Station No.
PC No.
Command
Data wait
Number of characters
Character
90 *DATASEND
100 CLOSE #1
110 OPENCOM1:AS#1
120 SENDDATA$ = 00FFTT204ABCD34 : Transmission data
130 PRINT #1, ENQ$; SENDDATA$;
140 *REC0: Reception of first character
150 RVCNT = 1
160 GOSUB *RECWAIT
170 IF ERFLG = 99 THEN GOTO ERRORFIN1
180 BUF$ = RCV$
7-18
FX communication Computer link 7
7-19
FX communication Computer link 7
3 ) Operation
a ) Start the computer program.
b ) Send four characters ABCD from the computer to the FX programmable controller.
c ) The FX programmable controller returns the four characters ABCD back to the com-
puter.
d ) The computer compares the data received from the programmable controller and the orig-
inal sent data, and displays a result message.
4 ) List of result messages
Message Remedy
Received data is normal. Data sending and receiving is normal.
Data is not received at all or data content is Check again the writing, station No., transmission
insufficient. specification, and transmission protocol.
Error code 00H is received. Refer to error code list in chapter 12.
Received character is abnormal.
Check for faulty writing, observing writing cautions.
(0-th character)
7-20
FX Series Programmable Controllers Commands 8
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
8. Commands
This chapter describes the structure and gives examples for each command of the dedicate pro-
tocol.
See also Chapter 7 Communication using Dedicated Protocols.
The reference pages for command are given below.
TT Characters received from the computer are directly returned to the computer. 8.11
8-1
FX communication Commands 8
PC No.
wait time
Message
code
Sum check
No.
Station
PC No.
Head device Number of
"0" (30H) indicates OFF.
E N Q
A C K
devices
B R
"1" (31H) indicates ON.
(5 characters) (2 characters,
Computer hexadecimal)
Programmable
No.
Station
PC No.
code
Sum check
Data of
S T X
E T X
controller Specifies the range of the
specified
devices to be read. devices
Character area B
Notes
Specify the range and number of devices so as to satisfy the following conditions.
- 1 number of devices 256(54 for FX0N)(256 points are specified by 00H)
- Head device No. + number of devices -1 max. device No.
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Command example
To read five points of data from X040 to X044 at station No.5 (with message wait time set to
100 ms).
(Assuming that X040 and X043 are OFF and X41, X42 and X44 are ON)
E A
N 0 5 F F B R A X 0 0 4 0 0 5 4 7 The sum check is calculated C 0 5 F F
Q over this range K
Computer 05H 30H 35H 46H 46H 42H 52H 41H 58H 30H 30H 34H 30H 30H 35H 34H 37H 06H 30H 35H 46H 46H
Indicating X044 is ON
Indicating X043 is OFF
Indicating X042 is ON
Indicating X041 is ON
Indicating X040 is OFF
Notes
Message wait time can be specified from 0 to 150 ms in 10 ms increments, expressed
by 0H to FH (in hexadecimal).
Therefore, 100 ms is expressed as A.
8-2
FX communication Commands 8
PC No.
code
Sum check
No.
Station
PC No.
Head device Number of
Message
wait time
A C K
E N Q
devices
W R
expressed using four
(5 characters) (2 characters, characters.
Computer hexadecimal)
Programmable
No.
Station
PC No.
code
Sum check
Data of
S T X
E T X
controller Specifies the range of the
specified
devices to be read. devices
Character area B
Notes
Specify the range and number of devices (16 bit words) so as to satisfy the following
conditions.
- 1 number of devices 64 (32 words in the case of bit devices) (13 words for FX0N)
- Head device No. + number of devices (number of devices 16 in the case of bit
devices) -1 max. device No.
- When reading 32-bit devices (C200 to C255), the returned data is a double word.
Hence, the maximum number of devices is 32.
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Command examples
a ) Example 1
8
To read 32 points of data from X040 to X077 at station No.5 (with message wait time set
to 100 ms).
E A
N 0 5 F F W R 0 X 0 0 4 0 0 2 4 8 The sum check is calculated C 0 5 F F
Q over this range K
Computer 05H 30H 35H 46H 46H 57H 52H 30H 58H 30H 30H 34H 30H 30H 32H 34H 38H 06H 30H 35H 46H 46H
Programmable S E
controller The sum check is calculated T 0 5 F F 1 2 3 4 A B C D T 0 8
over this range X X
02H 30H 35H 46H 46H 31H 32H 33H 34H 41H 42H 43H 44H 03H 30H 38H
1 2 3 4 A B C D
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1
X X X X X X X X X X X X X X X X X X
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5 5 5 5 4 4 4 4 4 7 7 7 7 6 6 6 6 6
7 2 1 0 7 3 2 1 0 7 2 1 0 7 3 2 1 0
Notes
Command WR uses word units. When reading 32 points, the number of devices is
specified by 02 (16 points(bits) per one word unit).
8-3
FX communication Commands 8
b ) Example 2
To read the present value of two points, T123 and T124, at station No.5.
E A
N 0 5 F F W R 0 T N 1 2 3 0 2 6 4 The sum check is calculated over C 0 5 F F
Q this range K
Computer 05H 30H 35H 46H 46H 57H 52H 30H 54H 4EH 31H 32H 33H 30H 32H 36H 34H 06H 30H 35H 46H 46H
Programmable S E
The sum check is calculated
controller T 0 5 F F 7 B C 9 1 2 3 4 T B 3
over this range X X
02H 30H 35H 46H 46H 37H 42H 43H 39H 31H 32H 33H 34H 03H 42H 33H
8-4
FX communication Commands 8
PC No.
code
Sum check
Head device Number of
Message
wait time
Data of
E N Q
devices
B W
the
(5 characters) (2 characters, specified
Computer hexadecimal) devices
Programmable
No.
Station
PC No.
S T X
controller Specifies the range of devices to be written.
"0" (30H) indicates OFF.
"1" (31H) indicates ON.
Notes
Specify the range and number of devices so as to satisfy the following conditions.
- 1 number of devices 160
- Head device No. + number of devices -1 max. device No.
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Command example
To write data into five points from M903 to M907 at station No.0 (with message wait time set
to 0 ms).
The sum check is calculated over this range
E
N 0 0
Q
F F B W 0 M 0 9 0 3 0 5 0 1 1 0 1 2 6 8
Computer 05H 30H 30H 46H 46H 42H 57H 30H 4DH 30H 39H 30H 33H 30H 35H 30H 31H 31H 30H 31H 32H 36H
Programmable A
Specifies to turn OFF M903
contoroller C 0 0 F F
Specifies to turn ON M904 K
Specifies to turn ON M905 06H 30H 30H 46H 46H
Specifies to turn OFF M906
Specifies to turn ON M907
8-5
FX communication Commands 8
PC No.
code
Sum check
Head device Number of
Message
wait time
Data of
E N Q
devices
B R
the
specified
(5 characters) (2 characters, devices
Computer hexadecimal)
Programmable
No.
Station
PC No.
S T X
controller Specifies the range of devices to be read.
One word device requires four hexadecimal digits.
Therefore,one word is expressed using four
characters.
Notes
Specify the range and number of devices (16 bit words) so as to satisfy the following
conditions.
- 1 number of devices 64 (10 words in the case of bit devices)
- Head device No. + number of devices (number of devices 16 in the case of bit
device) -1 max. device No.
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Specification examples
a ) Example 1
To write to 32 points from M640 to M671 at station No.0 (with message wait time set to
0 ms).
E
N 0 0 F F WW 0 M 0 6 4 0 0 2 2 3 4 7 A B 9 6 0 5
Q
Computer 05H 30H 30H 46H 46H 57H 57H 30H 4DH 30H 36H 34H 30H 30H 32H 32H 33H 34H 37H 41H 42H 39H 36H 30H 35H
Programmable The sum check is calculated A
controller over this range C 0 5 F F
K
06H 30H 30H 46H 46H
1 2 3 7 A B 9 6
0 0 1 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 1 0 1 0 1 1 1 0 0 1 0 1 1 0
M M M M M M M M M M M M M M
6 6 6 6 6 6 6 6 6 6 6 6 6 6
5 5 5 4 4 4 4 7 7 6 5 5 5 5
5 4 3 3 2 1 0 1 0 9 9 8 7 6
Notes
Command WW uses word units. When writing 32 points, the number of devices is
specified by 02 (16 points(bits) per one word unit).
8-6
FX communication Commands 8
b ) Example 2
To write to data to two points, D0 and D1, at station No.0 (with message wait time set to
0 ms).
E
N 0 0 F F WW 0 D 0 0 0 0 0 2 1 2 3 4 A C D 7 F 9
Q
Computer 05H 30H 30H 46H 46H 57H 57H 30H 44H 30H 30H 30H 30H 30H 32H 31H 32H 33H 34H 41H 43H 44H 37H 46H 39H
Programmable A
controller C 0 5 F F
The sum check is calculated over this range K
06H 30H 30H 46H 46H
1234H(hexadecimal) to D0: indicates to write 4660 in decimal.
ACD7H(hexadecimal) to D1: indicates to write -21289 in decimal.
8-7
FX communication Commands 8
code
Sum check
No.
Station
PC No.
Set/reset
Set/reset
Number of Device Device
Message
wait time
E N Q
devices
B T
(2 characters, (5 characters) (5 characters)
Computer hexadecimal)
Programmable
No.
Station
PC No.
A C K
1 character
controller "0" (30H) indicates reset (OFF)
"1" (31H) indicates set (ON)
Notes
Specify the range and number of devices so as to satisfy the following condition.
- 1 number of devices 20(10 for FX0N)
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Specification example
To set ON M50, OFF S100, and ON Y001 at station No.5 (with message wait time set to 0
ms).
The sum check is calculated over this range
E
N 0 5 F F B T 0 0 3 M 0 0 5 0 1 S 0 1 0 0 0 Y 0 0 0 1 1 E C
Q
Computer 05H 30H 35H 46H 46H 42H 54H 30H 30H 33H 4DH 30H 30H 35H 30H 31H 53H 30H 31H 30H 30H 30H 59H 30H 30H 30H 31H 31H 45H 43H
Programmable A
controller C 0 5 F F
Set (ON) Reset (OFF) Set (ON) K
06H 30H 35H 46H 46H
8-8
FX communication Commands 8
code
Sum check
No.
Station
PC No.
Message
wait time
E N Q
devices
W T
Programmable
No.
Station
PC No.
A C K
controller When specifying bit One word device requires four
devices,specify the hexadecimal digits.
Head device. Therefore,one word is expressed using
four characters.
Notes
Specify the range and number of devices (16 bit words) so as to satisfy the following
conditions.
- 1 number of devices 10 (6 for FX0N)(one unit is 16 points for bit devices)
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
C200 to C255 (CN200 to CN255) which are 32-bit devices cannot be handled in this
command.
2 ) Specification example
To changing the present value of D500 to 1234H, bits Y100 to Y117 to BCA9H, and the
present value of C100 to 100 at station No.5 (with message wait time set to 0 ms). 8
The sum check is calculated over this range
E
N 0 5 F F WT 0 0 3 D 0 5 0 0 1 2 3 4 Y 0 1 0 0 B C A 9 C N 1 0 0 0 0 6 4 0 7
Q
Computer 05H 30H 35H 46H 46H 57H 54H 30H 30H 33H 44H 30H 35H 30H 30H 31H 32H 33H 34H 59H 30H 31H 30H 30H 42H 43H 41H 39H 43H 4EH 31H 30H 30H 30H 30H 36H 34H 30H 37H
Programmable A
controller C 0 5 F F
B C A 9 K
06H 30H 30H 46H 46H
8-9
FX communication Commands 8
Remote stop
NO
Forced run mode
YES
Special auxiliary relay Remote error code (18H) is returned to
M8037 is ON computer, and the state of programmable
controller is not changed.
Programmable
controller is stopped.
8-10
FX communication Commands 8
No.
Station
PC No.
wait time
Message
code
Sum check
E N Q
RR
or
RS
Computer
Programmable
No.
Station
PC No.
A C K
controller
Notes
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Operation examples
a ) Example 1
To execute remote RUN at station No.5 (with a message wait time set to 0 ms).
E
N 0 5 F F R R 0 C 5
Q
Computer
Programmable
05H 30H 35H 46H 46H 52H 52H 30H 43H 35H
8
A
controller C 0 5 F F
K
06H 30H 35H 46H 46H
b ) Example 2
To execute remote STOP at station No.0 (with message wait time set to 0 ms).
E
N 0 0 F F R S 0 C 1
Q
Computer 05H 30H 30H 46H 46H 52H 53H 30H 43H 31H
Programmable A
controller C 0 0 F F
K
06H 30H 30H 46H 46H
8-11
FX communication Commands 8
8-12
FX communication Commands 8
No.
Station
PC No.
code
Sum check
No.
Station
PC No.
Message
wait time
E N Q
A C K
P C
Character area B
Computer
Programmable
No.
Station
PC No.
code
Sum check
PC type
S T X
E T X
controller name
(2 characters)
Notes
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Specification example
To read the type name from station No.15 (with message wait time set to 0 ms)
8-13
FX communication Commands 8
PC No.
code
Sum check
Message
wait time
E N Q
Control flag
G W
(1 characters)
Computer
Programmable When data value is "1" (31H), global operation flag is tumed on.
controller When data value is "0" (30H), global operation flag is tumed off.
Notes
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Specification example
To turn on the global operation flag at all programmable controller stations in the computer link;
auxiliary relay M8126 in an FX series PC station, and Xn2 in an A series programmable controller
station.
The sum check is
calculated over
this range
E
N F F F F G W 0 1 1 7
Q
Computer 05H 46H 46H 46H 46H 47H 57H 30H 31H 31H 37H
Prpgrammable
controller Indicates that the global operation flag is turned ON.
8-14
FX communication Commands 8
D(n+m-1)
Notes
This function can only be used when the configuration of the computer and program-
mable controller is 1:1.
Notes
The on-demand handshake signal is a signal which is turned on when data transmis-
sion to the computer is started from the programmable controller, and is turned off
when transmission of the specified data is complete.
This is used as an interlock so that multiple on-demand requests can not be issued
simultaneously.
8-15
FX communication Commands 8
Set the on-demand data Write the data to be transmitted into data reg-
isters.
Reset the on-demand error flag Turn off on-demand error flag special M8128.
(If special M8128 is ON, on-demand can not
be started.)
Start on-demand On-demand is started by writing the head
device number where the data is stored into
special M8127, and writing the data length
into special D8128.
When the request is received, special M8127
is turned on, and when transmission is com-
pleted, the M8127 is turned off.
Transmission Complete
On-demand Receive
Check that the received data is On-demand data has a PC number of FE auto-
on-demand data. matically attached. This can be used to identify
on-demand data.
Data processing
Completion of Receive
8-16
FX communication Commands 8
E A
N b) On-demand data C
Q K
Computer c)
Programmable S
controller T
X
On-demand a)
execution
flag M8127
Start on-demand,
Programmable writing of the on-
controller demand data length
c)
E A
N On-demand data C
Computer
Q K 8
Programmable S
controller T
X
On-demand
execution b)
flag M8127 a)
Start on-demand,
Programmable writing of the on-
controller demand data length
8-17
FX communication Commands 8
Computer
Programmable
No.
Station
PC No.
code
Sum check
S T X
E T X
controller Transmission
data
ON
Special auxiliary OFF
relay M8127
On-demand data is set, the head address
Programmable Write processing is written to D8127 and the data length is
controller written to D8128.
Notes
Specify the data length so as to satisfy the following condition.
Data length 40H (64 points)(13 points for FX0N)
The PC number, FE is added by the programmable controller.
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
Important
Don't use the on-demand function unless the system configuration is 1:1.
If the on-demand function is used in a multidrop system in which the computer and the
programmable controller are connected in 1:n configuration, normal communication
data in control protocol formats 1 to 4, and on-demand data become confused, and
normal data transmission is not possible.
8-18
FX communication Commands 8
2 ) Specification Example 1
To transmit the data stored in data registers D100 and D101 from the programmable control-
ler (when the station number is 0, and data is specified in word units)
M8127
Programmable
Write processing
controller Set ON if a transmission error
occurs
On-demand D8127 100 M8128 ON/OFF
command D8128 2 M8129 OFF
D100 1234H
The 4 hexadecimal digits of
D101 5678H each word are transmitted in
ASCII, starting with the most
significant digit.
Program example
M8000
M8129 Data transmission set to word units.
X000 M8002
0 PLS M0 Start command signals a pulse.
M0 M8127
3 MOV H1234 D100
Transmission data is set.
7 MOV H5678 D101 8
On-demand error flag is reset
RST M8128
(cannot start if M8128 is ON)
RST Y000
RST Y001
40 END
8-19
FX communication Commands 8
3 ) Specification Example 2
To transmit the data stored in data registers D100 and D101 from the programmable control-
ler (when the station number is 0, and data is specified in byte units)
The PC number "FE" is automatically added by the
programmable controller
Computer
Programmable S E
controller T 0 0 F E 3 4 1 2 7 8 5 6 T 9 2
X X
02H 30H 30H 46H 45H 31H 32H 33H 34H 37H 38H 35H 36H 03H 39H 32H
M8127
Programmable
controller Write processing
Set ON if a transmission
error occurs
On-demand D8127 100 M8128 ON/OFF
command D8128 4 M8129 ON
D100 1234H The 2 hexadecimal digits of
D101 5678H each byte are transmitted in
ASCII, starting with the most
significant digit.The lower byte
of each word is transmitted first.
Program example
M8000
M8129 Data transmission set to byte units.
X000 M8002
0 PLS M0 Start command signals a pulse.
M0 M8127
3 MOV H1234 D100
Transmission data is set.
7 MOV H5678 D101
On-demand error flag is reset
RST M8128
(cannot start if M8128 is ON)
RST Y000
RST Y001
40 END
8-20
FX communication Commands 8
PC No.
Characters
No.
code
Sum check
Message
wait time
Data
E N Q
T T (designated
No.
characters) 2 characters (hexadecimal)
Computer
Programmable
No.
Station
PC No.
Character
No.
code
Sum check
Data
A C K
E T X
controller 2 characters (hexadecimal) (same data
as character
A area)
Character area B
Notes
Specify the number of characters so as to satisfy the following condition.
- 1 No.characters 254 (25 for FX0N)
The station number, PC number, number of devices, and sum check code are
expressed in hexadecimal.
2 ) Specification example
To test the Loopback with data ABCDE at station No.0 (with message wait time set to 0 ms)
The sum check is calculated over
this range 8
E
N 0 0 F F T T 0 0 5 A B C D E 7 8 The sum check is calculated
Q over this range
Computer 05H 30H 30H 46H 46H 54H 54H 30H 30H 35H 41H 42H 43H 44H 45H 37H 38H
Programmable S E
controller T 0 0 F F 0 5 A B C D E T A 3
X X
02H 30H 30H 46H 46H 30H 35H 41H 42H 43H 44H 45H 03H 41H 33H
8-21
FX communication Commands 8
MEMO
8-22
FX Series Programmable Controllers RS instruction 9
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction 9
10 FX2N-232IF
12 Diagnostics
9. RS instruction
This section describes RS instructions. For the target devices, refer to the application instruction
manual of each programmable controller.
The data transmission format can be set using a special data register D8120.
Even if the setting of D8120 is modified while an RS instruction is driven, such modification is
not accepted.
In a system in which send is not performed, set the number of send points to K0.
In a system in which receive is not performed, set the number of receive points to K0.
9-1
FX communication RS instruction 9
Note;
Though an RS instruction can be used in a program as many times as you want,
make sure that only one RS instruction is driven at a time (Two or more RS instruc-
tions cannot be turned on at one time.). For changeover, assure the OFF time is
equivalent to or longer than one cycle time.
In the FX0N , FX 1S, FX1N, FX and FX 2C, assure the OFF time is equivalent to or
longer than two scan times between completion of send and start of receive or
between completion of receive and start of send. In the FX2N and FX2NC whose ver-
sion is earlier than V 2.00, assure the OFF time is equivalent to or longer than 100
s between completion of send and start of receive or between completion of
receive and start of send. (Refer to Paragraph 9.2.1.)
This OFF time is not required in the FX2N, FX2NC whose version is V 2.00 or later
because full duplex communication is enabled.
9-2
FX communication RS instruction 9
Note;
In the FX, FX2C, FX0N, FX1S, FX1N and earlier versions than V 2.00 of the FX2NC and FX2N,
pay attention to the following points.
While the programmable controller is receiving data, send is only performed after receive is
completed. During this time, the send wait flag M8121 is actuated.
After the head data is received and before the receive completion flag M8123 is turned on, it is
regarded that a receive is being performed. If the send request is given while the head data is
received, data may be confused.
9-3
FX communication RS instruction 9
4 ) Time-out evaluation <M8129> (Valid in the FX2N, FX2NC programmable controller earlier
than V2.00)
If receive is not restarted within the time specified by D8129 after the receive data is inter-
rupted on the midway, it is regarded as time-out, M8129 is turned on, and receive is com-
pleted (Refer to the figure below.).
M8129 is not automatically turned off. Reset it using a sequence program.
When this function is used, data can be received without using a terminator even in equip-
ment in which the number of send data may be changed.
Receive data is
interrupted
Receive Data
Reset by program
Time-out evaluation D8129 10ms
M8129 ON
Receive completion
M8123 ON
5 ) Time-out evaluation time <D8129> (Valid in V 2.00 or later of the FX2N, FX2NC programmable
controller)
Set the time used for time-out evaluation described above. The value set here multiplied by
10 ms is regarded as the evaluation time.
When 0 is set to D8129, the evaluation time is regarded as 100 ms.
Example: When the time-out evaluation time is set to 50 ms
M8002
MOV K5 D8129
9-4
FX communication RS instruction 9
Send data
SD (TXD) Data 1 Data 4
Receive data
RD (RXD) Data 2 Data 3
Receive
completion OFF ON ON
M8123 The receive wait
status is started Reset it using a program.
When it is not trurned off, the next
data cannot be received.
* In FX1S, FX1N, FX0N, FX and FX2C series, the period should be 2 scan time or more.
9-5
FX communication RS instruction 9
Send data
SD (TXD) Data 1 Data 1 Data 2
ER(DTR) OFF ON
DR(DSR) OFF ON
b ) Receive only
RS instruction
driving OFF ON
Receive data
RD (RXD) Data 1 Data 2
ER(DTR) OFF ON
Receive
completion OFF ON ON ON
M8123
Reset using a program. When it is not trurned off, the next data cannot
be received.
9-6
FX communication RS instruction 9
RS instruction
driving OFF ON
Send data SD
(TXD) Data 1 Data 3
ER(DTR) OFF ON
Receive data
RD (RXD) Data 2
Receive
completion OFF ON
M8123
Reset using a program.
When it is not trurned off, the next
data cannot be received.
DR(DSR) OFF ON
* When using FX1S, FX1N, FX0N, FX, or FX2C, this period should be 2 scan times or more.
9-7
FX communication RS instruction 9
Send data
SD (TXD) Data 1 Data 3
Send wait ON
flag M8121
Check OFF
ER(DTR) OFF ON
*2
DR(DSR) OFF ON *1 *1
Check *5
OFF
Receive data *3
RD (RXD) Data 2
Receive
completion OFF ON *4
M8123
9-8
FX communication RS instruction 9
Send data
SD (TXD) Data 1 Data 3 Data 5
Receive
completion OFF ON ON
M8123
The receive wait Reset using a program.
status is started When it is not trurned off, the next
data cannot be received.
9-9
FX communication RS instruction 9
Send data
SD (TXD) Data 1 Data 4
ER(DTR) OFF ON
Receive data
RD (RXD) Data 2 Data 3
Receive
completion OFF ON ON
M8123
DR(DSR) OFF ON
9-10
FX communication RS instruction 9
Send data
SD (TXD) Data 2 Data 4 Data 4
DR(DSR) OFF *1 ON *1 *1
Up to 30 characfers can be
received *2
Receive data
RD (RXD) Data 1 Data 3 Time-out Data 3
evaluation time
D812910ms
Time-out
evaluation *3
flag M8129 Reset it using a program.
When it is not trurned off,
the next data cannot be
received.
Receive
completion OFF ON ON ON
M8123
ER(DTR) ON OFF
*1 While the counterpart equipment is ready to receive, turn ON the DR (DSR) signal.
While both the DR (DSR) signal and the send request are turned on, the FX2N sends the data.
*2 In the interlink mode, the programmable controller turns OFF the ER (DTR) signal before the
30th character receive buffer limit, and requests the counterpart equipment to stop send.
9
After this send request, up to 30 characters can be received. The 31st and later characters
cannot be received. Stop send temporarily, then send the remaining data after the ER (DTR)
signal is turned ON again.
When send is stopped, receive is completed after the time-out evaluation time is expired.
When send is not stopped, receive is completed after the final character of the send data is
received or the 30th character is received. Therefore, receive points need to set 30th or more.
*3 Reset using a sequence program.
If it is not turned off, the next data cannot be received.
9-11
FX communication RS instruction 9
Send data STX D200 lower D200 upper D201 lower D201 upper ETX
(Programmdble
controller Header Terminator
External Head address specified by S
equipment) Send byte count
specified by "m"
Receive data STX D500 lower D500 upper D501 lower D501 upper D502 lower D502 upper ETX
(External
equipment Header Terminator
Programmdble Head address specified by D
controller) It does not exceed the upper limit number
of receive data points (byte count)
specified by "n".
Receive is completed when the terminator
(ETX) or "n" points are received.
D201 upper
D200 lower
D201 lower
STX
ETX
4
3
Remaining number 2
1
of send data D8122 0
D501 upper
D502 upper
D500 lower
D501 lower
D502 lower
STX
ETX
9-12
FX communication RS instruction 9
Send data STX D200 lower D201 lower D202 lower D203 lower ETX
(Programmdble
controller Header Terminator
External Head address specified by S
equipment) Send byte count
specified by "m"
Receive data STX D500 lower D501 lower D502 lower D503 lower D504 lower D505 lower ETX
(External
equipment Header Terminator
Programmdble Head address specified by D
controller)
It does not exceed the upper limit number
of receive data points (byte count)
specified by "m".
Receive is completed when the terminator
(ETX) or "n" points are received.
ETX
4
3 9
Remaining number 2
1
of send data D8122 0
ETX
6 The number of
5 receive data is also
4 reset when the
3
Number of receive data 2 receive completion
D8123 1 flag M8123 reset.
0
9-13
FX communication RS instruction 9
R e ce ive
Send
F X 2 N -2 3 2 -B D F X 2N
Use a communication cable suitable to the arrangement of connector pins of the personal
computer used. (For the representative wiring, refer to chapter 2.)
2 ) Communication format
If the communication format of the commercial communication software used cannot realize
the following setting, set the programmable controller in accordance with the commercial
communication software.
(The communication format in this example is set as follows.)
Data length 8 bit
Parity Even
Stop bit 2 bit
Baud rate 9,600 bps
Header None
Terminator None
Control line Normal mode 1
Protocol No protocol
3 ) Operation
PLC and personal computer are turned ON.
Power ON When PLC is in RUN status, PLC already can receive data
from personal computer.
Sending data to After moving data, PLC sends data (D10, D11) to the personal
personal computer. When receiving data from the PLC, the personal
computer computer displays the data.
9-14
FX communication RS instruction 9
M8123
FNC 15 D0 D10 K2 The receiving data (D0, D1)
BMOV moves to sending data area
(D10, D11).
PLF M20
M20
SET M8122 Send request
END
*1 This counter is used for waiting time of receiving data from PLC. Please change setting
value of counter for personal computer CPU speed.
9-15
FX communication RS instruction 9
9.4.2 Printer
Connecting FX2N-232-BD and printer, and printing out the data send from the programmable
controller.
1 ) System configuration
Send
FX 2N -232-BD FX 2N
Use a communication cable suitable to the arrangement of connector pins of the printer
used. (For the representative wiring, refer to chapter 2.)
2 ) Communication format
Let the communication format of the programmable controller be in accordance with that of
the printer used. (The communication format in this example is set as follows.)
Data length 8 bit
Parity Even
Stop bit 2 bit
Baud rate 2,400 bps
Header None
Terminator None
Control line No use
Protocol No protocol
3 ) Operation
9-16
FX communication RS instruction 9
4 ) Example program
M8000
M8161 Handled by 8-bit data
M8002
MOV H006F D8120 Setting communication format
X000 b15 b0
RS D10 K11 D50 K0 RS instruction driving
X001 0000 0000 0110 1111
PLS M0 0 0 6 F
M0
MOV H0074 D10
MOV H0065 D11
9-17
FX communication RS instruction 9
Supporting Version
FX2N V2.01 or more
RS D0 K1 D1 K1
X0
MOV P H0000 D8120
9-18
FX Series Programmable Controllers FX2N-232IF 10
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF 10
12 Diagnostics
10. FX2N-232IF
10.1 Introduction
The RS232C interface block FX2N-232IF (hereinafter referred to as 232IF) is connected to the
FX1N, FX2N, FX2NC programmable controller to realize full duplex serial data communication with
another RS232C interface such as a personal computer, bar code reader, printer, etc.
10-1
FX communication FX2N-232IF 10
R:For read
BFM
Name Setting range Initial value W:For
No.
write
#0 Communication format 0087H W
#1 Command 0 W
1 to 512 (when data length is 16
bits)
#2 Receive upper limit byte count 1 to 256 (when data length is 8 0 W
bits)
0 is treated as 512 or 256.
1 to 32,767 (X10 ms)
#3 Receive time-out time 0 W
0 eliminates time-out time.
#4 Send header, lower 2 bytes 0 (no header)
4 bytes max., zero suppression W
#5 Send header, upper 2 bytes 0
#6 Send terminator, lower 2 bytes 0 (no terminator)
4 bytes max., zero suppression W
#7 Send terminator, upper 2 bytes 0
#8 Receive header, lower 2 bytes 0 (no header)
#9 4 bytes max., zero suppression W
Receive header, upper 2 bytes 0
Receive terminator, lower 2
#10 bytes 0 (no terminator)
4 bytes max., zero suppression W
#11 Receive terminator, upper 2 0
bytes
Receive suspension waiting
#12 0 to 32,327 (X10 ms) 0 W
time (in interlink connection)
0 to 512 (when data length is 16
Number of remaining send bits)
#13 0 R
data 0 to 256 (when data length is 8
bits)
#14 Number of receive buffers 0 to 256 + 15 *1 0 R
#15 Send sum result 0 R
#16 Receive sum result 0 R
Note : W : For write can be used for read also. Undefined BFM Nos. are not allowed to be used
in program.
*1 : Spare buffers used in the interlink connection mode.
10-2
FX communication FX2N-232IF 10
#1001
to Send buffers 0 W
#1256
#2000
to Receive buffers 0 R
#2256
#2257 Spare receive buffers for interlink
to 0 R
#2271 connection mode
Note : W : For write can be used for read also. Undefined BFM Nos. are not allowed to be used
in the program.
*1 : Spare buffers used in the interlink connection mode.
10
10-3
FX communication FX2N-232IF 10
The communication format is determined on the rising edge of the send/receive enable com-
mand (BFM #1 b0).
Accordingly, the setting of the communication format should be preliminary transferred using the
TO instruction before BFM #1 b0 is turned on. Also, the send header and the send terminator are
determined in the rising edge of the send command (BFM #1 b1). The receive header and the
receive terminator are determined on the rising edge of BFM #1 b0 or on the rising edge of the
receive completion reset command (BFM #1 b2). Accordingly, when only the header and the ter-
minator exclusively are changed it is not necessary to turn BFM #1 b0 off. The change becomes
valid form the next send/receive operation.
10-4
FX communication FX2N-232IF 10
1 ) Communication format
Select the communication format used
Data
to send/receive data in the 232IF
among 9 types shown on the left.
Data Termi
nator
The header can be specified in the
portion in the communication Data Termi CR
format. nator
10-5
FX communication FX2N-232IF 10
10-6
FX communication FX2N-232IF 10
10-7
FX communication FX2N-232IF 10
Bit Description
b0 Send/receive enable (ER ON)
b1 Send command
b2 Receive completion reset command
b3 Error reset
BFM #1 gives the command for send/receive and the status information reset command to the
232IF.
1 ) b0 (send/receive enable)
While b0 is turned on, the 232IF can send and receive data.
The contents of the following setting items are determined on the rising edge of b0. Make
sure to set the contents using the TO instruction before setting b0 to ON.
BFM #0 (communication format)
BFMs #9 and #8 (receive header)
BFMs #11 and #10 (receive terminator)
On the rising edge of b0, the error occurrence (BFM #28 b3) and the error code (BFM #29)
are cleared.
2 ) b1 (send command)
On the rising edge of b1, the contents of the send buffers (BFMs # 1001 to #1256) are sent to
the counterpart equipment up to the send byte count (BFM #1000).
When send is completed, the send completion status (BFM #28 b0) is set. BFM #28 b0 is
automatically reset when the next send command (b1) is given.
When b1 is given, the contents of the following setting items are determined.
BFMs #5 and #4 (send header)
BFMs #7 and #6 (send terminator)
3 ) b2 (receive completion reset command)
When b2 is set to ON, the following items are cleared.
BFM #28 b1 (receive completion)
BFM #2000 (receive byte count)
BFMs #2001 to #2256 (receive buffers)
When receive is completed, b2 should be set to ON to clear the receive completion status
(BFM #28 b1). If BFM #28 b1 is not reset, the next data cannot be received.
When b2 is set to ON, the contents of the following setting items are determined.
BFMs #9 and #8 (receive header)
BFMs #11 and #10 (receive terminator)
In the RS-232C interlink connection mode (BFM #0 b9=1, b8=1), b2 functions as the receive
continuation command to receive data exceeding the receive upper limit byte count (BFM
#2), and clears the following items.
BFM #28 b4 (receive suspended)
BFM #2000 (receive byte count)
BFMs #2001 to #2256 (receive buffers)
BFMs #2257 to #2271 (spare receive buffers)
When b2 is set to ON, the request to send (RS) signal is automatically set to ON also.
4 ) b3 (error reset)
When b3 is set to ON, the error occurrence status (BFM #28 b3) and error code (BFM #29)
are cleared.
10-8
FX communication FX2N-232IF 10
The transmission order is fourth header, third header, second header, first header when 4
headers are specified. 10
10.2.7 Send Terminator <BFM #7 (upper), BFM #6 (lower)>
Setting range: 4 bytes maximum, zero suppression
The initial value is 0 (No used).
For the send data of the 232IF, 4 terminators maximum can be specified. When the number of
terminators is less than 4, the upper 0s are ignored (zero suppression) and not transferred.
As the first terminator, specify an ASCII code from 01H to 1FH. (As the second to fourth termina-
tors, any ASCII code can be specified.)
The register structure and the transmission order are equivalent to those of the send header
described above.
10-9
FX communication FX2N-232IF 10
Receive suspended
BFM#28 b4
10-10
FX communication FX2N-232IF 10
S E
T T
0 A 1 2 5 F 5 2
X X
02 H 30 H 41 H 31 H 32 H 35 H 46 H 03 H 35 H 32 H
Target range
30 H +41 H +31 H +32 H +35 H +
46 H +03 H =152 H
The total value including the terminator and excluding the header (1st byte of the header only) is
calculated. Then, the lower 1 byte is converted into the ASCII code, and sent or received. The
data converted into the ASCII code is placed in the order of upper digit and lower digit. 10
10.2.14 Receive Sum Result <BFM #16>
Initial value: 0
The sum check value of the receive data is saved.
When the check sum added to the receive data is different from the receive sum result, receive
sum check error occurs.
The sum check target range and the calculation method are equivalent to those for the send sum
result described above.
10-11
FX communication FX2N-232IF 10
10.2.16 Time from Completion of Actual Send to RS OFF (completion flag ON) <BFM #21>
Set value: 0 to 32,767 (x 10ms)
The initial value is 0 ms.
The time after the 232IF sends the data until the RS signal is turned off and the send completion
flag (BFM #28 b0) is turned on can be specified.
Set BFM #21 when it is required by a modem, etc.
10-12
FX communication FX2N-232IF 10
The 232IF status and the send/receive result are saved as status information. This information
can be read from the programmable controller using the FROM instruction, then utilized.
1 ) b0 (send completion)
When send of data up to the send byte count (BFM #1000) is completed, the send comple-
tion status (b0) is set. The send completion status (b0) is automatically reset when the next
send command (BFM #1 b1) set to ON.
2 ) b1 (receive completion)
When receive of data up to the receive upper limit byte count (BFM #2) is completed, the
receive completion status (b1) is set. If the receive terminator (BFMs #11 and #10) or the
receive time-out time (BFM #3) is set, it is regarded that receive is completed when the set
condition is satisfied, then the receive completion status (b1) is set in the same way.
This status is required to be reset using the sequence program. If it is not reset, the next data
cannot be received. This status can be reset using the receive completion reset command
(BFM #1 b2).
3 ) b2 (receive time-out)
When the receive time-out time (BFM #3) is reached while data is received, the receive time-
out status (b2) is set. At the same time, the receive completion status (b1) is also set.
This status is automatically reset when the receive completion reset command (BFM #1 b2)
is executed.
4 ) b3 (error occurrence)
When an error occurs while data is sent or received, b3 is set to ON and the error is saved
to the error code (BFM #29). 10
5 ) b4 (receive suspended)
When data exceeding the receive upper limit byte count (BFM #2) is received in the RS232C
interlink connection mode (BFM #0 b9=1, b8=1), the 232IF sets the request to send (RS) sig-
nal to OFF, requests the counterpart equipment to suspend the send operation, then sets
b4 after the receive suspension waiting time (BFM #12) has expired.
To receive the excess data in the interlink connection, the rising edge of the b4 is required to
be monitored using the sequence program. The data as much as the receive byte count
(BFM #2000) in the receive buffers (BFMs #2001 to #2271) or the data as much as the num-
ber of receive buffers (BFM #14) should be read to data registers in the programmable con-
troller and the receive completion command executed (BFM #1 b2).
6 ) b6 (being sent)
b6 is turned on after the send command (BFM #1 b1) is given until the send completion sta-
tus (BFM #28 b0) is set.
10-13
FX communication FX2N-232IF 10
7 ) b7 (being received)
b7 is turned on after the head data is received until the receive completion status (BFM #28
b1) is set.
8 ) b8 (RS), b9 (ER), b12 (DR), b13 (CD), b14 (CS), b15 (CI)
These bits indicate the ON/OFF status of the control signals.
1byte 1byte
1word
10-14
FX communication FX2N-232IF 10
10.2.24 Spare Receive Buffers for Interlink Connection Mode <BFM #2257 to #2271>
Each of them is a spare buffer for the interlink connection in the case where the data exceeding
512 bytes is received, and is used to receive the data after the request to send (RS) signal is
turned off until the send operation of the counterpart equipment is suspended.
The receive contents are cleared by the receive completion reset command (BFM #1 b2).
10
10-15
FX communication FX2N-232IF 10
Send/receive OFF ON
enable *1 *1
(BFM#1 b0)
Send OFF ON
command
(BFM#1 b1)
Send data Data 1 Data 4
SD(TXD)
BFM#20 BFM#20
Send OFF X10ms *2 ON X10ms *2
completion
(BFM#28 b0)
Receive data Data 2 Data 3
RD(RXD)
Receive OFF ON
completion
(BFM#28 b1)
*3
Receive OFF ON
completion reset
command The receive wait
(BFM#1 b2) stafus is started. *4 *4 *3
*1 Turn off using a program. When it is not turned off, the next data cannot be sent.
*2 Time set by BFM#20 (x10ms).
*3 Turn it off using a program. When it is not turned off, the next data cannot be sent.
*4 After receive is completed and the receive data is read, turn off the receive completion flag
(BFM #28 b1) using a receive completion reset command (BFM #1 b2).
10-16
FX communication FX2N-232IF 10
*1 *1 BFM#21(X10ms) *2
Send OFF ON
command BFM#21 *2
(BFM#1 b1) (X10ms)
RS(RTS) OFF ON
CS(CTS) OFF ON
*1 Turn off using a program. When it is not turned off, the next data cannot be sent
*2 Time set by BFM #21 (x10ms)
*3 Time set by BFM #22 (x10ms)
*4 Turn off using a program. When it is not turned off, the next data cannot be received.
*5 After receive is completed and the receive data is read, turn off the receive completion flag
(BFM #28 b1) using a receive completion reset command (BFM #1 b2)
10
10-17
FX communication FX2N-232IF 10
Send OFF ON
completion BFM#20
(BFM#28 b0) (X10ms) *4
OFF ON
RS(RTS)
*5
Receive data Data 1 Data 3 Data 3
RD(RXD)
ON
Receive OFF
suspended
(BFM#28 b4) BFM#12
Receive OFF ON (X10ms) *6
completion *7
(BFM#28 b1) *8
Receive OFF
completion reset
command *9 *7 *7
*8
(BFM#1 b2)
*1 Turn off using a program. When it is not turned off, the next data cannot be sent.
*2 Make sure that the CS (CTS) in the FX2N-232IF is turned on while the counterpart equipment
is ready for receive.
*3 Time set by BFM #20 (x10ms)
*4 Time set by BFM #21 (x10ms)
*5 The RS (RTS) is turned off when the upper limit of receive byte count specified by the BFM #2
is exceeded.
When the send/receive buffer data length is 16 bits (BFM #0 b14=0), interrupt send from the
counterpart equipment within 30 bytes. When the send/receive buffer data a length is 8bits
(BFM #0 b14=1), interrupt send from the counterpart equipment within 15 bits.
If send is not interrupted, all the send data cannot be received.
*6 Time set by BFM #12 (x10ms)
*7 Turn off using a program. When it is not turned off, the next data cannot be received.
*8 After receive is completed and the receive data is read, turn off the receive completion flag
(BFM #28 b1) using a receive completion reset command (BFM #1 b2).
*9 Read the data as much as the receive byte count (BFM #14) in the receive buffer (BFM #2001
to BFM #2271) to the data registers in the programmable controller, then turn it ON.
10-18
FX communication FX2N-232IF 10
Cross cable
Personal computer
b15 b8 b7 b0
0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1
0 0 9 F (009F H)
10-19
FX communication FX2N-232IF 10
10-20
FX communication FX2N-232IF 10
3 ) Example program
10-21
FX communication FX2N-232IF 10
4 ) Operation chart
(M0) BFM#1 b0
Send/receive enable
(M1) BFM#1 b1
Send command
9 8
7 6
BFM#13 5 4
Number of remaining 3 2
1 0
Send send data
#1001 upper
#1002 upper
#1003 upper
#1004 upper
#1002 lower
#1003 lower
#1004 lower
#1005 lower
#1001 lower
Send completion status is also reset
STX
STX
ETX
BFM#1001 to #1256 by next send command.
Send buffers
BFM#1000
(M10) BFM#28 b0 Send byte count
Send completion
4
3
BFM#14 2
Number of receive 1
buffers 0
7 8
4 5 6
BFM#2000 2 3
Receive byte count 0 1
Contents of receive buffers are also cleared. When not reset
Receive
#2001 upper
#2003 upper
#2004 upper
#2002 upper
#2002 lower
#2001 lower
#2003 lower
#2004 lower
STX
ETX
STX
ETX
BFM#2001 to #2256
Receive buffers
BFM#2
(M11) BFM#28 b1 Receive upper
Receive completion limit byte count
BFM#1 b2
(M2) Receive completion reset
command
10-22
FX communication FX2N-232IF 10
Cross cable
Personal computer
b15 b8 b7 b0
0 1 0 0 0 0 0 0 1 0 0 1 1 1 1 1
4 0 9 F (409F H )
10-23
FX communication FX2N-232IF 10
h ) Receive buffers
8-byte receive data specified in accordance with the receive upper limit byte count (BFM
#2) is read to the data registers D301 to D308 in the programmable controller.
10-24
FX communication FX2N-232IF 10
3 ) Example program
M8002 FNC 79 Transfer of communication format
K0 K0 H409F K1 (409F H BFM#0)
Initial TO
pulse Block No. BFM No. Transfer Number of
source transfer points
FNC 79 Transfer of receive upper limit byte count
K0 K2 K8 K1 (K 8 BFM#2)
TO
FNC 79 H02 Send header
K0 K4 K1 (02 H BFM#4)
TO (STX)
10-25
FX communication FX2N-232IF 10
4 ) Operation chart
(M0) BFM#1 b0
Send/receive enable
(M1) BFM#1 b1
Send command
9 8
7 6 5
BFM#13 4 3
Number of remaining 2 1
send data 0
Send
Send completion status is also reset
#1002 lower
#1003 lower
#1004 lower
#1005 lower
#1006 lower
#1007 lower
#1008 lower
#1009 lower
#1001 lower
STX
STX
ETX
BFM#1001 to #1256 by next send command.
Send buffers
BFM#1000
(M10) BFM#28 b0 Send byte count
Send completion
7 8
BFM#14 4 5 6
Number of receive 2 3
buffers 0 1
8
6 7
3 4 5
BFM#2000 2
Receive byte count 0 1
Contents of receive buffers are also cleared. When not reset
Receive
#2002 lower
#2003 lower
#2006 lower
#2008 lower
#2001 lower
#2004 lower
#2005 lower
#2007 lower
STX
ETX
STX
ETX
BFM#2001 to #2256
Receive buffers
BFM#2
Receive upper
(M11) BFM#28 b1 limit byte count
Receive completion
BFM#1 b2
(M2) Receive completion reset
command
10-26
FX Series Programmable Controllers Optional programming port 11
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
*1: When using other products or cables please check the product manual for required 5V DC 11
supply.
Note;
These products cannot be connected via FX-2PIF to port of FX1N-422-BD or FX2N-422-BD. If
connecting, power supply circuit in PLC will go down.
11-1
FX communication Optional programming port 11
RS232C connector of
FX2N-232-BD side Personal computer side
personal computer
F2-232CAB-1 Gender changer
FX-232CAB-1
D-SUB 9 pin
RS232C cross cable (D-SUB 9 pin to D-SUB 9 pin) see the reference
bellow
RS232C cross cable (D-SUB 25 pin to D-SUB 9 pin) see the reference
D-SUB 25 pin bellow
F2-232CAB-1
2 ) FX0N-232ADP
RS232C connector of
personal computer Cable
11-2
FX communication Optional programming port 11
Note: Reference
F2-232CAB-1 F2-232CAB RS232C crross cable RS232C crross cable
(D-SUB 25pinD-SUB 9pin) (D-SUB 9pinD-SUB 9pin)
1 1 1 4 1 1 7
2 2 2 2 5 8
2 2 2 3
3 3 3 3
3 3 3 2
25pin 5 9pin 5 5 25pin 4 9pin
25pin 25pin 6 9pin 4 6 9pin
6 4 6 6 7 5 5 5
7 5 7 7 20 6 6 4
20 8 7 7 1
20 6 20
1 8 8
8 SHELL SHELL Frame Frame
FX-232CAB-1
2 2
3 3
4 4
9pin 5 5 9pin
6 6
8 8
11-3
FX communication Optional programming port 11
Memo
11-4
FX communication Diagnostics 12
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics 12
12. Diagnostics
12
12-1
FX communication Diagnostics 12
12.2.2 Diagnostics
1 ) Check the status of the RD LED and the SD LED provided on each 485BD.
If both of them are lighted and extinguished, nothing is wrong.
If the RD LED is lighted/extinguished but the SD LED is not lighted/extinguished (not
lighted at all), check the setting of the station No., the transmission rate (baud rate) and the
total number of slave stations.
If the RD LED is not lighted/extinguished, check the wiring.
2 ) Make sure that the communication error (FX2N: M8183 to M8190, FX0N: M504 to M511) in
each slave station is not turned on and that the data communication flag (FX 2N: M8191,
FX0N: M503) is not turned off. When one of the communication error flag is turned on or if the
data communication flag is turned off, check the error code of data registers (FX2N: D8211 to
D8218, FX0N: D211 to D218).
Please see the following section 12.2.1.
12-2
FX communication Diagnostics 12
12
12-3
FX communication Diagnostics 12
Error code
Error description
(hexadecimal)
00H, 01H
02H Sum error
Protocol error (the communication protocol does not conform to the format selected
03H
with D8120)
04H, 05H
Character area error (the character area is incorrectly defined, or the specified com-
06H
mand is not available)
Character error (the data to be written to a device consists of ASCII codes other than
07H
hexadecimal codes)
08H09H
10H PC number error (the PC number is not set to FF or not available from this station)
11H17H
18H Remote error (remote run/stop is disabled)
Error code
Error description
(in D8063)
6301 Parity, overrun, framing error
Command failure receiving a command other than GW (global) when the station num-
6305
ber is FF
6306 Monitor timer over (message to be received is insufficient)
Because these errors are not transmitted it must be programmed at the computer so as to recog-
nize an error by using a watchdog timer or other monitor timer.
12-4
FX communication Diagnostics 12
12.4.3 Diagnostics
1 ) Check the status of the RD(RXD) LED and the SD(TXD) LED provided on each communica-
tion unit.
If both of them are lighted and extinguished, nothing is wrong.
If the RD(RXD) LED is lighted/extinguished but the SD(TXD) LED is not lighted/extin-
guished (not lighted at all), check the setting of the station No. and the transmission rate
(baud rate).
If the RD(RXD) LED is not lighted/extinguished, check the wiring and confirm the connec-
tion with the programmable controller.
2 ) Make sure that the communication procedure is performed correctly. If it is not performed
correctly, correct the setting in the computer.
3 ) Check the NAK error code and programmable controller error code.
Please see the following section 12.4.1 and section 12.4.2.
12
12-5
FX communication Diagnostics 12
12.5 RS Instruction
12.5.1 Diagnostics
1 ) Check the status of the RD (RXD) LED and the SD (TXD) LED provided in an optional equip-
ment.
If the RD (RXD) LED is not lighted while data is received or the SD (TXD) LED is not lighted
while data is sent, check the installation and the wiring.
When the RD (RXD) LED is lighted while data is received or the SD (TXD) LED is lighted
while data is sent, the installation and the wiring are correct.
2 ) Make sure the timing of data send/receive. For example, make sure that the counterpart
equipment is ready for receive before starting to send data to it.
3 ) When the terminator is not used, check whether the send data capacity is equivalent to the
acceptable data capacity. If the send data capacity may be changed, use the terminator.
4 ) Make sure that the external equipment is correctly operating.
5 ) Check whether the type of send data and the type of receive data are equivalent. If they are
different, make them equivalent.
6 ) When two or more RS instructions are used in the program, make sure that only one RS
instruction is actuated in one operation cycle.
Never turn off the RS instruction while data is received or sent.
7 ) In the FX2N Series (V 2.00 or later), an RS instruction is not executed if the counterpart
equipment receives NAK.
Arrange the system so that the RS instruction is executed even if the counterpart equipment
receives NAK.
12-6
FX communication Diagnostics 12
12.6 FX2N-232IF
12.6.1 Error code
When an error occurs while data is sent or received, the BFM #28 b3 is set to ON and the error
code is saved in the BFM #29.
12.6.2 Diagnostics
1 ) Check the status of the POWER LED provided in the FX2N-232IF.
When it is lighted, the drive power is correctly supplied.
If it is extinguished, supply the drive power correctly.
2 ) Check the status of the SD LED and the RD LED provided in the FX2N-232IF.
If the RD LED is not lighted while data is received or the SD LED is not lighted while data is
sent, check the installation and the wiring.
When the RD LED is lighted while data is received or the SD LED is lighted while data is
sent, the installation and the wiring are correct.
3 ) Make sure that the communication setting (BFM #0) of the FX2N-232IF is equivalent to that
of the external equipment. If they are not equivalent each other, make them equivalent.
4 ) Make sure the timing of data send/receive. For example, make sure that the counterpart 12
equipment is ready for receive before starting to send data to it.
5 ) When the terminator is not used, check whether the send data capacity is equivalent to the
acceptable data capacity. If the send data capacity may be changed, use the terminator.
6 ) Make sure that the external equipment is correctly operating.
7 ) Check whether the type of send data and the type of receive data are equivalent. If they are
different, make them equivalent.
12-7
FX communication Diagnostics 12
12-8
FX communication Appebdix A
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
Appendix A:
Further Information Manual List
A-1
FX communication Appendix A
A-2
FX communication Appebdix B
1 Introduction
2 Wiring
3 Specifications
4 N:N network
5 Parallel link
7 Computer link
9 RS instruction
10 FX2N-232IF
12 Diagnostics
B
FX communication Appendix B
Appendix B:
ASCII code Lists
B-1
FX communication Appendix B
MEMO
B-2
USERS MANUAL
FX COMMUNICATION (RS-232C, RS-485)
HEAD OFFICE: MITSUBISHI DENKI BLDG MARUNOUCHI TOKYO 100-8310 TELEX: J24532 CABLE MELCO TOKYO
HIMEJI WORKS: 840, CHIYODA CHO, HIMEJI, JAPAN