Professional Documents
Culture Documents
USER’S MANUAL
FEH225j
Preface
Thank you for purchasing Fuji Electric Programmable Controller MICREX-SX Series.
This User’s Manual describes the specifications of general purpose communication modules in the MICREX-SX series SPH.
Read this manual carefully to ensure correct operation. When using modules or peripheral devices, be sure to read the
corresponding user’s manuals listed below.
* The hardware specifications of general purpose communication modules are common to both D300win and Standard loaders.
However, communication expansion FBs, which are supplied with D300win/Standard loader, are different depending on the
loader. For the specifications and operations of the communication expansion FBs, refer to the user’s manual of expansion
communication FB for each loader.
* In addition to the above manuals, the following Fuji Electric Co.,Ltd. site offers various manuals and technical documents
associated with MICREX-SX series.
URL http://www.fujielectric.com
Notes
1. This manual may not be reproduced in whole or part in any form without prior written approval by the manufacturer.
2. The contents of this manual (including specifications) are subject to change without prior notice.
3. If you find any ambiguous or incorrect descriptions in this manual, please write them down (along with the manual No.
shown on the cover) and contact FUJI.
Safety Precautions
Be sure to read the “Safety Precautions” thoroughly before using the module.
Here, the safety precautions items are classified into “Warning” and “Caution”.
Warning : Incorrect handling of the device may result in death or serious injury.
Caution : Incorrect handling of the device may result in minor injury or physical damage.
Warning
zz Never touch any part of charged circuits as terminals and exposed metal portion while the power is turned ON. It may
result in an electric shock to the operator.
zz Turn OFF the power before mounting, dismounting, wiring, maintaining or checking, otherwise, electric shock, erratic
operation or troubles might occur.
zz Place the emergency stop circuit, interlock circuit or the like for safety outside the PLC. A failure of PLC might break or
cause problems to the machine.
zz Do not connect in reverse polarity, charge (except rechargeable ones), disassemble, heat, throw in fire or short-circuit the
batteries, otherwise, they might burst or take fire.
zz If batteries have any deformation, spilled fluids, or other abnormality, do not use them. The use of such batteries might
cause explosion or firing.
zz Do not open the FG terminal with the LG-FG short circuited. (It must be grounded, otherwise it might cause electric shock.)
Safety Precautions
Caution
zz Do not use one found damaged or deformed when unpacked, otherwise, failure or erratic operation might be caused.
zz Do not shock the product by dropping or tipping it over, otherwise, it might be damaged or troubled.
zz Follow the directions of the operating instructions when mounting the product. If mounting is improper, the product might
drop or develop problems or erratic operations.
zz Use the rated voltage and current mentioned in the operating instructions and manual. Use beyond the rated values might
cause fire, erratic operation or failure.
zz Operate (keep) in the environment specified in the operating instructions and manual. High temperature, high humidity,
condensation, dust, corrosive gases, oil, organic solvents, excessive vibration or shock might cause electric shock, fire,
erratic operation or failure.
zz Select a wire size to suit the applied voltage and carrying current. Tighten the wire terminals to the specified torque.
Inappropriate wiring or tightening might cause fire, malfunction, failure, or might cause the product to drop from its mounting.
zz Contaminants, wiring chips, iron powder or other foreign matter must not enter the device when installing it, otherwise,
erratic operation or failure might occur.
zz Remove the dust-cover seals of modules after wiring, otherwise, fire, accidents, failure or fault might occur.
zz Connect the ground terminal to the ground, otherwise, an erratic operation might occur.
zz Periodically make sure the terminal screws and mounting screws are securely tightened.
Operation at a loosened status might cause fire or erratic operation.
zz Put the furnished connector covers on unused connectors, otherwise, failure or erratic operation might occur.
zz Install the furnished terminal cover on the terminal block, otherwise, electric shock or fire might occur.
zz Sufficiently make sure of safety before program change, forced output, starting, stopping or anything else during a run.
The wrong operation might break or cause machine problems.
zz Engage the loader connector in a correct orientation, otherwise, an erratic operation might occur.
zz Before touching the PLC, discharge any static electricity that may have been collected on your body. To discharge it, touch a
grounded metallic object. Static electricity might cause erratic operation or failure of the module.
zz Be sure to install the electrical wiring correctly and securely, observing the operating instructions and manual. Wrong or loose
wiring might cause fire, accidents, or failure.
zz When disengaging the plug from the outlet, do not pull the cord, otherwise, break of cable might cause fire or failure.
zz Do not attempt to change system configurations (such as installing or removing I/O modules) while the power is ON,
otherwise, failure or erratic operation might occur.
zz Do not attempt to repair the module by yourself contact your Fuji Electric agent. When replacing the batteries, correctly and
securely connect the battery connectors, otherwise, fire, accidents or failure might occur.
zz Clean this product after power-off using a towel that is moistened with lukewarm water and then wrung tightly. Do not use
thinner or other organic solvents, as the module surface might become deformed or discolored.
zz Do not remodel or disassemble the product, otherwise, a failure might occur.
zz Follow the regulations of industrial wastes when the device is to be discarded.
zz The modules covered in these operating instructions have not been designed or manufactured for use in equipment or
systems which, in the event of failure, can lead to loss of human life.
zz If you intend to use the modules covered in these operating instructions for special applications, such as for nuclear energy
control, aerospace, medical, or transportation, please consult your Fuji Electric agent.
zz Be sure to provide protective measures when using the module covered in these operating instructions in equipment which,
in the event of failure, may lead to loss of human life or other grave results.
zz External power supply (such as 24V DC power supply) which is connected to DC I/O should be strongly isolated from AC
power supply, otherwise, accident or failure might occur. (Use of EN60950 conforming power supply is recommended.)
zz Do not use this equipment in a residential environment.
Revision
* The manual No. is printed at the bottom right of the cover of this manual.
Mar. 2004 FEH225b • The content of "6-2 Wiring method" was reviewed.
• Wrong description in paragraph 3-2-7 was corrected.
• Communication specifications for "Modem loader" and "Programming loader" modes
were added to paragraph 2-3-2.
Sep. 2019 FEH225j • Widely revised reflecting the contents of the latest Japanese version.
(The suffix “j” is added to the manual No. in accordance with the Japanese version.)
Contents
Preface
Safety Precautions
Revision
Contents
Section 1 Overview
1-1 Overview...........................................................................................................................................1-1
1-2 Settings and Programs Necessary for Communication...............................................................1-2
1-3 Introduction to Standard Expansion FB...........................................................................................1-3
1-4 Product Versions and Supported Functions.................................................................................1-4
1-4-1 Supported functions........................................................................................................................................1-4
1-4-2 Available standard expansion FB....................................................................................................................1-4
Section 2 Specifications
2-1 General Specifications....................................................................................................................2-1
2-2 Communication Specifications.......................................................................................................2-2
2-3 Names and Functions......................................................................................................................2-3
2-3-1 Names.............................................................................................................................................................2-3
2-3-2 Functions........................................................................................................................................................2-4
2-4 Dimensions.......................................................................................................................................2-7
Section 5 Programming
5-1 Communication Program Creating Procedure..............................................................................5-1
5-2 Installing Standard Expansion FB..................................................................................................5-2
5-3 Registering FB in Library................................................................................................................5-3
5-4 Pasting Non-procedural FB.............................................................................................................5-4
5-5 Setting Communication Parameter................................................................................................5-5
5-6 Writing Send Data............................................................................................................................5-6
5-7 Connecting Variables and Instructions to FB Terminals..............................................................5-7
5-7-1 Connecting variable to “PARA” terminal.........................................................................................................5-7
5-7-2 Operation for starting FB.................................................................................................................................5-7
5-7-3 Operation for sending data.............................................................................................................................5-8
5-7-4 Operation for receiving data............................................................................................................................5-8
Section 6 Wiring
6-1 Precautions.......................................................................................................................................6-1
6-2 Wiring Method..................................................................................................................................6-2
6-2-1 When RS-485 is used (2-wire)........................................................................................................................6-2
6-2-2 When RS-485 is used (4-wire system)...........................................................................................................6-2
6-2-3 When RS-232C is used..................................................................................................................................6-3
6-3 SG and FG Terminals.......................................................................................................................6-4
Section 7 RAS
7-1 RAS Information of General Purpose Communication Module...................................................7-1
1-1 Overview..................................................................................................1-1
1-2 Settings and Programs Necessary for Communication......................1-2
1-3 Introduction to Standard Expansion FB................................................... 1-3
1-4 Product Versions and Supported Functions........................................1-4
1-4-1 Supported functions.........................................................................................1-4
1-4-2 Available standard expansion FB....................................................................1-4
Section 1 Overview
1-1 Overview
NP1L-RS1/2/4 are communication modules that are mounted on a MICREX-SX series base board to enable data communication
between a CPU module and external devices. (NP1L-RS1/2/4 will be hereinafter referred to as RS1/2/4.)
The table below shows the port type and the number of ports.
RS1
RS-232C
(1:1)
External
Power device
supply CPU I/O I/O I/O I/O
RS-485
(1:n) n = Max. 31
General purpose
communication module
I/O I/O I/O I/O
CPU
1-1
Section 1 Overview
MICREX-SX series
RS1/2/4
Power
supply CPU I/O I/O I/O I/O
• Initialization parameters for the RS-232C port and Set the selection switches on the module.
RS-485 port. • RS-485 station No. selection switch (0 to F)
(Settings such as transmission speed, data length, No need to set the switch if RS-485 port is not
parity bit, stop bit) used.
• Set the transmission speed, data length, parity bit, and stop bit.
• Application program for communication.
1-2
Section 1 Overview
Notes
1) See “Section 4 Software Interface” in this manual.
2) For _Cfrp2, _CfdFRN, _CfdFVR, _Cfvrpr, _CfdPYX, and _CfdPK, refer to the user’s manual “Standard Extended FB for
General Purpose Communication Module” (FEH255).
1-3
Section 1 Overview
Notes:
1) The modem-based loader function is the function which realizes remote operation and programming by connecting a
modem to the RS-232C port and using the public circuit. NP1L-RS4, which has only the RS-485 port, does not support
this functions.
2) For the “modem-based function 1,” the transmission rate between the module and a commercial modem is fixed to
19,200 bps. For the “modem-based function 2,” the transmission rate can be selected from 9600, 19200, and 38400 bps.
Notes:
1) This FB uses the RS-485 port. NP1L-RS2, which has only the RS-232C port, does not support this function.
2) This FB uses the RS-232C port. NP1L-RS4, which has only the RS-485 port, does not support this function.
1-4
Section 2 Specifications
Section 2 Specifications
2-4 Dimensions..............................................................................................2-7
Section 2 Specifications
2-1
Section 2 Specifications
Notes:
1) The use of the non-procedural FB allows this mode to be used like the full-duplex mode on applications.
2) Transmission rates 300, 600, 76800, and 115200 bps can be used in the following combinations:
2-2
Section 2 Specifications
78
4) RS-232C port
456
9 01
MODE
RS485
B c DE Nameplate
789A
(on the right side of the module)
F 0 12
No.
(0-F) 3 45 6
RS485
(2) NP1L-RS2
4) RS-232C port 78
456
9 01
MODE
Nameplate
(on the right side of the module)
RS232C
2-3
Section 2 Specifications
(3) NP1L-RS4
78
456
9 01
MODE
23
RS485
B c DE Nameplate
789A
(on the right side of the module)
F 0 12
No.
(0-F) 3 45 6
RS485
2-3-2 Functions
1) Status indication LED
These LEDs indicate the running status of NP1L-RS1/2/4.
NP1L-RS1
ONL RS232 TS1 Symbol Color Description
ALM RXD TXD
ERR RS485 TS2
ONL Green Turns on when the module is ready to communicate with the SX bus.
NP1L-RS4 RS232C TXD Green Turns on when data is being sent from the RS-232C port.
ONL TS1 RS485 ALM Red Turns on when the communication data via RS-485 is abnormal.
ALM RXD TXD
ERR RS485 TS2 RS485 RXD Green Turns on when the RS-485 port is receiving data.
RS485 TXD Green Turns on when data is being sent from the RS-485 port.
Blinks when internal RAM error is detected in self-diagnosis mode 7.
TS1 Green Blinks when RS-232C loopback test is abnormal in self-diagnosis
mode 8. (RST-CTS loopback error)
Blinks when RS-232C loopback test is abnormal in self-diagnosis
TS2 Green
mode 8. (DTR-DSR loopback error)
2-4
Section 2 Specifications
2) Mode selection switch
This switch is used to select a device to be connected, the signal conversion and the self-diagnosis for the RS-232C port and
the RS-485 port.
B CD E Mode
Switch
789A
F 0 12
Notes:
1) For the details of the function mode, see “3-2 System Configuration.”
2) For the self-diagnosis function, see “3-4 Self-diagnosis.”
3) “Programming loader” is the mode for connecting to D300win (or Standard loader). The communication specifications are
fixed to “38400bps” for transmission speed, “8 bits” for data length, “1 bit” for stop bits, and “even” for parity.
4) “Modem-loader" is the mode that is basically used to connect a loader via a modem. In general, for modems, “none” is
specified for the parity. Therefore, in this mode, the communication specifications become “8 bits” for data length, “1 bit” for
stop bits, and “none” for parity.
5) Select and use either one of the channels.
B CD E
RS485
7 89A
F 0 12
No.
(0–F)
3 456
* The RS-485 station No. selection switch does not relate directly to RS-485 communication regardless of the mode. (Invalid)
The setting of this switch can be read by an application program. Therefore, you can read the station No. setting by an
application program to compare it with the received message data of RS-485 communication, and then determine whether the
data is for the self station or not.
The station No. information is stored in “RAS information area + 1 word” (general purpose communication module status).
For the address assignment of the general purpose communication module status, see “4-6 RAS Information.”
However, for NP1L-RS5, the bit data assignment in one word is different from that of the other RS modules.
For the details of station No. information assignment of RS5, see “Appendix 4-7 Detailed RAS” in this manual.
2-5
Section 2 Specifications
4) RS-232C port
This port is a D-sub 9-pin female connector. Use a D-sub 9-pin male connector on the cable side.
9 2 RD ← Receive data
5
3 SD → Send data
4 ER → Data terminal ready
5 SG Signal ground (common return)
M2.6 6 DR ← Data set ready
Screw
7 RS → Request to send
8 CS ← Clear to send
9 RI ← Call indication
6) RS-485 port
This port is a D-sub 9-pin female connector. Use a D-sub 9-pin male connector on the cable side.
Notes:
For the wiring, see “6-2 Wiring Method.”
2-6
Section 2 Specifications
2-4 Dimensions
NP1L-RS1,NP1L-RS2 and NP1L-RS4 all have the same dimensions.
(90) (37) 90
(Note)
105
Note:
The front appearance depends on the type.
2-7
Section 3 System Configuration
3-4 Self-diagnosis........................................................................................3-10
3-4-1 Self-diagnosis mode 1...................................................................................3-10
3-4-2 Self-diagnosis mode 2................................................................................... 3-11
(1) RS to CS signal check.................................................................................. 3-11
(2) ER to DR signal check.................................................................................. 3-11
(3) RS-232C/RS-485 data check........................................................................ 3-11
(4) Preservation of the result of the check.......................................................... 3-11
Section 3 System Configuration
Mountable slots
Mountable slots
Note:
The general purpose communication modules cannot be mounted on base boards of a slave station such as DeviceNet or
Profibus.
DeviceNet interface module
3-1
Section 3 System Configuration
RS-232C
External device
* For RS1, the personal computer loader D300win can be connected to an RS-485 port which is not used.
In this case, set the mode selection switch to “2.”
RS-485 RS-232C
External device
Note:
Any other device than a loader (D300win) cannot be connected to the RS-485 port.
3-2
Section 3 System Configuration
RS-485
Note:
The external devices A , B and C must be the same in type as well as
communication protocol. For example, this connection is not available
when A and B are temperature controllers and C is a bar code reader.
* For RS1, the personal computer loader D300win can be connected to an RS-232C port which is not used.
In this case, set the mode selection switch to “1.”
RS-232C RS-485
3-3
Section 3 System Configuration
RS-485
Note:
The external devices A , B and C must be the same in type as well as
communication protocol. For example, this connection is not available
when A and B are temperature controllers and C is a bar code reader.
RS-232C
External device
3-4
Section 3 System Configuration
RS-485
RS1
Transmission speed is 38400 bps (default)
for both the RS-232C and RS-485 ports.
Use the user program (expansion FB) to
change the transmission speed
Power
supply CPU
RS-485
RS-232C
External device A
(personal computer, etc.)
3-5
Section 3 System Configuration
<2) Communication between external device A and the CPU module>
RS1
Power
CPU
supply
RS-485
RS-232C
External device A
(personal computer, etc.)
(Note) Note:
A user program for controlling the
external device A is necessary.
RS1
Note:
When the station No. designated in the send
data is the same as the setting of the RS-485
Power
CPU station No. selection switch of RS1, the FB in
supply
the CPU module receives the data.
RS-485
Note:
The external devices A , B and C must be the same in type as well as
communication protocol. For example, this connection is not available
when A and B are temperature controllers and C is a bar code reader.
3-6
Section 3 System Configuration
3-2-5 Configuration in which a loader is connected to the RS-232C port and RS-485 port
This configuration connects the personal computer loader D300win to each of RS-232C and RS-485 ports.
RS-232C RS-485
<Mode selection switch of System 1: 3> <Mode selection switch of System 2: 2>
RS1 RS1
Power Power
supply CPU supply CPU
RS-232C RS-485
3-7
Section 3 System Configuration
RS1 or RS2
RS-232C RS-485
Straight
cable External device External device External device
A B C
*
Modem Make the communication settings of the modem connected on
the module side as follows by using application software such as
"WINDOWS Hyper Terminal”
Stop bit: 1 Data length: 8 bits Parity: None
Modem
Baud rate: 9600/19200/38400/76800/115200 (set by the mode
selection switch of the module)
Set with Issue AT commands to perform the following:
D300win. • Restore the setting of the current value area to the factory default
setting.
• Do not perform the flow control.
• Set the number of rings until automatic receive of the modem to 3.
• Do not return the response code.
• Write the current modem setup condition to PROFILE 1).
• Use the contents of PROFILE 1) as the setting used when the
power is turned ON.
Example: AT&F&K0S0=3Q1&W0&Y0
Note:
For details, refer to the instruction manual supplied with the modem
used.
3-8
Section 3 System Configuration
CD 1) 1) CD
RD 2) 2) RD
SD 3) 3) SD
ER 4) 4) ER
SG 5) 5) SG
DR 6) 6) DR
RS 7) 7) RS
CS 8) 8) CS
RI 9) 9) RI
3-9
Section 3 System Configuration
3-4 Self-diagnosis
3-4-1 Self-diagnosis mode 1
Setting the mode selection switch of the module to “7” enables Self-diagnosis Mode “1.”
This mode is used to check the internal memory and the lighting condition of the LEDs.
<Diagnosis flow>
No
Normal?
Yes
Repeats Self-diagnosis Continues to blink if a RAM error
Mode operations when Checks the lighting of LEDs. is detected, and the LED lighting
there is no change in condition is not checked.
the status of the mode
selection switch.
TS1
TS2
RS485 ALM
RS232C ALM
1s 1s 1s 1s 10s
3-10
Section 3 System Configuration
CD 1) SDB 1)
RD 2) SDA 2)
SD 3) (SDB) 3)
ER 4) (SDA) 4)
SG 5) SG 5)
DR 6) FG 6)
RS 7) 7)
CS 8) RDB 8)
RI 9) RDA 9)
3-11
Section 4 Software Interface
4-1 Overview..................................................................................................4-1
4-2 Specifications for Non-procedural FB..................................................4-3
4-2-1 Communication specification...........................................................................4-3
4-2-2 FB format.........................................................................................................4-4
4-2-3 FB terminals.....................................................................................................4-5
4-3 Initialization.............................................................................................4-7
4-3-1 Initialization parameters...................................................................................4-7
4-3-2 Initialization procedure...................................................................................4-10
4-3-3 OPEN status list............................................................................................. 4-11
4-1 Overview
The non-procedural FB, which is included in the installation CD of the loader software, is used for communication between
NP1L-RS1/2/4 and external devices. The non-procedural FB performs data communication between the CPU module and
external devices based on the start-stop synchronous transmission protocol.
The following seven types of non-procedural FBs are available.
Notes:
1) _Cfrpr FB can be used with V2535 or later versions of NP1L-RS1, JP1L-RS2, and NP1L-RS4. The functions of the
non-procedural FB are shown below.
2) _Cfrp2 FB can be used with V2536 or later versions of NP1L-RS1, JP1L-RS2, and NP1L-RS4. For the specifications of
_Cfrp2, refer to the user’s manual FEH255 (for D300win) or FEH589 (for Standard).
General purpose
CPU module communication module
Application program
Non-procedural
FB
1)
External device
2) 3)
4-1
Section 4 Software Interface
<FB operating conditions>
System configuration:
One FB is necessary for each external device which is connected by RS-232C or RS-485 to one general purpose
communication module. However, when RS-232C/RS-485 signal conversion is enabled (the mode selection switch is set to 4)
for the general purpose communication module, each FB is used by two channels.
External device
connected to
RS-485
* When used in RS-232C/RS-485 conversion mode, channel No. for the parameter (PARA [1]) is 1 (= RS-485).
Memory capacity:
Notes:
1) The above memory capacity includes that of non-procedural FB itself as well as of the sub-FB which is called from the
non-procedural FB.
2) “Standard memory” or “Retain memory” includes the memory capacity necessary for data transmission.
4-2
Section 4 Software Interface
Note:
The transmission rates 300, 600, 76800, and 115200 bps can be used in the following combinations:
4-3
Section 4 Software Interface
4-2-2 FB format
Input terminal name Output terminal name
_C_free (Note 1)
Notes:
1) All non-procedural FBs have the same pin arrangement.
2) Only the FB pins necessary for control are used by connecting variables to them. However, be sure to connect variables to
the IN-OUT pins.
4-4
Section 4 Software Interface
4-2-3 FB terminals
<Terminal list>
FB terminal
Terminal name Data type I/O Description
name
OPEN BOOL IN ON: Sends the "communication parameters" to the general
purpose communication module to initialize communication.
When the FB is ready for communication, "communication
Open
ready" turns ON.
OFF: Performs the processing for ending communication.
"Communication ready" turns OFF.
S_REQ BOOL IN Starts to send data. When the sending is completed, turn this
Send request
terminal OFF by an application program.
Send data length S_LEN INT IN Specify the length of send data by the number of bytes.
Array of WORD IN_OUT Store send data.
Send data S_DAT
(Note)
Communication PARA Array of INT IN Store the initialization parameters.
parameter (Note)
Communication OK BOOL OUT Turns ON when initialization is completed normally to indicate that
ready the FB is ready for sending/receiving data.
Open status O_STS WORD OUT Outputs 2-digit hexadecimal code to indicate the result of initialization.
Send end S_END BOOL OUT Turns ON when the sending is completed.
Send error S_ERR BOOL OUT Turns ON if a send error occurs.
Send status S_STS WORD OUT Outputs a code to indicate the result of sending
Receive end R_END BOOL OUT Turns ON when the receiving is completed.
Receive error R_ERR BOOL OUT Turns ON if a receive error occurs.
Receive status R_STS WORD OUT Outputs a code to indicate the result of receiving
Receive data R_LEN INT OUT Outputs the received data length.
length
R_DAT Array of WORD IN_OUT Stores received data.
Receive data
(Note)
RS-485 station STN_NO INT OUT Outputs the status of the RS-485 station No. selection switch of the
No. general purpose communication module.
RAS Structure IN_OUT Stores operating information of the FB.
RAS information
(Note) For details, see " 4-6 RAS Information."
Note:
The data format differs for each non-procedural FB.
FB Name Data type of S_DAT S_DAT [63] Data 128 Data127 Up to here is assigned to _Cfr64
_C_free _C_SND_TYP11 ⁞ ⁞ ⁞
_Cfr252 _C_SND_TYP16 S_DAT [127] Data 256 Data255 Up to here is assigned to _Cfr128
_Cfr128 _C_SND_TYP14 ⁞ ⁞ ⁞
_Cfr64 _C_SND_TYP13 S_DAT [251] Data 504 Data503 Up to here is assigned to _Cfr252
_Cfr32 _C_SND_TYP15 ⁞ ⁞ ⁞
_Cfrpr _C_SND_TYP11PR S_DAT [511] Data 1024 Data1023 Up to here is assigned to _C_free, _Cfrpr
4-5
Section 4 Software Interface
<Receive data R_DAT (WORD array)> Upper order Lower order
<Variable declaration example (_C_free)>
R_DAT [0] Data 2 Data 1
VAR R_DAT [1] Data 4 Data 3
R_DAT:_C_RCV_TYP11;
⁞ ⁞ ⁞
END_VAR
R_DAT [31] Data 64 Data63 Up to here is assigned to _Cfr32
<Data type list> ⁞ ⁞ ⁞
FB Name Data type of R_DAT R_DAT [63] Data 128 Data127 Up to here is assigned to _Cfr64
_C_free _C_RCV_TYP11 ⁞ ⁞ ⁞
_Cfr252 _C_RCV_TYP16 R_DAT [127] Data 256 Data255 Up to here is assigned to _Cfr128
_Cfr128 _C_RCV_TYP14 ⁞ ⁞ ⁞
_Cfr64 _C_RCV_TYP13 R_DAT [251] Data 504 Data503 Up to here is assigned to _Cfr252
_Cfr32 _C_RCV_TYP15 ⁞ ⁞ ⁞
_Cfrpr _C_RCV_TYP11PR R_DAT [511] Data 1024 Data1023 Up to here is assigned to _C_free, _Cfrpr
4-6
Section 4 Software Interface
4-3 Initialization
4-3-1 Initialization parameters
To initialize each port of the general purpose communication module, set values which match the communication specifications
of the target external device in the communication parameters. The table below shows the setting contents of the parameters.
4-7
Section 4 Software Interface
0: Calculates the text part and inserts it ahead of the end code
1: Calculates text part and end code and inserts them behind the end code.
32 Calculation range, position 2: Calculates start code and text part and inserts them ahead of the end code.
3: Calculates start code, text part and end code and inserts them behind the end code.
Note: In this case, the BCC code type cannot be designated as “binary.”
Specify other than CRC-16 for the BCC expression.
4-8
Section 4 Software Interface
0: Add
D1 + D2 + ... + Dn
2: EOR
D1 EOR D2 EOR ... EOR Dn
3: CRC * When CRC is selected, specify "BCC Code Format" to "0: Binary."
CRC-16 : X16+X15+X2+1
Notes:
1) Changes to the parameter Nos. 16 to 35 take effect even if after the port opens.
After the port opens, if parameter Nos.16 to 35 are changed and a setting error occurs, or if other parameters are changed,
an open error occurs and communication ready “OK” turns OFF.
2) If you select “EBCDIC” for parameter No.16 and/ or 34, make sure to select “8 bits” for parameter No. 5.
3) If an error occurs while receiving data, the general purpose communication module discards the data. We recommend to
use No. 6 (Parity) or No. 31 (BCC) to detect receive data errors if you use the module under a noise environment. In this
case, the target external device must support the BCC and parity .
4) “ER/DR signal control” is only enabled for RS-232C. Set 0 for RS-485.
• 0: When ER/DR signal control is disabled
No ER/DR signal control is performed. (The ER signal output remains OFF.)
• 1: When ER/DR signal control is enabled
When initialization is completed and the FB becomes ready for communication (the “OK” output of the FB is ON), the
“ER” (DTR) output terminal (No.4 pin) turns from OFF to ON. If the wire of this terminal is connected to the DR (DSR)
input terminal (No. 6 pin) of the target device (general cross cable connection), the self station can let the target device
know that it has become ready for communication through hardware.
5) The table below shows the correspondence between the port No. specified by "PARA" and the port of the hardware.
Port No.
Type
0 1
NP1L-RS1 (RS-232C × 1ch, RS-485 × 1ch) RS-232C port RS-485port
NP1L-RS2 (RS-223C × 1ch) RS-232C port -
NP1L-RS3 (RS-232C × 2ch) RS-232C CH1 RS-232C CH2
NP1L-RS4 (RS-485 × 1ch) - RS-485 port
NP1L-RS5 (RS-485 × 2ch) RS-485 CH1 RS-485 CH2
6) Only when the frame detection is set to "1: Variable length," the initialization parameters No.19 to No.34 are enabled. These
parameter settings are applied to both data receiving and sending.
When the frame detection is set to "0: None" or "2: Fixed length," the above initialization parameters No.19 to No.34 are
disabled.
4-9
Section 4 Software Interface
(Note)
Open (OPEN)
Initialization processing
Port close processing
4-10
Section 4 Software Interface
4-11
Section 4 Software Interface
Sending processing
Send end (S_END)
Set send data and its data length, and turn ON "Send request" (S_REQ) by an application program. The FB detects the rising
edge to execute the sending processing.
When the sending is completed, the "Send end" (S_END) flag turns ON (for only one scan). If a send error occurs, "Send end"
(S_END) and "Send error" (S_ERR) turn ON (for only one scan), and the FB outputs the corresponding error code to "Send
status" (S_STS). (“00” when the sending is completed normally).
4-12
Section 4 Software Interface
4-13
Section 4 Software Interface
While the "Communication ready" flag (OK) is ON, the FB continuously checks whether the data to be received exists or not
and, when it exists, executes receiving processing. When a delimiter between data frames is detected, the received data and
the number of receive data bytes are stored in "Receive data" (R_DAT) and "Receive data length" (R_LEN) respectively, and
the "Receive end" flag (R_END) turns ON (for only one scan). The result of receiving is stored in "Receive status" (R_STS). If a
receive error occurs, "Receive end" (R_END) and "Receive error" (R_ERR) turn ON (for only one scan).
4-14
Section 4 Software Interface
Notes:
1) Receiving conditions
The receiving processing differs depending on the setting of parameter “Frame detection.”
None: Receiving is completed when data has been received.
Fixed length: Receiving completed when receive data has reached the specified number of receive data bytes.
Variable length: Receiving is completed when the data in a range between start and end codes has been received.
2) To confirm the detected error of M_SEND and M_RECEIVE (error code), check the RAS information in the "RAS" terminal
(structure) in the FB.
For the details of the error code of M_SEND and M_RECEIVE, refer to the user's manual "Instructions."
4-15
Section 4 Software Interface
For D300win
For Standard (INT-type
2-dimensional array)
4-16
Section 4 Software Interface
• Port status
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RS signal
CS signal
DR signal These signals are valid when RS-232C port is
used and reserved when RS-485 port is used.
ER signal
CD signal
CI signal
Initialization end
Reserved
Send error
Receive error
Framing error
Overrun
Parity error
Reserved
Reserved
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
4-17
Section 5 Programming
Section 5 Programming
5-1
Section 5 Programming
5-2
Section 5 Programming
1) Right-click [Libraries] in a subtree of the project tree, and then select [Insert] > [User Library]. The “Insert library” dialog box
opens.
2) Select an FB (filename) which you want to register in the library, and click the [Insert] button.
3) The FB is registered in the library, as shown in the figure below.
Note:
The common FB “_C_COM” is required for using any communication FB. “_C_COM” is used inside each expansion
communication FB. No need to call and use it on the code worksheet.
4) The FBs in the project that you have registered in the library can be selected on the “Edit Wizard” window. In this case, sub
FBs (FBs which start with “C” such as _CBCCI) used inside _C_free or other expansion communication FBs are also
displayed. However, use only parent FBs (such as _C_free) on the code worksheet.
5-3
Section 5 Programming
Code worksheet
Double-click here.
2) In the [View] menu, click [Edit Wizard]. The “Edit Wizard” window opens.
Select <_C_free> from the “Group” list, and then double-click “_C_free” from the FBs listed below.
The “_C_free” FB is pasted on the code worksheet.
5-4
Section 5 Programming
IF PSET THEN
PARA[0] := INT#1; (*SX station No.*)
PARA[1] := INT#0 ; (*SX station No.*)
PARA[2] := INT#50 ; (*Message port No.*)
PARA[4] := INT#3 ; (*Transmission speed: 9600 bps*)
PARA[5] := INT#1 ; (*8 bits*)
PARA[6] := INT#1 ; (*Even parity*)
PARA[7] := INT#1 ; (*Stop bit: 1*)
PARA[8] := INT#0 ; (*DTE designation*)
PARA[9] := INT#1 ; (*Signal control*)
PARA[10] := INT#0 ; (*Signal flow control: None*)
PARA[11] := INT#1 ; (*XON/XOFF control: None*)
PARA[16] := INT#0 ; (*Code conversion: None*)
PARA[17] := INT#1 ; (*Frame detection variable length*)
PARA[18] := INT#0 ; (*Received bytes: Variable length*)
PARA[19] := INT#1 ; (*Number of starting code bytes: 1*)
PARA[20] := INT#2 ; (*Start code: STX*)
PARA[25] := INT#1 ; (*Number of end code bytes: 1*)
PARA[26] := INT#2 ; (*End code: ETX*)
PARA[31] := INT#1 ; (*BCC: none*)
PARA[34] := INT#1 ; (*Code type: ASCII*)
PARA[35] := INT#1000 ; (*Send timer: 10 s*) Set the start and end codes by INT type, too.
For example, when you want to set “:” for the
PSET := FALSE ;
start code, it is represented as “INT16#003A”
END_IF or “INT#58” because the code for “:” is “3A.”
After parameter values are set, the flag is set to “FALSE” so that the
above setting processing is not be executed from the next scan.
5-5
Section 5 Programming
IF SSET THEN
SDAT[0] := WORD#16#0000 ;
SDAT[1] := WORD#16#0001 ;
SDAT[2] := WORD#16#0002 ;
SDAT[3] := WORD#16#0003 ;
SDAT[4] := WORD#16#0004 ;
SDAT[5] := WORD#16#0005 ;
SDAT[6] := WORD#16#0006 ;
SDAT[7] := WORD#16#0007 ;
SDAT[8] := WORD#16#0008 ;
SSET := FALSE ;
END_IF
After setting all necessary values, set the flag to “FALSE” so that the
above setting processing is not be executed from the next scan.
5-6
Section 5 Programming
_C_free
BOOL OPEN OK BOOL
S_ERR BOOL
S_STS WORD
R_END BOOL
R_ERR BOOL
R_STS WORD
R_LEN INT
STN_NO INT
RAS Structure
PARA PARA
Because data has been assigned to the array data type variable “PARA” in “5-5 Setting Communication
Parameter”, connection is completed only by writing the variable name “PARA” at the terminal.
FB starting condition
(Note) _C_free
PSET
OPEN
S_REQ Note:
FB starting conditions need to be
PSET is a flag which is programmed S_LEN programmed such that the ON status is kept.
to turn OFF when parameter setting
ends. See “<Example of setting
program>” in 5-5.
5-7
Section 5 Programming
Send condition After confirming that the data has been written, turn ON the send request.
OPEN OK OK_F
SSET OK_F
S_REQ O_STS
S_ERR
18 bytes (9 words) for the example
in “5-6 Writing Send Data.” S_STS
R_END
R_ERR
R_STS
Connect variable SDAT in which
data has been written in “5-6 R_LEN
Writing Send Data.”
STN_NO
SDAT S_DAT
Note:
When data sending is completed, the send end flag “S_END” turns ON only for one scan. If a send error occurs, the send error
flag “S_ERR” turns ON only for one scan.
As the content of sending error is stored in the send status “S_STS,” judge the occurred error according to the S_STS data
stored when S_ERR turns ON.
R_END REND
R_ERR RERR
R_STS RSTS
R_LEN
Received data is processed
STN_NO using the output of “R_END”
and “R_ERR.”
S_DAT REND RERR
to processing of received data
R_DAT RDAT
5-8
Section 6 Wiring
Section 6 Wiring
6-1 Precautions..............................................................................................6-1
6-2 Wiring Method.........................................................................................6-2
6-2-1 When RS-485 is used (2-wire).........................................................................6-2
6-2-2 When RS-485 is used (4-wire system)............................................................6-2
6-2-3 When RS-232C is used...................................................................................6-3
6-1 Precautions
(1) Before removing the connector, remove the fixing screws.
(2) Communications cables must be isolated from high-voltage cables and power cables as far as possible.
Communication cables must not be run parallel with those cables.
(3) These cables should be installed as shown in the following figure. Shielding cables should be used.
Communication cables
1)
300mm or more
Lower power cables
2)
1) RS-232C,RS-485
300mm or more communication cables.
2) Input/output circuit. Power
Control cables
supply circuit for PLC.
3) Control circuit
3)
4) Power circuit
300mm or more
Power cables
4)
Metal plate
Grounding
(Grounding resistance of 100 or less)
200mm or more
Communication cables Lower power cables Control cables Power cables
1) 2) 3) 4)
Grounding
(Grounding resistance of 100 or less)
6-1
Section 6 Wiring
RDA (+) 9)
RDB (-) 8) In order to obtain the proper shielding effect, the
shielding wire needs to extend in the connector
FG 6) cover and be connected properly to the terminal.
* To set a terminating resistor for a 2-wire system, change the “RS-485 Terminating resistor ON/OFF” switch to “1”(left side when
facing the front panel).
FG 6)
Note:
Precaution when there is no SG terminal on the external device
SG wire cannot be connected if there is no SG terminal on the external device. Depending on the ambient environment, in the
worst, module internal element might be damaged. To avoid this, connect a Zener diode (of 6V Zener voltage, RD6.2F from
NEC or equivalent) between signal cable and SG terminal in the connector on this module side.
When 2-wire
* RS1, RS4 V2738 or later version has built-in zener diode.
SDA (+) 2) RS5 has zener diode.
SDB (-) 1) When 4-wire
SG 5)
RDA (+) 9)
RDB (-) 8)
6-2
Section 6 Wiring
Receive data RD 2)
Send data SD 3)
Communication ready CS 8)
(Note)
Send request RS 7) Connect as
necessary on
Signal ground SG 5) the external
device side.
Data set ready DR 6)
Data channel
Carrier detection CD 1)
Call indication Ri 9)
Notes:
1) Generally, a plastic cover is used for connection as shown in the above figure.
Commercially available plastic cover: 1) DE-C4-J6 from JAE
2) HDE-CTF or HDE-CTF1 from Hirose Electric Co., Ltd.
Or their equivalent
2) When the on-site operating environment requires stricter EMC measures, it is more effective to make this cable using
commercially available metallic covers.
Metallic cover: 1) DE-CE-J6 from JAE (aluminum die cast)
2) HDB-CTH1 from Hirose Electric (Ni coated plastic)
3) 17JX-09H-1A from DDK, Ltd. (Ni coated plastic)
Or their equivalent
6-3
Section 6 Wiring
1) For RS-232C
In NP1L-RS1/RS2/RS4/RS5, the SG and FG (metal part of the outer periphery of the RS-232C connector) are isolated by
photocoupler.
In NP1L-RS3, the SG and FG (metal part of the outer periphery of the RS-232C connector) terminals of RS-232C are internally
connected. In addition, the above FG and the FG terminal of the power supply module are internally connected via the SX bus
0V in the base board.
2) For RS-485
In all the types that have RS-485 (NP1L-RS1/RS4/RS5), the SG and FG terminals are isolated by photocoupler.
In addition, the above FG and the FG terminal of the power supply module are internally connected via the SX bus 0V in the
base board.
6-4
Section 7 RAS
Section 7 RAS
To external device
Click here.
7-1
Section 7 RAS
3) On the [System RAS] tab window, information such as the module type, software version No., and module operation status is
displayed.
4) On the [Bus transmission] tab widow, the operation status of the SX bus is displayed.
7-2
Section 7 RAS
5) On the [Dump list] tab window, the operation status of the general purpose communication module is displayed.
0000 : 1000 9000 0000 0000 0000 0000 0000 0000 No.15
0008 : 1000 0000 0000 0000 0000 0000 0000 0000 No.23
0010 : 1000 0000 0000 0000 0000 0000 0000 0000 No.31
0018 : 1000 0000 0000 0000 0000 0000 0000 0000
* One word (16 bits) represents each detailed RAS item. The detailed RAS corresponding to each number is shown below.
7-3
Section 7 RAS
• RS-232C/RS-485 port status
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RS signal
CS signal
These signals are valid when RS-232C port is
DR signal
used and reserved when RS-485 port is used.
ER signal
CD signal
CI signal
Initialization end
Reserved
Send error
Receive error
Framing error
Overrun Note:
Parity error If a framing error, overrun error, or parity error
Reserved occurs, modules earlier than V2535 go into a
Reserved module nonfatal fault condition while modules
Reserved V2535 or later do not.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
• Framing error: ON when stop bit is not detected while receiving data.
• Overrun error: ON when data receiving processing of the firmware in the general purpose communication module fails while
receiving data.
• Parity error: ON when a parity error is detected while receiving data.
These error bits remain ON until the module is initialized again or power is turned off and on again.
7-4
Appendix 1 JIS7/8 Bit Code Table
b7 0 0 0 0 1 1 1 1
b6 0 0 1 1 0 0 1 1
b5 0 1 0 1 0 1 0 1
b4 to b1 0 1 2 3 4 5 6 7
0000 0 NUL TC7(DLE) SP 0 @ P , p
0001 1 TC1(SOH) DC1 ! 1 A Q a q
0010 2 TC2(STX) DC2 " 2 B R b r
0011 3 TC3(ETX) DC3 # 3 C S c s
0100 4 TC4(EOT) DC4 $ 4 D T d t
0101 5 TC5(ENQ) TC8(NAK) % 5 E U e u
0110 6 TC6(ACK) TC9(SYN) & 6 F V f v
0111 7 BEL TC10(ETB) ' 7 G W g w
1000 8 FE0(BS) CAN ( 8 H X h x
1001 9 FE1(HT) EM ) 9 I Y i y
1010 10 FE2(LF) SUB * : J Z j z
1011 11 FE3(VT) ESC + ; K [ k {
1100 12 FE4(FF) IS4(FS) , < L ¥ l |
1101 13 FE5(CR) IS3(GS) - = M ] m }
1110 14 SO IS2(RS) . > N ` n ‾
1111 15 SI IS1(US) / ? O _ o DEL
b8 0 0 0 0 0 0 0 0
b7 0 0 0 0 1 1 1 1
b6 0 0 1 1 0 0 1 1
b5 0 1 0 1 0 1 0 1
b4 to b1 0 1 2 3 4 5 6 7
0000 0 NUL TC7(DLE) SP 0 @ P p
0001 1 TC1(SOH) DC1 ! 1 A Q a q
0010 2 TC2(STX) DC2 " 2 B R b r
0011 3 TC3(ETX) DC3 # 3 C S c s
0100 4 TC4(EOT) DC4 $ 4 D T d t
0101 5 TC5(ENQ) TC8(NAK) % 5 E U e u
0110 6 TC6(ACK) TC9(SYN) & 6 F V f v
0111 7 BEL TC10(ETB) ' 7 G W g w
1000 8 FE0(BS) CAN ( 8 H X h x
1001 9 FE1(HT) EM ) 9 I Y i y
1010 10 FE2(LF) SUB * : J Z j z
1011 11 FE3(VT) ESC + ; K [ k {
1100 12 FE4(FF) IS4(FS) , < L ¥ l |
1101 13 FE5(CR) IS3(GS) - = M ] m }
1110 14 SO IS2(RS) . > N ` n ‾
1111 15 SI IS1(US) / ? O _ o DEL
App.1-1
Appendix 2 Data Access by Command
Note:
When the “CPU batch initialize and start” command or “CPU individual initialize and start” command is executed, the retain
memory is cleared when the CPU starts.
* Set the mode selection switch of the general communication module to "1".
Request command
Response command
CPU module
App.2-1
Appendix 2 Data Access by Command
Processing status
Connection mode
Connection ID (L)
Command part Connection ID (H)
Command header (16 bytes)
+ (11h fixed)
Data part
(00h fixed)
(00h fixed)
(00h fixed)
(00h fixed)
(00h fixed)
Command
Mode
(00h fixed)
(01h fixed)
Data
2) Data counter
Indicates the number of bytes of the command part + the check part (BCC) (1 byte).
3) Processing status
Indicates the execution result of each processing requested by the command. The processing status is checked by the response
command. Request commands are issued with the processing status fixed to “FFh.”
App.2-2
Appendix 2 Data Access by Command
<Status list>
* In cases other than redundant mode, you can also access CPU0 by setting the connection mode to “7Ah” and the connection
ID to “00h.”
5) Command, mode
Command: Indicates the major classification code of the command
Mode: Indicates the detail code of the command
For the details of commands and modes, see “Appendix 2-3 Details of Loader Commands.”
App.2-3
Appendix 2 Data Access by Command
2) Command/mode code
Command: 00h, Mode: 00h
App.2-4
Appendix 2 Data Access by Command
<Memory type code>
The table below shows the memory type codes for individual MICREX-SX internal memories.
Notes:
1) When accessing the broadcast area of the PE-link module by a command, the address does not begin with 0.
See the following address correspondence table.
2) When accessing the broadcast area of the P-link module by a command, the high-speed bit area, high-speed word area,
and low-speed word area are not consecutive. See the following address correspondence table.
App.2-5
Appendix 2 Data Access by Command
2) Command/mode code
Command: 01h, Mode: 00h
App.2-6
Appendix 2 Data Access by Command
2) Command/mode code
Command: 04h, Mode: 00h
2) Command/mode code
Command: 04h, Mode: 01h
2) Command/mode code
Command: 04h, Mode: 02h
App.2-7
Appendix 2 Data Access by Command
2) Command/mode code
Command: 04h, Mode: 03h
2) Command/mode code
Command: 04h, Mode: 04h
App.2-8
Appendix 2 Data Access by Command
2) Command/mode code
Command: 04h, Mode: 06h
2) Command/mode code
Command: 04h, Mode: 07h
App.2-9
Appendix 3 Additional Description of NP1L-RS3
Appendix 3
Additional Description of NP1L-RS3
Item Specification
Isolation method Not isolated
Internal current consumption 110mA or less
Mass Approx. 140g
App.3-1
Appendix 3 Additional Description of NP1L-RS3
Mode
Switch No. Remark
CH1 CH2
0 General purpose device General purpose device
1 Programming loader General purpose device
2 General purpose device Programming loader
3 Programming loader Programming loader
4 Not used
5 Not used
Modem-loader
6 General purpose device
19200 bps
7 Self-diagnosis mode 1 (internal memory / LED diagnosis)
8 Self-diagnosis mode 2 (CH1/CH2 loopback diagnosis)
Modem-loader
9 Programming loader
19200 bps
Modem-loader
A General purpose device
9600 bps
Modem-loader
B Programming loader
9600 bps
Modem-loader
C General purpose device
38400 bps
Modem-loader
D Programming loader
38400 bps
Modem-loader
E General purpose device
76800 bps
Modem-loader Modem-loader
F
115200 bps 115200 bps
3) RS-232C port
The connector shape and pin arrangement are the same as those of NP1L-RS2.
For NP1L-RS3, SG (Pin No. 5) and FG (RS-232C connector fixing screw) are internally connected. Generally, connect the shield
wire of RS-232C cable to FG of RS3. However, if communication fails due to noise, connect the shield wire of RS-232C cable to
both FG of RS3 and FG of the external device (Ground on both device).
App.3-2
Appendix 3 Additional Description of NP1L-RS3
App.3-3
Appendix 3 Additional Description of NP1L-RS3
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
App.3-4
Appendix 4 Additional Description of NP1L-RS5
Appendix 4
Additional Description of NP1L-RS5
Item Specification
Internal current consumption 110mA or less
Mass Approx. 190g
MODE
B cD E
7 89 A
F 0 12
3 45 6
ON 1 2
MSB
CH1
CH2
B cD E
CH1
7 89 A
No. 3 45 6
selection switch
B cD E
CH2
7 89 A
F 0 12
No. 3 45 6
Terminating resistor
ON/OFF switch Common to CH1 and CH2
SDA RS-485 terminals block
SDB
RDA
CH1
RDB
SG
FG
SDA
SDB
RDA
CH2
RDB
SG
FG
NP1L-
RS5
App.4-1
Appendix 4 Additional Description of NP1L-RS5
Mode
Switch No. Remark
CH1 CH2
0 General purpose device General purpose device
1 Programming loader General purpose device
2 General purpose device Programming loader
3 Programming loader Programming loader
4 Not used
5 Not used
Modem-loader
6 General purpose device
19200 bps
7 Self-diagnosis mode 1 (internal memory / LED diagnosis)
8 Self-diagnosis mode 2 (CH1/CH2 loopback diagnosis)
Modem-loader
9 Programming loader
19200 bps
Modem-loader
A General purpose device
9600 bps
Modem-loader
B Programming loader
9600 bps
Modem-loader
C General purpose device
38400 bps
Modem-loader
D Programming loader
38400 bps
Modem-loader
E General purpose device
76800 bps
Modem-loader Modem-loader
F
115200 bps 115200 bps
App.4-2
Appendix 4 Additional Description of NP1L-RS5
3) RS-485 station No. selection switch
This switch is used to set the RS-485 station No. for CH1 and CH2 individually. Range: 00 to 1F (HEX)
ON 1 2
MSB
CH1
CH2
B c DE
CH1
789A
F 0 12
No. 3 456
B c DE
CH2
789A
F 0 12
No. 56 3
Signal direction
Signal name Description
RS5 External device
SDA → Send data signal line (+)
Not used
SDB → Send data signal line (-)
RDA ← Receive data signal line (+)
RDB ← Receive data signal line (-)
SDA
SDB
RDA
CH1
RDB SG Signal ground (Common return)
SG
FG FG Frame ground
SDA
SDB
RDA
CH2
RDB
SG
FG
App.4-3
Appendix 4 Additional Description of NP1L-RS5
App.4-4
Appendix 4 Additional Description of NP1L-RS5
F E D C B A 9 8 7 6 5 4 3 2 1 0
Mode switch (x 8)
Mode switch (x 4)
Mode switch (x 2)
Mode switch (x 1)
Reserved
CH1 station No.
CH2 station No.
• The following information is added to No. 4 (Self-diagnosis result 1) and No. 5 (Self-diagnosis result 2) in the unused area of
the detailed RAS. (Almost same as NP1L-RS3 specification)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Not used
Not used
Not usedl
Not used
Not used
Not used
Not used
Not used
Not used
Not used
Not used
Not used
CH1 Send/Receive data abnormal (SD RD) (Send data error detected)
CH1 Loop back abnormal (SD RD) (Communication error detected)
CH2 Send/Receive data abnormal (SD RD) (Send data error detected)
CH2 Loop back abnormal (SD RD) (Communication error detected)
App.4-5
Appendix 5 Supplemental Description of CRC-16
Appendix 5
Supplemental Description of CRC-16
<F.Y.I.>
Calculation of CRC-16 is performed by the following logic. (C-language sample program)
USHORT C_BCC_Cal( USHORT PNT_s, USHORT PNT_e, UCHAR BCC_Type,UCHAR RS_Data[], USHORT DATA_Size )
{
UCHAR wk1, wk2;
USHORT BCC = 0;; /* BCC calculation result*/
USHORT lp1, pnt1;
BCC = 0xffff;
pnt1 = PNT_s;
while ( 1 ) {
wk1 = RS_Data[pnt1*2];
BCC ^= wk1; /* Formula:CRC */
for( lp1=0; lp1<8; lp1++ ) {
wk2 = BCC & 0x01;
BCC = BCC >> 1;
if( wk2 == 1 ) {
BCC ^= 0xa001;
}
}
}
pnt1++;
if( DATA_Size <= pnt1 )
pnt1 = 0;
if( pnt1 == PNT_e ) break; /* Data end */
}
App.5-1
Appendix 6 Mounting Modules on T-link Expansion
Appendix 6
Mounting Modules on T-link Expansion
Power
CPU TL1
supply
T-link
Power
RT1 RS
supply
App.6-1
Appendix 6 Mounting Modules on T-link Expansion
For the CPU type, SPH300, SPH2000 and SPH3000 support this function, however, SPH200 and SPH3000MM do not.
CPUs other than SX series (such as MICREX-F series CPUs) also do not support it.
T-link master can be used in any of the following modes: normal mode, T-link expansion mode, and I/O extension mode.
24
48
App.6-2
Appendix 6 Mounting Modules on T-link Expansion
Standard
App.6-3
Appendix 6 Mounting Modules on T-link Expansion
<Difference from _Cfree>
The number of FB terminals and the meaning of each terminal are almost same as those of _Cfree. This section describes the
difference only.
For the details of how to use _Cfree, refer to the following user’s manuals.
• For D300win: This manual and FEH255
• For Standard: FEH589
Communication parameter
0th word (station No. of general purpose communication module)
Set the SX bus station No. of the TL1.
1st word (Port No.)
Assigned as shown below:
F E D C B A 9 8 7 6 5 4 3 2 1 0
1 RS station No. Port to be used
RS station No.: Set the RS station No. by converting the T-link remote I/O station No. of the RS module (00 to 99) set in
the system definition to a hexadecimal value (00 to 63).
Port to be used: Set the FB port No.
For RS232C: 0
For RS-485: 1
In the case of a module with two ports (NP1L-RS3, NP1L-RS5),
For CH1: 0
For CH2: 1
RAS information
For the RAS information, an area of 1575 words is occupied.
Secure a free space of 1578 words in the memory.
The figure below shows the memory allocation.
Start address +0
• Work area for sending
• (267 words)
Start address +266
Start address +267
• Work area for receiving
• (267 words)
Start address +533
Start address +534
• Receive buffer area
• (512 words)
Start address +1045
Start address +1046
• Send buffer area
• (512 words)
Start address +1557
Start address +1558
• RAS area
• (20 words)
Start address +1577
App.6-4
Appendix 6 Mounting Modules on T-link Expansion
<Open request processing of FB>
Issue an open request of the FB after RT1 is started up.
Confirm that RT1 is started up by checking the remote I/O master module configuration information in the system memory.
The address of the remote I/O configuration information is as follows.
• For D300win: From %MX10.128.0
• For Standard: From SM1280
If RT1 is disconnected due to, for example, a power failure, and then restarted after the power supply is turned on again,
re-execute open processing. It may take up to approximately 40 seconds to complete open processing depending on the timing
of re-execution.
RT1_configuration_flag Open_retry_request Open_request (*When the circuit No. of TL1 is 0 and the station
No. of RT1 is 0, the RT1 configuration flag is
%MX10.128.0.*)
Open_request
Open_request Open_request_memory
Open_request_memory
Open_OK Open_retry_request
Open_request Open_OK
Send_request Open_status
Send_byte_length Send_end
App.6-5
Appendix 6 Mounting Modules on T-link Expansion
<Example for Standard>
Open request
Open request
memory
App.6-6
Appendix 6 Mounting Modules on T-link Expansion
Number of
Note
mountable RS modules
RT1 (per base) 10 The number of modules that can be mounted on one RT1 base
The number of usable ports is limited.
TL1 can open up to 5 ports on one T-link system simultaneously.
The number of M_OPEN/R_READ/R_WRITE and communication FBs
16 dedicated to the RS module (_Cfr92) that are used for a device connected
TL1 (per T-link system)
(Note 1) to TL1 (e.g. FFK120A) is counted as ports.
When RS is used in loader mode (or modem loader mode), the
communication FBs are not used. No need to consider the number of
ports.
Notes:
1) The maximum number of usable RS modules in one configuration is also 16 including POD, Ethernet, and P/PE link.
2) When RS is mounted on RT1, the RS module occupies one word of the input area internally.
It is not necessary to set the number of occupied words in the loader.
Responses of communication deteriorate as the number of mounted communication modules (Ethernet and POD) including
RS increases. For a system that requires high-speed responses, it is recommended to separate the system and exchange data
between the systems by P-link or FL-net.
3) Communication time
When RS is used on RT1, communication time is approximately 10 to 15 ms slower compared to when it is mounted on the SX
bus.
App.6-7
Appendix 6 Mounting Modules on T-link Expansion
4) Loader connection
When the loader is connected to RS that is mounted on RT1, set the communication data size at “200 bytes.”
• Setting screen in D300win
When an error occurs during program download, uncheck “Message Manager is used to communicate,” and then download the
program again. (for D300win only)
App.6-8
Appendix 6 Mounting Modules on T-link Expansion
5) Limitation on communication in loader mode
When RS is used in “loader” or “modem loader” mode, the maximum data length is 200 bytes.
Connection mode
Connection ID (L)
(00h fixed)
(00h fixed)
(00h fixed)
(00h fixed)
Command
Mode
(00h fixed)
(01h fixed)
Data
App.6-9
Appendix 7 Changing Communication Parameter in Loader mode
Appendix 7
Changing Communication Parameter in
Loader mode
App.7-1
Appendix 7 Changing Communication Parameter in Loader mode
App.7-2
Appendix 7 Changing Communication Parameter in Loader mode
App.7-3
Appendix 8 Selecting Commercial RS-232C Cables
Appendix 8
Selecting Commercial RS-232C Cables
App.8-1
Appendix 8 Selecting Commercial RS-232C Cable
Wiring examples of general external devices are shown on the following pages.
App.8-2
Appendix 8 Selecting Commercial RS-232C Cable
<Wiring example 1> Connection with a personal computer that has a D-sub 9-pin connector
* This paragraph introduces connector specifications used in relatively many Windows personal computers that have a built-in
RS-232C port. When you actually use the cable, check the specifications of the RS-232C port of your personal computer.
• Connector specifications on the personal computer side
D-sub, 9-pin, male (Use a female connector on the cable side.) Fixing screws are inch screws.
• Pin arrangement on the personal computer side
App.8-3
Appendix 8 Selecting Commercial RS-232C Cable
• Cable connection
Use a cable that has any of the following connections. There is no problem if any other connections are made in addition to the
positions shown below.
Connection 1
Connection 2
* There is no problem if connections indicated by the dotted line (pin No. 1: CD) are made or not.
App.8-4
Appendix 8 Selecting Commercial RS-232C Cable
• Additional processing to commercially available cables
You cannot use a commercially available RS-232C cable (D-sub 9-pin female connectors on the both ends, inch screws,
cross cable) to connect between a PLC and a personal computer as it is. Perform the additional processing as shown below.
Gender changer
D-sub, 9-pin
PLC side Male - Male Personal computer side
Commercially available
RS-232C cross cable
D-sub, 9-pin
Female-Female
D-sub, 9-pin D-sub, 9-pin
Female Male
Millimeter screw Inch screw
(M2.6)
App.8-5
Appendix 8 Selecting Commercial RS-232C Cable
<Wring example 2> Connection with an analog modem that has a D-sub 9-pin connector
* This paragraph introduces connector specifications used in relatively many analog modems (herein after referred to as "modem")
that have a built-in RS-232C port (D-sub, 9-pin). When you actually use the cable, check the specifications of the RS-232C port of
your modem.
• Connector specifications on the modem side
D-sub, 9-pin, female (Use a male connector on the cable side.), Inch screws
• Pin arrangement on the modem side
App.8-6
Appendix 8 Selecting Commercial RS-232C Cable
• Cable connection
Use a cable that has the following connections. (Usually an RS-232C cable is supplied with a modem.)
App.8-7
Appendix 8 Selecting Commercial RS-232C Cable
• Additional processing to the cable supplied with a modem
You cannot use the RS-232C cable (D-sub 9-pin female connector on the PLC side, inch screws) to connect between a PLC
and a modem as it is. Perform the additional processing as shown below.
Gender changer
D-sub, 9-pin
PLC side Male - Male Modem side
App.8-8
Appendix 8 Selecting Commercial RS-232C Cable
Signal name
Pin No. Other expressions
(used in this manual)
1 CD DCD
2 RD RXD
3 SD TXD
4 ER DTR
5 SG -
6 DR DSR
7 RS RTS
8 CS CTS
9 RI CI
App.8-9
Appendix 9 Data Length when Using Non-procedural FB
Appendix 9
Data Length when Using Non-procedural FB
Memory in PLC
In the case of data (Code conversion "None") setting on RS-232C/RS-485 line
(Array of FB for data sending)
In S_LEN, set the number data bytes "N" of the PLC memory to be sent.
The total of all the data sent to the RS-232C/RS-485 line must be equal to
or smaller than the data length that the FB supports.
For example, when using "_Cfr32," the data length that the FB supports is
32 words. The total of the data from the start code to end code & BCC must
be 32 words (= 64 bytes) or less.
When the start code is 1 byte, the end code is 1 byte, and BCC is not used,
the actual data that can be sent is a maximum of 62 bytes (64 - 2 = 62).
2 bytes
Start code ASCII of data 1 ASCII of data 2 ASCII of data N End code & BCC
In S_LEN, set the number data bytes "N" of the PLC memory to be sent.
The total of all the data sent to the RS-232C/RS-485 line must be equal to
or smaller than the data length that the FB supports.
For example, when using "_Cfr32," the data length that the FB supports is
32 words. The total of the data from the start code to end code & BCC must
be 32 words (= 64 bytes) or less.
When the start code is 1 byte, the end code is 1 byte, and BCC is not used,
the actual data that can be sent is a maximum of 62 bytes (64 - 2 = 62).
However, this is the data on the RS-232C/RS-485 line (data after code
conversion). When converted to the memory in the PLC (before code
conversion), the actual data that can be sent is a maximum of 31 bytes,
half of 64 bytes.
App.9-1
Fuji Electric Co., Ltd.
Gate City Ohsaki, East Tower,
11-2, Osaki 1-chome, Shinagawa-ku, Tokyo 141-0032, Japan
E-mail: micrex-sx@fujielectric.com
URL: http://www.fujielectric.com/
Materials covered in this document are subject to revision due to the modification of the product.