You are on page 1of 122

series

USER’S MANUAL

General Purpose Communication Module


Type: NP1L-RS1 (RS-232C: 1CH, RS-485: 1CH)
NP1L-RS2 (RS-232C: 1CH)
NP1L-RS3 (RS-232C: 2CH)
NP1L-RS4 (RS-485: 1CH)
NP1L-RS5 (RS-485: 2CH)

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.

<Manuals relevant to SX-Programmer Expert (D300win)>

Title Manual No. Contents


User's Manual Instruction, FEH200 Describes the memory, language and system definitions of the
MICREX-SX series MICREX-SX series.
User's Manual Hardware, FEH201 Describes the system configuration, the specifications and
MICREX-SX series SPH operations of modules in the MICREX-SX series.
User's Manual D300winV3 <Reference>, FEH257 Describes the menu and icon of D300winV3 and all of the
MICREX-SX series operations of D300winV3.
User’s Manual D300winV3 FEH257-1 Describes the operations of LD/FBD added to D300winV3.
<LD/FBD Editor Operations>,
MICREX-SX series
User's Manual Standard Extended FB, FEH255 Describes the specifications and operations of standard
MICREX-SX series extended FBs for general purpose communication modules (for
D300win.)

<Manuals relevant to SX-Programmer Standard (Standard Loader)>

Title Manual No. Contents


User's Manual Instruction, FEH588 Describes the memory, language and system definitions of the
MICREX-SX series MICREX-SX series.
User's Manual Hardware, FEH201 Describes the system configuration, the specifications and
MICREX-SX series SPH operations of modules in the MICREX-SX series.
User’s Manual FEH598 Describes the functions and the operations of SX-Programmer
SX-Programmer Standard V3 <Reference>, Standard V3.
MICREX-SX series
User’s Manual Standard Expansion FB, FEH589 Describes the specifications and operations of standard
MICREX-SX series expansion FBs for general purpose communication modules (for
Standard loader.)

* 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.

Even some items indicated by "Caution" may result in a serious accident.


Both safety instruction categories provide important information. Be sure to strictly observe these instructions.

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.

Printed on * Manual No. Revision contents

Sep. 1998 FEH225 First edition

Jan. 2002 FEH225a Contents changed according to changes of extended FB specifications.


• Contents changed according to inclusion of a part of the non-procedural FB in the
firmware and reduction of the capacity of the non-procedural FB.
• Contents changed according to addition of the modem loader function.
• Descriptions of the standard extended FB in Appendix 2 deleted and reprinted in
"Standard Extended FBs for General Purpose Communication Module (FEH255)."

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.

Jan. 2005 FEH225c • NP1L-RS3 was added


• Wrong description in paragraph 3-4-1 was corrected.
• Paragraph 4-3-1 Note2 was added.
• Wrong description in paragraph 6-2-2 was corrected.
• Appendix 2-3-1 Memory type code 00h, 01h deleted.

July 2006 FEH225d • NP1L-RS5 was added (Appendix 4)

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 3 System Configuration


3-1 Mounting Restrictions.....................................................................................................................3-1
3-1-1 Mounting position............................................................................................................................................3-1
3-1-2 Number of mountable modules.......................................................................................................................3-1
3-2 System Configuration......................................................................................................................3-2
3-2-1 1:1 connection using RS-232C port................................................................................................................3-2
3-2-2 1:N connection using RS-485 port (N = max. 31 modules).............................................................................3-3
3-2-3 Connection using RS-232C port and RS-485 port independently..................................................................3-4
3-2-4 Connection using RS-232C port and RS-485 port..........................................................................................3-5
3-2-5 Configuration in which a loader is connected to the RS-232C port and RS-485 port.....................................3-7
3-2-6 Loader network configuration using RS-485...................................................................................................3-7
3-2-7 Loader network configuration using modems.................................................................................................3-8
3-3 Loader Cable....................................................................................................................................3-9
3-3-1 When connecting D300win to RS-232C port..................................................................................................3-9
3-3-2 When connecting D300win to RS-485 port.....................................................................................................3-9
3-4 Self-diagnosis...................................................................................................................................3-10
3-4-1 Self-diagnosis mode 1....................................................................................................................................3-10
3-4-2 Self-diagnosis mode 2....................................................................................................................................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
Contents
4-4 Data Sending....................................................................................................................................4-12
4-4-1 Data sending procedure..................................................................................................................................4-12
4-4-2 Send status list................................................................................................................................................4-13
4-5 Data Receiving.................................................................................................................................4-14
4-5-1 Data receiving procedure................................................................................................................................4-14
4-5-2 Receive status list...........................................................................................................................................4-15
4-6 RAS Information...............................................................................................................................4-16

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

Appendix 1 JIS7/8 Bit Code Table


Appendix 1-1 JIS7/8 Bit Code Table.....................................................................................................App.1-1

Appendix 2 Data Access by Command


Appendix 2-1 Command Overview.......................................................................................................App.2-1
Appendix 2-2 Transmission Data Format of Commands....................................................................App.2-2
Appendix 2-3 Details of Loader Commands........................................................................................App.2-4
Appendix 2-3-1 Read data.......................................................................................................................................App.2-4
Appendix 2-3-2 Write data........................................................................................................................................App.2-6
Appendix 2-3-3 CPU batch start...............................................................................................................................App.2-7
Appendix 2-3-4 CPU batch initialize and start..........................................................................................................App.2-7
Appendix 2-3-5 CPU batch stop...............................................................................................................................App.2-7
Appendix 2-3-6 CPU batch reset..............................................................................................................................App.2-8
Appendix 2-3-7 CPU individual start........................................................................................................................App.2-8
Appendix 2-3-8 CPU individual initialize and start....................................................................................................App.2-8
Appendix 2-3-9 CPU individual stop.........................................................................................................................App.2-9
Appendix 2-3-10 CPU individual reset.....................................................................................................................App.2-9

Appendix 3 Additional Description of NP1L-RS3


Appendix 3-1 Supported Version of NP1L-RS3...................................................................................App.3-1
Contents
Appendix 3-2 General Specifications...................................................................................................App.3-1
Appendix 3-3 Names and Functions....................................................................................................App.3-1
Appendix 3-3-1 Names.............................................................................................................................................App.3-1
Appendix 3-3-2 Functions........................................................................................................................................App.3-2
Appendix 3-4 Self-diagnosis.................................................................................................................App.3-3
Appendix 3-4-1 Self-diagnosis mode 1....................................................................................................................App.3-3
Appendix 3-4-2 Self-diagnosis mode 2....................................................................................................................App.3-3
Appendix 3-5 Initialization Parameters................................................................................................App.3-3
Appendix 3-6 Detailed RAS...................................................................................................................App.3-4

Appendix 4 Additional Description of NP1L-RS5


Appendix 4-1 Supported Version of NP1L-RS5...................................................................................App.4-1
Appendix 4-2 General Specifications...................................................................................................App.4-1
Appendix 4-3 Names and Functions....................................................................................................App.4-1
Appendix 4-3-1 Names.............................................................................................................................................App.4-1
Appendix 4-3-2 Functions........................................................................................................................................App.4-2
Appendix 4-4 Self-diagnosis.................................................................................................................App.4-4
Appendix 4-4-1 Self-diagnosis mode 1....................................................................................................................App.4-4
Appendix 4-4-2 Self-diagnosis mode 2....................................................................................................................App.4-4
Appendix 4-5 Initialization Parameter..................................................................................................App.4-4
Appendix 4-6 Loader Network Function..............................................................................................App.4-4
Appendix 4-7 Detailed RAS...................................................................................................................App.4-5

Appendix 5 Supplemental Description of CRC-16


Appendix 5-1 Supplemental Description of CRC-16...........................................................................App.5-1

Appendix 6 Mounting Modules on T-link Expansion


Appendix 6-1 Overview..........................................................................................................................App.6-1
Appendix 6-2 System Configuration Example.....................................................................................App.6-1
Appendix 6-3 Supported Versions........................................................................................................App.6-2
Appendix 6-4 Applicable FB..................................................................................................................App.6-3
Appendix 6-5 Notes on Use...................................................................................................................App.6-7

Appendix 7 Changing Communication Parameter in Loader mode


Appendix 7-1 Overview..........................................................................................................................App.7-1
Appendix 7-2 How to Change Communication Setting......................................................................App.7-2
Appendix 7-2-1 When using D300win loader...........................................................................................................App.7-2
Appendix 7-2-2 When using Standard loader..........................................................................................................App.7-3

Appendix 8 Selecting Commercial RS-232C Cables


Appendix 8-1 Overview..........................................................................................................................App.8-1
Appendix 8-2 Connector Specifications on the PLC side..................................................................App.8-1
Appendix 8-3 How to Select Commercially Available RS-232C Cable..............................................App.8-2
Appendix 8-4 Signal Names of RS-232C..............................................................................................App.8-9

Appendix 9 Data Length when Using Non-procedural FB


Appendix 9-1 Notion about Data Length when Using Non-procedural FB.......................................App.9-1
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 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.

Type Number of ports


NP1L-RS1 RS-232C: 1 channel, RS-485: 1 channel
NP1L-RS2 RS-232C: 1 channel
NP1L-RS4 RS-485: 1 channel

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

External External External


device device device

You can connect a personal


computer loader as an
external device.

<Overview of SX bus connection> Personal computer loader

Total length of SX bus: Max. 25m

General purpose
communication module
I/O I/O I/O I/O

CPU

Data are exchanged between the CPU


and external device via the SX bus.
External device

1-1
Section 1 Overview

1-2 Settings and Programs Necessary for Communication


The following preparations are necessary for RS1/2/4 to communicate between a MICREX-SX series CPU module and external
devices.

MICREX-SX series
RS1/2/4

Power
supply CPU I/O I/O I/O I/O

<CPU modules side> <RS1/2/4 side>

• 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.

• Application software for communication • Mode selection switch


Set the mode. (Select a device connected to the
RS-232C port and RS-485 port, and signal
FA packages are optionally available
conversion Yes/No.
for communication with each external device.
• RS-485 terminating resistor ON/OFF switch
Select ON/OFF of the terminating resistor.
Either will do if RS-485 port is not used.
External device

<External device side>

• Set the transmission speed, data length, parity bit, and stop bit.
• Application program for communication.

1-2
Section 1 Overview

1-3 Introduction to Standard Expansion FB


For NP1L-RSo, non-procedural FBs are provided to communicate with external serial devices. The FBs are included in the
installation CD of the loader software as standard. In the installation menu of the loader software, select “Standard Expansion
FB Setup” to install the FBs.
The standard expansion FBs include the following FBs for RS-232C/RS-485 communication.

Type FB name Overview


_C_free (Note 1) Non-procedural FB Send: 512 words Receive: 512 words
_Cfr252 (Note 1) Non-procedural FB Send: 252 words Receive: 252 words
_Cfr128 (Note 1) Non-procedural FB Send: 128 words Receive: 128 words
_Cfr64 (Note 1) Non-procedural FB Send: 64 words Receive: 64 words
_Cfr32 (Note 1) Non-procedural FB Send: 32 words Receive: 32 words
Non-procedure FB built in communication protocol
Non-procedural FB
Send: 512 words Receive: 512 words
_Cfrpr (Note 1)
The program capacity is reduced by performing a part of the communication
processing by the module.
Non-procedure FB built in communication protocol
Send: 512 words Receive: 512 words
_Cfrp2 (Note 2) The program capacity is reduced by performing a part of the communication
processing by the module. In addition, two SX bus message ports allows high-
speed communication processing.
_CfdFRN (Note 2) For FUJI Inverter FRENIC series
_CfdFVR (Note 2) For FUJI Inverter FVR-C11 series (FGI-BUS)
For FUJI inverter
For FUJI Inverter FVR-C11 series (FGI-BUS)
_Cfvrpr (Note 2) The program capacity is reduced by performing a part of the communication
processing by the module.
For FUJI temperature
_CfdPYX (Note 2) For FUJI temperature controller PYX series and PYH series
controller
For FUJI bar code
_CfdPK (Note 2) For FUJI bar code reader PK2 series
reader

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

1-4 Product Versions and Supported Functions


For the general purpose communication module, supported functions and available FBs depend on the product version.

1-4-1 Supported functions


Type and version Modem-based loader function 1 Modem-based loader function 2
Earlier than NP1L-RS1 V.1031 Not supported Not supported
Earlier than NP1L-RS2 V.1031 Not supported Not supported
Earlier than NP1L-RS4 V.1031 - (Note 1) - (Note 1)
NP1L-RS1 V1031 or later Supported Not supported
NP1L-RS2 V1031 or later Supported Not supported
NP1L-RS4 V1031 or later - (Note 1) - (Note 1)
NP1L-RS1 V2535 or later Supported Supported
NP1L-RS2 V2535 or later Supported Supported
NP1L-RS4 V2535 or later - (Note 1) - (Note 1)

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.

1-4-2 Available standard expansion FB


Applicable version of general
FB name FB Overview
purpose communication module
_C_free Non-procedural FB Send: 512 words Receive: 512 words
_Cfr252 Non-procedural FB Send: 252 words Receive: 252 words
_Cfr128 Non-procedural FB Send: 128 words Receive: 128 words All versions
_Cfr64 Non-procedural FB Send: 64 words Receive: 64 words
_Cfr32 Non-procedural FB Send: 32 words Receive: 32 words
Non-procedure FB built in communication protocol
Send: 512 words Receive: 512 words
_Cfrpr V2535 or later
The program capacity is reduced by performing a part of the communication
processing by the module.
Non-procedure FB built in communication protocol
Send: 512 words Receive: 512 words
_CfRP2 The program capacity is reduced by performing a part of the communication V2536 or later
processing by the module. In addition, two SX bus message ports allows
high-speed communication processing.
_CfdFRN For FUJI Inverter FRENIC series All versions (Note 1)
_CfdFVR For FUJI Inverter FVR-C11 series (FGI-BUS) All versions (Note 1)
For FUJI Inverter FVR-C11 series (FGI-BUS)
_Cfvrpr The program capacity is reduced by performing a part of the communication V2536 or later (Note 1)
processing by the module.
_CfdPYX For FUJI temperature controller PYX series and PYH series All versions (Note 1)
_CfdPK For FUJI bar code reader PK2 series All versions (Note 2)

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-1 General Specifications...........................................................................2-1


2-2 Communication Specifications..............................................................2-2
2-3 Names and Functions.............................................................................2-3
2-3-1 Names.............................................................................................................2-3
(1) NP1L-RS1.......................................................................................................2-3
(2) NP1L-RS2.......................................................................................................2-3
(3) NP1L-RS4.......................................................................................................2-4
2-3-2 Functions.........................................................................................................2-4

2-4 Dimensions..............................................................................................2-7
Section 2 Specifications

2-1 General Specifications


Item Specification
Operating ambient
0 to 55° C
temperature
Storage temperature -25 to +70° C
Physical
environmental Relative humidity 20 to 95%RH, no condensation
conditions Pollution degree 2
Corrosion immunity Free from corrosive gases. Not stained with organic solvents.
Operating altitude 2000m or less above sea level (Transport condition: 70kPa or more)

Mechanical Vibration Half amplitude: 0.15mm, Constant acceleration: 19.6m/s2


service conditions Shock Acceleration peak: 147m/s2
1.5kV (1kV: Clamping to transmission line), rise time 1ns, pulse width 1µs (noise
Noise immunity
simulator)
Electrical service Electrostatic Contact discharge: ±6kV
conditions discharge Aerial discharge: ±8kV
Radio
10V/m (80MHz to 1000MHz)
electromagnetic field
Construction Panel-mounted type, IP30
Cooling Air cooling
Isolation method Photocoupler
Dielectric strength 445VAC for 1 minute between I/O connector pins and frame ground
Insulation resistance 10MΩ or more between I/O connector pins and frame ground (with 500VDC megger)
NP1L-RS1: 24VDC, 110mA or less
Internal current consumption NP1L-RS2: 24VDC, 90mA or less
NP1L-RS4: 24VDC, 80mA or less
NP1L-RS1: Approx. 170g
Mass NP1L-RS2: Approx. 160g
NP1L-RS4: Approx. 160g
Dimensions Described in 2-4

2-1
Section 2 Specifications

2-2 Communication Specifications


Specification
Item
RS-232C RS-485
Type NP1L-RS1, NP1L-RS2, NP1L-RS4
NP1L-RS1 1 channel 1 channel
External interface

Port NP1L-RS2 1 channel -


NP1L-RS4 - 1 channel
Communication method Half-duplex communication (Note 1)
Synchronization method Start-stop synchronous transmission
1200/2400/4800/9600/19200/38400/57600 bps (Note 2)
Transmission speed
(For RS1, max. 57600bps or less in total of 2 channels) (Note 3)
1km or less
Transmission distance 15m or less
(Transmission speed: 19.2kbps or less)
Number of connectable
1:1 (One external device) 1:31 (Max.)
modules
Connection method D-sub, 9-pin connector (female) D-sub, 9-pin connector (male)
Depends on the application program (expansion FB) in the CPU module.
Transmission protocol
Non-procedural FB (Included in D300win)
Number of occupied slots 1 slot
ONL: Normally running - Green
ERR: Error in general purpose communication module - Red
ALM: Communication error - Red
Status indication LED
RXD: Signal receiving - Green
TXD: Signal sending - Green
TS1, TS2: Self-diagnosis - Green

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:

Version of general purpose


Standard expansion FB
communication module
V2535 or later _Cfrpr (Non-procedural FB built in the protocol)
_Cfrp2 (Non-procedural FB built in the protocol, 2-message version)
V2536 or later
_Cfvrpr (Inverter procedure FB built in the protocol)

3) This limitation is applied to RS1 earlier than V2535.

2-2
Section 2 Specifications

2-3 Names and Functions


2-3-1 Names
(1) NP1L-RS1
1) Status indication LED
2) Mode selection switch
3) RS-485 station No. selection switch ONL
ALM
RS232
RXD TXD
TS1

ERR RS485 TS2

78
4) RS-232C port

456
9 01
MODE

(D-sub, 9-pin, female)


23

RS485
B c DE Nameplate

789A
(on the right side of the module)

F 0 12
No.
(0-F) 3 45 6

5) RS-485 terminating resistor


RS232C ON/OFF switch
6) RS-485 port
(D-sub, 9-pin, male)
RS485
TERM. 1-2-3

RS485

(2) NP1L-RS2

1) Status indication LED


2) Mode selection switch
ONL RS232 TS1
ALM RXD TXD
ERR TS2

4) RS-232C port 78
456
9 01

MODE

(D-sub, 9-pin, female)


23

Nameplate
(on the right side of the module)

RS232C

2-3
Section 2 Specifications
(3) NP1L-RS4

1) Status indication LED


2) Mode selection switch
3) RS-485 station No. selection switch ONL
ALM RXD TXD
TS1

ERR RS485 TS2

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

5) RS-485 terminating resistor ON/OFF switch


6) RS-485 port
(D-sub, 9-pin, male)
RS485
TERM. 1-2-3

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-RS2 ERR Red Turns on when the module is abnormal.


ONL RS232 TS1 RS232C ALM Red Turns on when the communication data via RS-232C is abnormal.
ALM RXD TXD
ERR TS2 RS232C RXD Green Turns on when the RS-232C port is receiving data.

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)

* Example of LED status by module status

ONL ERR ALM


Module fatal fault OFF ON -
Module nonfatal fault ON ON -
Data error ON OFF ON

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

MODE RS-232C RS-485 Remark


3 456 No. RS-232C port RS-485 port
signal conversion
0 General purpose device General purpose device No
1 Programming loader General purpose device No
2 General purpose device Programming loader No
Supported by
3 Programming loader Programming loader No
V2535 or later.
4 General purpose device General purpose device Yes
5 Not used
Modem-loader Supported by
6 General purpose device No
19200 bps V1031 or later.
7 Self-diagnosis mode 1 (internal memory and LED diagnosis)
8 Self-diagnosis mode 2 (RS-232C/RS-485 loopback diagnosis)
Modem-loader Supported by
9 Programming loader No
19200 bps V1031 or later.
Modem-loader
A General purpose device No
9600 bps
Modem-loader
B Programming loader No
9600 bps Supported by
Modem-loader V2535 or later.
C General purpose device No
38400 bps
Modem-loader
D Programming loader No
38400 bps
Modem-loader
E General purpose device No
76800 bps Supported by
F Modem-loader Modem-loader V2536 or later.
-
(Note 5) 115200 bps 115200 bps

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.

3) RS-485 station No. selection switch


This switch is used to select an RS-485 station No. of NP1L-RS1 or NP1L-RS4. Setting range: 0 to F (16 positions)

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.

Pin Signal Signal direction


Description
No. name RS1/2 external device
1 6 1 CD ← Carrier detect

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

5) RS-485 terminating resistor ON/OFF switch


This switch is used to select ON/OFF of the built-in terminating resistor for the RS-485 port. There are three positions for this
switch.

Switch position Status


Left 2-wire type, Terminating resistor is available.
Center Terminating resistor is not available.
Right 4-wire type, Terminating resistor is available.

* Resistance value of built-in terminating resistor: 100Ω

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.

Pin Signal Signal direction


Description
No. name RS1/4 External device
5 9 1 SDB → Send data signal line (-)
2 SDA → Send data signal line (+)
6
1
(Send data signal line (-))
3 (SDB) →
Connected with RDB in the case of 2-wire system.
(Send data signal line (+))
4 (SDA) →
Connected with RDA in the case of 2-wire system.
M2.6
5 SG Signal ground (common return)
Screw
6 FG Frame ground
7
8 RDB ← Receive data signal line B (-)
9 RDA ← Receive data signal line A (+)

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

Section 3 System Configuration

3-1 Mounting Restrictions............................................................................3-1


3-1-1 Mounting position.............................................................................................3-1
3-1-2 Number of mountable modules........................................................................3-1

3-2 System Configuration.............................................................................3-2


3-2-1 1:1 connection using RS-232C port.................................................................3-2
3-2-2 1:N connection using RS-485 port (N = max. 31 modules).............................3-3
3-2-3 Connection using RS-232C port and RS-485 port independently...................3-4
3-2-4 Connection using RS-232C port and RS-485 port...........................................3-5
3-2-5 Configuration in which a loader is connected to the RS-232C port and
RS-485 port.....................................................................................................3-7
3-2-6 Loader network configuration using RS-485....................................................3-7
3-2-7 Loader network configuration using modems..................................................3-8

3-3 Loader Cable...........................................................................................3-9


3-3-1 When connecting D300win to RS-232C port...................................................3-9
3-3-2 When connecting D300win to RS-485 port......................................................3-9

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

3-1 Mounting Restrictions


3-1-1 Mounting position
NP1L-RS1/2/4 are general purpose communication modules which are connected to the SX bus of the MICREX-SX series. The
mounting position on a base board is restricted as follows:
NP1L-RS1/2/4 can be mounted in any slot except those for the power supply module (the two slots from the left on the base
board).

<Base board other than 6-slot base board>

Mountable slots

<6-slot base board>

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

I/O I/O I/O I/O


CPU
Power Power
supply supply

DeviceNet master module Not mountable

3-1-2 Number of mountable modules


A maximum of 16 modules can be connected per configuration. However, when other communication related modules are used
in the same configuration, the maximum number of 16 is the total of these and NP1L-RS1/2/4 modules.

P-link module (NP1L-PL1)


PE-link module (NP1L-PE1)
FL-net (OPCN-2) module (NP1L-FL3) Max. 16 modules per configuration.
General purpose communication module (NP1L-RSo)

3-1
Section 3 System Configuration

3-2 System Configuration


3-2-1 1:1 connection using RS-232C port
This configuration connects to an external device that has an RS-232C interface via the RS-232C port.
Set the mode selection switch to “0.”

RS1 or RS4 <Mode selection switch: 0>

RS-232C port General purpose device


RS-485 port General purpose device
Power Signal conversion No
supply CPU

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.”

RS1 <Mode selection switch: 2>

RS-232C port General purpose device


RS-485 port Loader
Power Signal conversion No
supply CPU

RS-485 RS-232C
External device

For the connection, see “3-3-2 When


connecting D300win to RS-485 port.”

Note:
Any other device than a loader (D300win) cannot be connected to the RS-485 port.

3-2
Section 3 System Configuration

3-2-2 1:N connection using RS-485 port (N = max. 31 modules)


This configuration connects to external devices that have an RS-485 interface via the RS-485 port. Set the mode selection
switch is to “0.” A maximum of 31 external devices can be connected. However, when all external devices are RS1 or RS4, the
maximum number is limited to 15 because only 0 to F are available for addressing.

RS1 or RS4 <Mode selection switch: 0>

RS-232C port General purpose device


RS-485 port General purpose device
Signal conversion No
Power
supply CPU

RS-485

External device External device External device


A B C

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.”

RS1 <Mode selection switch: 1>

RS-232C port Loader


RS-485 port General purpose device
Signal conversion No
Power
supply CPU

RS-232C RS-485

External device External device External device


A B C

For the connection, see “3-3-1 When


connecting D300win to RS-232C port.”

3-3
Section 3 System Configuration

3-2-3 Connection using RS-232C port and RS-485 port independently


This configuration connects to external devices using the RS-232C port and RS-485 port.
Communication through these ports is performed independently.

RS1 <Mode selection switch: 0>

RS-232C port General purpose device


RS-485 port General purpose device
Signal conversion No
Power
supply CPU

RS-485

External device External device External device


A B C

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

3-2-4 Connection using RS-232C port and RS-485 port


This configuration connects to external devices using both the RS-232C port and RS-485 port.

RS1 <Mode selection switch: 4>

RS-232C port General purpose device


RS-485 port General purpose device
Signal conversion Yes
Power
supply CPU

RS-485

External device External device External device


B C D

RS-232C External device A


(personal computer, etc.)

This configuration allows the following communications:


1) Communication between external device A and external device B, C and/or D (not via the CPU module)
2) Communication between external device A and CPU module
3) Communication between external device B, C and/or D and CPU module

<1) Communication between external device A and external device B, C or D>


This communication is performed directly, namely not via the CPU module.

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

External device External device External device


B C D

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

External device External device External device


B C D

RS-232C
External device A
(personal computer, etc.)
(Note) Note:
A user program for controlling the
external device A is necessary.

<3) Communication between external device B, C or D and the CPU module>

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

External device External device External device


B C D

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 A


(personal computer, etc.)

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.

RS1 <Mode selection switch: 3>

RS-232C port Loader


RS-485 port Loader
Signal conversion No
Power
supply CPU

RS-232C RS-485

For the connection, see “3-3


Loader Cable.”

3-2-6 Loader network configuration using RS-485


This configuration connects the personal computer loader D300win to the RS-232C port of RS1 on System 1.
A D300win can communicate with both CPUs of System 1 and System 2.

<Mode selection switch of System 1: 3> <Mode selection switch of System 2: 2>

RS-232C port Loader RS-232C port General purpose device


RS-485 port Loader RS-485 port Loader
Signal conversion No Signal conversion No

RS1 RS1

Power Power
supply CPU supply CPU

RS-232C RS-485

• When connected to the CPU of System 1, designate, from


the loader, the CPU which is in the configuration.

• When connected to the CPU of System 2, designate, from


the loader, the RS-485 station No. of RS1 on System 2.

3-7
Section 3 System Configuration

3-2-7 Loader network configuration using modems


This configuration enables remote programming using the public circuit by connecting a modem to the RS-232C port.

RS1 or RS2

When the NP1L-RS1 is used and the


mode selection switch is set to 6, A,
Power CPU or C, general purpose devices can be
supply connected to the RS-485 port.

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

3-3 Loader Cable


To connect the D300win loader to the RS-232C or RS-485 port of the general purpose communication module, connect the
cable in the following manner.

3-3-1 When connecting D300win to RS-232C port


Since the RS-232C connector of the general purpose communication module is “female,” use a male connector for the cable
connector, as shown in the figure below:

General purpose communication module side Personal computer side


D-sub 9-pin male connector D-sub 9-pin male connector

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-3-2 When connecting D300win to RS-485 port


Since the RS-485 connector of the general purpose communication module is “male,” use a female connector for the cable
connector on the general purpose communication module side, as shown in the figure below:

General purpose communication module side Personal computer side


D-sub 9-pin female connector D-sub 9-pin male connector
RS-485/RS-232C converter
SDB 1) 1) CD
SDA 2) RX- 2) RD
(SDB) 3) RX+ 3) SD
(SDA) 4) 4) ER
SG 5) 5) SG
FG 6) TX- 6) DR
7) TX+ 7) RS
RDB 8) 8) CS
RDA 9) 9) RI

For conversion from RS-232C to RS-485


port on the personal computer, use a
commercially available converter.

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>

Start Set the mode selection switch to “7.”

Checks the internal


memory of general purpose
communication module.

No
Normal?

TS1 blinks (0.25s).

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.

1) Internal memory check


After the LED lighting condition is checked, operation automatically returns to the diagnosis of the internal memory in the general
purpose communication module.
If an internal memory error is detected, “TS1” blinks.

2) LED lighting check


Of the external LEDs of the module, the lighting condition of those operated by the general purpose communication module are
checked. When the mode selection switch is set to 7, “TS1,” “TS2,” “RS-485 ALM” and “RS-232C ALM” LEDs light up in this
order.

<Normal lighting condition of LEDs>

TS1

TS2

RS485 ALM

RS232C ALM
1s 1s 1s 1s 10s

3-10
Section 3 System Configuration

3-4-2 Self-diagnosis mode 2


This mode is used to check the completeness of communications by looping back sent data and control signals via the
communication port.

(1) RS to CS signal check


In this check, the general purpose communication module turns RS signal on to check whether CS signal is looped back and
turns on, and then checks that this signal turns off.
When normal, “TS2” turns on; proceeds to step (2).
If abnormal, “TS2” blinks (at 0.5-second intervals) after 5 seconds; proceeds to step (2).

(2) ER to DR signal check


In this check, the general purpose communication module turns ER signal on to check whether DR signal is looped back and
turns on, and then checks that this signal turns off.
When normal, “TS1” turns on; proceeds to step (3).
If abnormal, “TS1” blinks (at 0.5-second intervals) after 5 seconds; proceeds to step (3).

(3) RS-232C/RS-485 data check


The general purpose communication module sends 16 bytes of data once and checks the looped back data received.
If both ports are normal, “RS-232C ALM” and “RS-485 ALM” turn on; proceeds to step (4).
If RS-485 is abnormal, “RS-232C ALM” turns on after 10 seconds and “RS-485 ALM” blinks (at 0.5-second intervals);
proceeds to step (4).
If RS-232C is abnormal, “RS-232C ALM” blinks (at 0.5-second intervals) after 10 seconds and “RS-485 ALM” turns on (at
0.5-second intervals); proceeds to step (4).
If both ports are abnormal, “RS-232C ALM” and “RS-485 ALM” blinks (at 0.5-second intervals); proceeds to step (4).

(4) Preservation of the result of the check


After 10 seconds of displaying the results from (3) above, the module returns to step (1). Here, if the setting of the mode
selection switch has been changed, Self-diagnosis Mode 2 is ended to enter the designated mode.
Notes:
1) When an RS-232C dedicated module (NP1L-RS2) is used, “RS-485 ALM” is kept turned off. When an RS-485 dedicated
module (NP1L-RS4) is used, “RS-232C ALM,” “TS1” and “TS2” are kept turned off.
2) When judged as “normal,” the next operation is started without any waiting time. Therefore, after all LEDs have turned
off at the start of diagnosis, the corresponding LED turns ON instantaneously.

<RS-232C loopback connector> <RS-485 loo-back connector>


Pin No. Pin No.

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

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-4 Data Sending.........................................................................................4-12


4-4-1 Data sending procedure................................................................................4-12
4-4-2 Send status list..............................................................................................4-13

4-5 Data Receiving......................................................................................4-14


4-5-1 Data receiving procedure...............................................................................4-14
4-5-2 Receive status list..........................................................................................4-15

4-6 RAS Information....................................................................................4-16


Section 4 Software Interface

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.

FB Name Specification overview


_C_free Non-procedural FB Send: 512 words, Receive: 512 words
_Cfr252 Non-procedural FB Send: 252 words, Receive: 252 words
_Cfr128 Non-procedural FB Send: 128 words, Receive: 128 words
_Cfr64 Non-procedural FB Send: 64 words, Receive: 64 words
_Cfr32 Non-procedural FB Send: 32 words, Receive: 32 words
Non-procedural FB Send: 512 words, Receive: 512 words
_Cfrpr
A part of communication processing is processed by the firmware in the module.
Non-procedural FB Send: 512 words, Receive: 512 words
_Cfrp2 A part of communication processing is processed by the firmware in the module and two
message ports are used to increase the processing speed.

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).

1) Initialization of communication ports


Initializes RS-232C and RS-485 ports (sets the transmission speed, data bit length, and parity bits according to the external
device).
2) Data sending/receiving function
Sends data from an application program in the MICREX-SX series CPU to an external device via RS1, or outputs the data
received via the general purpose communication module to an application program.
3) Monitoring of transmission condition
Monitors the condition of data transmission and, if abnormal, outputs error information.

<Function diagram of Non-procedural FB>

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.

Processor General purpose


communication
Non-procedural module External device
FB (normal mode) connected to
for RS-232C RS-232C

Non-procedural External device


FB connected to
for RS-485 RS-485

Processor General purpose


communication
Non-procedural module External device
FB (conversion mode) connected to
for both channels RS-232C

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:

Program capacity User FB System FB


FB Name Standard memory Retain memory
(Step) instance memory instance memory
_C_free 2656 402 words 3656 words 0 words 82 words
_Cfr252 2757 474 words 2174 words 0 words 82 words
_Cfr128 2757 474 words 1886 words 0 words 82 words
_Cfr64 2757 474 words 1758 words 0 words 82 words
_Cfr32 2757 474 words 1672 words 0 words 82 words
_Cfrpr 1190 122 words 1608 words 0 words 82 words

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

4-2 Specifications for Non-procedural FB


Both the FBs for D300win and the FBs for Standard have basically the same specifications.
This manual describes the FBs for D300win.
For the FBs for Standard, refer to the user’s manual FEH589.

4-2-1 Communication specification


Item Specification
Transmission speed 300/600/1200/2400/4800/9600/19200/38400/57600/76800/115200 bps (Note)
Data bits Selected from 7/8 bits
Parity bit None/odd/even
Stop bits Selected from 1/2 bits
Selected from DTE / DCE / modem DTE mode
DCE
Modem DTE mode: Turns CD ON when receiving
DTE mode ER: Always ON
Signal control
DCE mode DR: Always ON
OFF RS: Always ON; Sending: Unconditional
DTE mode
Signal flow ON RS: ON during sending; Sending: When CS is ON
control OFF CS: Always ON; Sending: Unconditional
DCE mode
ON CS: ON when RS is ON; Sending: When ER is ON
XON/XOFF control Selectable
RS-485 mode Selected from 4-wire/2-wire
Selected from None/ASCII conversion/ EBCDIC conversion
Code conversion
(Converts binary data into character string variable.)
None Disable frame detection function.
Frame detection Fixed length Designate the number of receive data bytes
Variable length Designate start and end codes.
None None
Upper order / Calculation range designation. Designate position.
Horizontal parity
Lower order Formula: Selected from add / add and invert / EOR / CRC
(BCC)
BCC code: Selected from character code / binary code
Lower order /
Upper order
Transmission timer value × 10ms

Note:
The transmission rates 300, 600, 76800, and 115200 bps can be used in the following combinations:

Version of general purpose


Standard expansion FB
communication module
V2535 or later _Cfrpr (Non-procedural FB built in the protocol)
V2536 or later _Cfrp2 (Non-procedural FB built in the protocol, 2-message version)

4-3
Section 4 Software Interface

4-2-2 FB format
Input terminal name Output terminal name

_C_free (Note 1)

Open (BOOL) OPEN (BOOL) OK Communication ready

Send request (BOOL) S_REQ (WORD) O_STS Open status

Send data length (INT) S_LEN (BOOL) S_END Send end

(BOOL) S_ERR Send error

(WORD) S_STS Send status

(BOOL) R_END Receive end

(BOOL) R_ERR Receive error

(WORD) R_STS Receive status

(INT) R_LEN Receive data length

(INT) STN_NO RS-485 station No.

Send data (_C_SND_TYP11) S_DAT Send data

Receive data (_C_RCV_TYP11) R_DAT Receive data IN-OUT


terminal
(Note 2)
Communication parameter (_C_PAR_TYP11) PARA Communication parameter

RAS information (_C_work_TYPE11) RAS RAS information

* ( ) indicates data type.

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.

<Send data “S_DAT” (WORD array)>


Upper order Lower order
<Variable declaration example (C_free)>
S_DAT [0] Data 2 Data 1
VAR S_DAT [1] Data 4 Data 3
S_DAT:_C_SND_TYP11;
END_VAR ⁞ ⁞ ⁞
S_DAT [31] Data 64 Data63 Up to here is assigned to _Cfr32
<Data type list> ⁞ ⁞ ⁞

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

<Communication parameter PARA (INT array)>


<Variable declaration example (_C_free)>

VAR
PARA:_C_PAR_TYP11;
END_VAR

<Data type list>

FB Name Data type of PARA


_C_free _C_PAR_TYP11
_Cfr252 _C_PAR_TYP16 PARA [16] Code conversion
_Cfr128 _C_PAR_TYP14 PARA [17] Frame detection
_Cfr64 _C_PAR_TYP13 PARA [18] Number of receive data bytes

_Cfr32 _C_PAR_TYP15 PARA [19] Number of start code bytes

_Cfrpr _C_PAR_TYP11PR PARA [20] Start code 1


PARA [21] Start code 2
Variable name PARA [22] Start code 3
General purpose communication PARA [23] Start code 4
PARA [0]
module station No.
PARA [24] Start code 5
PARA [1] Port No.
PARA [25] Number of end code bytes
* Changes to the
PARA [2] Message port No.
PARA [26] End code 1 parameters “PARA
PARA [3] Reserved [16]” to “PARA [35]”
PARA [27] End code 2 take effect even
PARA [4] Transmission speed PARA [28] End code 3 after the FB opens.
PARA [5] Data bit PARA [29] End code 4
PARA [6] Parity bit PARA [30] End code 5
PARA [7] Stop bit PARA [31] BCC designation
PARA [8] DCE designation PARA [32] Calculation range, position
PARA [9] DTR/DSR signal control PARA [33] Formula
PARA [10] RTS/CTS signal flow control PARA [34] Code type
PARA [11] XON/XOFF control PARA [35] Send timer value
PARA [12] RS-485 mode PARA [36] Reserved
PARA [13] Reserved PARA [37] Reserved
PARA [14] Reserved PARA [38] Reserved
PARA [15] Reserved PARA [39] Reserved

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.

No. Item Description


General purpose communication Set the station No. of the general purpose communication module on the SX bus.
0
module station No.
1 Port No. Designate an interface port on the general purpose communication module. (Note 5)
Designate a port No. for sending/receiving messages to/from the general purpose
communication module (1 to 127).
2 Message port No.
Note: Avoid designating a port No. which is already used for sending/receiving
messages to/from other modules.
3 Reserved Not used.
Designate the transmission speed.
4 Transmission speed
0: 1200, 1: 2400, 2: 4800, 3: 9600, 4: 19200, 5: 38400, 6: 57600 bps
Designate the data bit length. When "7" is selected, 7 bits make up one data; when "8,"
8 bits make up one data.
5 Data bit
0: 7 bits
1: 8 bits
This is a bit which is added to data for error detection. Designate the proper one to
6 Parity bit match the setting of the target device.
0: None, 1: Odd, 2: Even
This bit indicates the end of data. Designate the proper one to match the setting of the
7 Stop bit target device.
0: 1 bit, 2: 2 bits
When signal line control is not performed, there is no difference in functions between
DCE and DTE modes. The RS-232C of the general purpose communication module
is of DTE specification, however, it can be used as a DCE specification interface when
8 DCE designation signal lines are converted as follows:
No.7 pin (RS) to CS No.6 pin (DR) to ER
No.8 pin (CS) to RS No.4 pin (ER) to DR
0: DTE, 1: DCE, 2: Modem DTE
9 ER/DR signal control (Note 4) 0: ON, 1: OFF
0: OFF RS: Always ON; Sending: Unconditional
DTE mode
Signal flow 1: ON RS: ON while sending; Sending: When CS is ON
10
control 0: OFF CS: Always ON; Sending: Unconditional
DCE mode
1: ON CS: ON when RTS is ON; Sending: When ER is ON
Because communication between sender and receiver is performed asynchronously, flow
control may be necessary. The receiver sends an XOFF signal to indicate that it cannot
11 XON/XOFF control receive data for a while and then sends an XON signal to cancel the XOFF condition. To
use XON/OFF control, the device at the other end must also have this function.
0: ON, 1: OFF
Select 4-wire or 2-wire for RS-485.
12 RS-485 mode
0: 4-wire 1: 2-wire
13 Reserved Not used
14 Reserved
15 Reserved
Binary data is converted into a character string variable.
16 Code conversion
0: None, 1: ASCII conversion, 2: EBCDIC conversion
Designate the data receiving method.
0: None Receiving completes when data is received.
1: Variable length Receiving completes when the data in a range between start and
17 Frame detection (Note 6)
end codes is received.
2: Fixed length Receiving completes when receive data reaches the specified
number of receive data bytes.

4-7
Section 4 Software Interface

No. Item Description


Designate the number of receive data bytes when "Fixed length" is selected for frame
18 Number of receive data bytes
detection. When "Variable length" is selected, set this item to "0."
Designate the number of start code bytes when "Variable length" is selected. "0" means
19 Number of start code bytes
no start code.
20 Start code 1 Designate the start code when "Variable length" is selected.
21 Start code 2
22 Start code 3
23 Start code 4
24 Start code 5
25 Number of end code bytes Designate the number of end code bytes when "Variable length" is selected.
26 End code 1 Designate the end code when "Variable length" is selected.
27 End code 2
28 End code 3
29 End code 4
30 End code 5
Set whether or not to add horizontal parity for checking text data transmission error.
0: None
1: Set in the order of higher and lower digit

31 BCC designation Higher digit of BCC Lower digit of BCC

2: Set in the order of lower and higher digit

Lower digit of BCC Higher digit of BCC

Set the calculation range and BCC position. Calculation range

0: Calculates the text part and inserts it ahead of the end code

Start code TEXT BCC End code


1: Calculates text part and end code and inserts them behind the end code.

Start code TEXT End code BCC

32 Calculation range, position 2: Calculates start code and text part and inserts them ahead of the end code.

Start code TEXT BCC End code

3: Calculates start code, text part and end code and inserts them behind the end code.

Start code TEXT End code BCC

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

No. Item Description


Designate the calculation method to check for transmission error.
Transmission data: D1 D2 ... Dn

0: Add
D1 + D2 + ... + Dn

1: Add and invert


33 BCC calculation formula Inversion of (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

Designate the code type of BCC data.


0: Binary
34 BCC code type
1: ASCII
2: EBCDIC
The timer value for monitoring transmission since the data send request has been sent
35 Send timer value from the CPU module onto the RS-232C line until sending is completed.
Normally set to 100 (1 second) (in 0.01-second steps).
36 Reserved Not used.
⁞ ⁞
39 Reserved

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

4-3-2 Initialization procedure


When the "Open" terminal (OPEN) of the FB is turned ON, communication parameters are transferred to the general purpose
communication module, which executes processing for initialization. If initialization fails due to a communication parameter
setting error or hardware error, the FB outputs the corresponding error code (word type) to the "Open status" (O_STS).

Turned ON by an application program. Turned OFF by an application program.

(Note)
Open (OPEN)
Initialization processing
Port close processing

Communication ready (OK)


Notes:
OPEN signal shall be kept ON during data communication.
When an initialization error occurs:

OPEN status (O_STS) 00 Error status

4-10
Section 4 Software Interface

4-3-3 OPEN status list


No. Result of initialization Remark
'00' Normal end
'01' Transmission speed error The general purpose communication module detected an error.
'02' Data bit length error The general purpose communication module detected an error.
'03' Parity bit error The general purpose communication module detected an error.
'04' Stop bit error The general purpose communication module detected an error.
'05' DCE setting error The general purpose communication module detected an error.
'06' Signal flow control setting error The general purpose communication module detected an error.
'07' XON/XOFF control setting error The general purpose communication module detected an error.
'08' RS-485 mode setting error The general purpose communication module detected an error.
'3F' Parameter change error Parameter change error after OPEN
'40' Conversion code setting error
'41' Frame detection method setting error
'42' Start code setting error
'43' End code setting error
'44' BCC code setting error
'45' BCC calculation range setting error
'46' BCC calculation formula setting error
'47' BCC code type setting error
'48' Send timer value setting error A minus value is specified for the send timer.
General purpose communication module station No.
'80'
setting error
'81' Channel No. setting error
'82' Message port No. setting error
Open error • Setting of the SX bus station No. of the general purpose
communication module is wrong.
'93' • Two or more communication expansion FBs used the same port
No. or the same message port in the same general purpose
communication module.
'94' Open error Initialization of the general purpose communication module failed.
Signal conversion mode not supported When the mode selection switch is set to "4" (signal conversion
'A3' is set to "Yes."), the selected FB cannot be used. Set the mode to
"0" (signal conversion is set to "No.")
'A5' Processing impossible because in loader mode The general purpose communication module detected an error.
Processing impossible because self-diagnosis is The general purpose communication module detected an error.
'A6'
being executed

4-11
Section 4 Software Interface

4-4 Data Sending


4-4-1 Data sending procedure
Set data.

Send data (S_DAT)

Set data length.

Send data length (S_LEN)

Turned ON by an application program. Turned OFF by an application program.

Send request (S_REQ)

Sending processing
Send end (S_END)

S_END and S_ERR turn ON for one scan.


When a send error occurs:

Send status (S_STS) Result of sending

S_END and S_ERR turn ON for one scan.


Send error (S_ERR)

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-4-2 Send status list


No. Result of sending Remark
'00' Normal end
'01' Send buffer overflow
'02' Reserved
'03' Reserved
'04' Reserved
'05' Reserved
'06' Reserved
• Data sending was not completed within the "Send timer value"
set in the initialization parameter.
'40' Data send time-out
• The data byte length set in "S_LEN" exceeds the data length
that the FB can treat.
'41' Protocol response error
'42' Reserved
'90' General purpose communication module disconnection Not detected
'91' SX bus send error
'92' SX bus receive error Not detected
'A0' Object port error Specified port No. is neither 0 nor 1.
Processing impossible because in code conversion
'A3'
mode
'A5' Processing impossible because in loader mode
Processing impossible because self-diagnosis is being The general purpose communication module detected an error.
'A6'
executed
'C0' Hardware error detected during receiving The general purpose communication module detected an error.
'C1' Receive buffer has overflowed. The general purpose communication module detected an error.
'C2' Send buffer has overflowed. The general purpose communication module detected an error.
'C3' Send data size over The general purpose communication module detected an error.

4-13
Section 4 Software Interface

4-5 Data Receiving


4-5-1 Data receiving procedure

Communication ready (OK)


Always waiting for data receiving from the target device

Receive data (R_DAT)

Receive data length (R_LEN)

Receive status (R_STS)

Receive end (R_END)

When a receive error occurs: R_END

Receive error (E_ERR)

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

4-5-2 Receive status list


No. Result of receiving Remark
'00' Normal end
'01' Reserved
'02' Receive buffer overflow
'03' Reserved
'04' Reserved
'05' Reserved
'06' Reserved
'40' Reserved
'41' Reserved
'42' BCC error
'90' General purpose communication module disconnection
An error of M_SEND that the FB internally uses is detected.
'91' SX bus send error
(Note 2)
An error of M_RECEIVE that the FB internally uses is detected
'92' SX bus receive error
or a time-out is detected. (Note 2)
'A0' Object port error The general purpose communication module detected an error.
Processing impossible because in code conversion The general purpose communication module detected an error.
'A3'
mode
'A5' Processing impossible because in loader mode The general purpose communication module detected an error.
Processing impossible because self-diagnosis is being The general purpose communication module detected an error.
'A6'
executed
Hardware error detected during receiving (parity error, The general purpose communication module detected an error.
'C0'
framing error, etc.)
'C1' Receive buffer overflow The general purpose communication module detected an error.
'C2' Send buffer overflow The general purpose communication module detected an error.
'C3' Send data size over The general purpose communication module detected an error.

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

4-6 RAS Information


Operating status of the FB is stored in the RAS information area as shown below.

<Assignment of RAS information area>

For D300win
For Standard (INT-type
2-dimensional array)

RAS + 0 RAS.RAS[0] Port status → See the next page.


General purpose communication
RAS + 1 RAS.RAS[1] → See the next page.
module status
RAS + 2 RAS.RAS[2] Send request count
RAS + 3 RAS.RAS[3] Send end count
RAS + 4 RAS.RAS[4] Receive count
RAS + 5 RAS.RAS[5] Frame detection count
RAS + 6 RAS.RAS[6] M_OPEN status
RAS + 7 RAS.RAS[7] M_SEND status
RAS + 8 RAS.RAS[8] M_RECEIVE status
RAS + 9 RAS.RAS[9] M_SEND error count
RAS + 10 RAS.RAS[10] M_RECEIVE error count
RAS + 11 RAS.RAS[11] Reserved
RAS + 12 RAS.RAS[12] Reserved
RAS + 13 RAS.RAS[13] Reserved
RAS + 14 RAS.RAS[14] Reserved
RAS + 15 RAS.RAS[15] Reserved
RAS + 16 RAS.RAS[16] Reserved
RAS + 17 RAS.RAS[17] Reserved
RAS + 18 RAS.RAS[18] Reserved
RAS + 19 RAS.RAS[19] Reserved

4-16
Section 4 Software Interface
• Port status

Control data Error data

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

* Update timing of port status


• For _cfrp2, the port status is updated when the data from the target device is received.
• For the other FBs than _cfrp2, the port status is updated regularly.

• General purpose communication module status

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Mode switch (x8)


Mode switch (x4)
Mode switch (x2)
Mode switch (x1)
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
RS-485 station No. (x8)
RS-485 station No. (x4)
Reserved in the case of NP1L-RS2.
RS-485 station No. (x2)
RS-485 station No. (x1)

4-17
Section 5 Programming

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 5 Programming

5-1 Communication Program Creating Procedure


This section describes the procedure for creating a communication program in D300win, using the non-procedural FB (_C_free)
as an example. For the procedure in Standard loader, refer to the user’s manual “FEH589.”
1) Install the standard expansion FBs.
→ See “5-2 Installing Standard Expansion FB.”
2) Register the FBs in the library in the project tree.
→ See “5-3 Registering FB in Library.”
3) Paste the non-procedural FB (_C_free) onto the program worksheet.
→ See “5-4 Pasting Non-procedural FB.”
4) Set values for the communication parameters (such as baud rate and start/end cord).
→ See “5-5 Setting Communication Parameter.”
5) Write send data.
→ See “5-6 Writing Send Data.”
6) Connect variables or instructions to each terminal of the expansion FB.
→ See “5-7 Connecting Variables and Instructions to FB Terminals.”

5-1
Section 5 Programming

5-2 Installing Standard Expansion FB


The standard expansion FB is included in the installation CD of the loader software.
<Operating Procedure >
1) Start Windows and then insert the product CD-ROM into the CD-ROM drive. The following screen automatically appears.
Double-click “Standard Expansion FB Setup” and follow the instructions on the screen to install the FB.

5-2
Section 5 Programming

5-3 Registering FB in Library


To use communication FBs included in the standard expansion FB package, register them in the library in a created project.

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.

When _C_free is registered


in the same manner:

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

5-4 Pasting Non-procedural FB


The following procedure pastes the non-procedural FB “_C_free” on the LADDER code worksheet.
<Pasting procedure>
1) Open the code worksheet.

Code worksheet

Double-click here.

Click the desired point on the


code worksheet to determine
the pasting position.

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

5-5 Setting Communication Parameter


Set parameter values to the variables (INT-type array data) which are connected to the communication parameter terminal “PARA”
of the non-procedural FB. This subsection describes how to set the communication parameters using ST language.

<Example of variable declaration>


The communication parameter variable “PARA” must be a global variable because it is used in the POU on which an expansion
FB is pasted. Therefore, you need to declare it on both local and global worksheets as shown below.
Local variable declaration

“_C_PAR_TYP11” is a data type that is declared in the non-procedural FB “_C_free.”

“PSET” is a flag for parameter data setting.

Global variable declaration

Used by the POU for setting send data value.

<Example of setting program>


This sample program assigns necessary communication parameter values to INT-type array data "PARA."
If you do not need to change the parameter values during operation, execute them in the first scan after the PLC starts. It is not
necessary to execute for each scan.

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

5-6 Writing Send Data


Write the send data in the variables (WORD-type array data) which are connected to the send data terminal “S_DAT.” When the
size of send data is small, the send data writing program is created on the same worksheet as that for expansion FB; when the
size is large, it is better to create the program on a separate worksheet or POU. This subsection describes how to create a send
data writing program on a POU other than that including the non-procedural FB.

<Example of variable declaration>


The send data variable “SDAT” must be a global variable because it is used in the POU on which an expansion FB is pasted.
Therefore, you need to declare it on both local and global worksheets as shown below.

Local variable declaration

“_C_SND_TYP11” is a data type that is declared in the non-procedural FB “_C_free.”

“SSET” is a flag for send data setting.

Global variable declaration

Used by the POU for setting parameter values.

<Example of setting program>


Set a desired value for WORD-type array data "SDAT."

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

5-7 Connecting Variables and Instructions to FB Terminals


This subsection describes how to program for each expansion FB terminal.

_C_free
BOOL OPEN OK BOOL

BOOL S_REQ O_STS WORD

INT S_LEN S_END BOOL

S_ERR BOOL

S_STS WORD

R_END BOOL

R_ERR BOOL

R_STS WORD

R_LEN INT

STN_NO INT

WORD array S_DAT

R_DAT WORD array

INT array PARA

RAS Structure

5-7-1 Connecting variable to “PARA” terminal


Connect the variable which has been assigned data in “5-5 Setting Communication Parameter” to the communication parameter
terminal “PARA.”

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.

5-7-2 Operation for starting FB


After setting all necessary communication parameters, turn ON the input terminal “OPEN” to start initialization.
When initialization ends, the output terminal “OK” turns ON, and the FB becomes ready for communication.

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

5-7-3 Operation for sending data


Issue a send request after setting the send data and its byte length.

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

INT#18 S_LEN S_END

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.

5-7-4 Operation for receiving data


When the communication ready terminal “OK” turns ON, the non-procedural FB continuously checks whether the data to be
received exists or not and, when it exists, executes operations for receiving data. When the delimiter between received data
frames is detected, the receive end “R_END” turns ON for one scan, and the receive data and receive status are stored in the
receive data “R_DAT” and receive status “R_STS,” respectively.
If a receive error occurs, the receive error “R_ERR” also turns ON for one scan.

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-3 SG and FG Terminals..............................................................................6-4


Section 6 Wiring

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

6-2 Wiring Method


6-2-1 When RS-485 is used (2-wire)
To make a 2-wire system, as shown in the figure below, 4) and 9) as well as 3) and 8) are short-circuited in the connector,and
1) (SDB), 2) (SDA) and 5) (SG) are used to connect to external devices.

General purpose Pin No. External device


communication module SDA (+) 2) (+)
SDB (-) 1) (-)
SG 5) SG
(Note)
SDA (+) 4)
SDB (-) 3) To the next external device

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).

6-2-2 When RS-485 is used (4-wire system)


To make a 4-wire system, 1), 2), 5), 8) and 9) are used as in the figure below:

General purpose Pin No. External device


communication module SDA (+) 2) RDA (+)
SDB (-) 1) RDB (-)
SG 5) SG
(Note)
SDA (+) 4)
SDB (-) 3)

RDA (+) 9) SDA (+)


RDB (-) 8) SDB (-)

FG 6)

To the next external device


* To set a terminating resistor for 4-wire
system, change the “RS-485 Terminating In order to obtain the proper shielding effect, the
resistor ON/OFF” switch to “3” (left and shielding wire needs to extend in the connector
right side when facing the front panel). cover and be connected properly to the terminal.

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

6-2-3 When RS-232C is used

General purpose communication module External device


Pin No.

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)

Data terminal ready ER 4)

Shielded section of communication cable


Shielding wire is connected using
the D-sub connector cover fixing screw.
* It is possible to connect to FG of PLC
via the module.
In order to obtain the proper
shielding effect, the shielding wire
needs to extend in the connector
cover and be connected properly
to the terminal.

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

6-3 SG and FG Terminals


The SG and FG terminals of general purpose communication modules are internally connected as follows:

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

7-1 RAS Information of General Purpose Communication Module..........7-1


Section 7 RAS

7-1 RAS Information of General Purpose Communication Module


This section describes how to monitor and analyze the RAS information of the general purpose communication module using a
loader.
In this manual, D300win is used as an example, however, the procedure after “Failure diagnosis” is the same in Standard.
<System configuration example>
General purpose communication module
MICREX-SX

To external device

SX bus station No.3


SX bus station No.2
D300win SX bus station No.1

< Monitoring/analysis procedure >


The following describes the monitoring/analysis procedure using the above system as an example.
1) Connect D300win to the MICREX-SX series CPU module and display the following project control dialog box.

Click here.

2) The “Failure diagnosis” dialog box appears.

Click “General-purpose communication” to display


information on the general purpose communication module.

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.

No.0 No.1 No.7

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.

<Detailed RAS information>

General purpose communication module 14, 15 Not used


0
status
16 Number of parity error occurrences
1 RS-232C port status
17 Number of framing error occurrences
2 RS-485 port status
18 Number of overrun error occurrences
3–5 Not used RS-485
19 Send buffer overflow
6, 7 Not used
20 Receive buffer overflow
8 Number of parity error occurrences
21 Loopback buffer overflow
9 Number of framing error occurrences
22, 23 Not used
10 Number of overrun error occurrences
RS-232C 24 Number of SX bus send error interrupts
11 Send buffer overflow
25 Number of SX bus receive error interrupts
12 Receive buffer overflow SX bus
26 Number of error message data receptions
13 Loopback buffer overflow
27 Number of invalid message data receptions
28–31 Not used

7-3
Section 7 RAS
• RS-232C/RS-485 port status

Control data Error data

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.

* Update timing of port status


• For _cfrp2, the port status is updated when the data from the target device is received.
• For the other FBs than _cfrp2, the port status is updated regularly.

• General purpose communication module status

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Mode switch (x8)


Mode switch (x4)
Mode switch (x2)
Mode switch (x1)
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
RS-485 station No. (x8)
RS-485 station No. (x4)
Reserved when NP1L-RS2 is used.
RS-485 station No. (x2)
RS-485 station No. (x1)

• 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

Appendix 1 JIS7/8 Bit Code Table

Appendix 1-1 JIS7/8 Bit Code Table.....................................................App.1-1


Appendix 1 JIS7/8 Bit Code Table

Appendix 1-1 JIS7/8 Bit Code Table


■ JIS 7-bit Codes

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

■ JIS 8-bit Codes


Unlike 7-bit codes, JIS 8-bit codes assign different codes for alphabetic characters than for katakana characters.
(The table below shows the codes for alphabetic characters.)

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

Appendix 2 Data Access by Command

Appendix 2-1 Command Overview......................................................App.2-1


Appendix 2-2 Transmission Data Format of Commands...................App.2-2
Appendix 2-3 Details of Loader Commands.......................................App.2-4
Appendix 2-3-1 Read data................................................................................ App.2-4
Appendix 2-3-2 Write data................................................................................ App.2-6
Appendix 2-3-3 CPU batch start....................................................................... App.2-7
Appendix 2-3-4 CPU batch initialize and start................................................... App.2-7
Appendix 2-3-5 CPU batch stop........................................................................ App.2-7
Appendix 2-3-6 CPU batch reset...................................................................... App.2-8
Appendix 2-3-7 CPU individual start................................................................. App.2-8
Appendix 2-3-8 CPU individual initialize and start............................................ App.2-8
Appendix 2-3-9 CPU individual stop................................................................. App.2-9
Appendix 2-3-10 CPU individual reset.............................................................. App.2-9
Appendix 2 Data Access by Command

Appendix 2-1 Command Overview


When accessing data of the internal memory of a MICREX-SX series CPU module from an intelligent device such as a personal
computer, you can read or write data by issuing a “request command” from the personal computer. No application program for
data sending/receiving is necessary in the CPU module. The following 10 commands are provided.

Function Command name Command Mode Overview


Read Read data 00h 00h Reads data from the specified data memory.
Write Write data 01h 00h Writes data into the specified data memory.
PLC CPU batch start 04h 00h Starts all the CPUs existing in a configuration in a batch.
control
CPU batch initialize and start 01h Initializes and starts all the CPUs existing in a configuration
in a batch.
CPU batch stop 02h Stops all the CPUs existing in a configuration in a batch.
CPU batch reset 03h Resets all the CPUs existing in a configuration in a batch.
CPU individual start 04h Starts a specified CPU separately.
CPU individual initialize and start 05h Initializes and starts a specified CPU separately.
CPU individual stop 06h Stops a specified CPU separately.
CPU individual reset 07h Resets a specified CPU separately.

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.

<Data access image>


Create request commands by an application program in the personal computer, and then send them to the CPU module via the
general purpose communication module. The CPU which receives the request commands returns a response command.
No data communication program is required for an application program in the CPU module.

* Set the mode selection switch of the general communication module to "1".

General purpose communication module Personal computer


MICREX-SX

Request command

Response command

CPU module

App.2-1
Appendix 2 Data Access by Command

Appendix 2-2 Transmission Data Format of Commands


The transmission data (request and response commands) consist of the “transmission header”, “loader command”, and “checksum
code”. Request commands and response commands have the same format.
All data are transmitted as HEX code (Not ASCII code).

START code (5Ah fixed)


Transmission header
(3 bytes) Data counter (L)
Number of bytes of
Data counter (H) command part + check part

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)

Number of bytes in data part (L)

Number of bytes in data part (H) Up to 492 bytes

Data

Checksum code (1 byte) BCC

<Details of transmission data>>


1) START code
Start code of transmission data (request command and response command) that is added to the top of the transmission data
part. This code is fixed to “5Ah”.

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>

Code Status Description


00h Normal end Command processing is completed normally.
10h CPU error Command cannot be executed because an error occurred in the CPU.
11h CPU running Command cannot be executed because the CPU is running.
12h Command execution not possible Command cannot be executed due to the key switch condition of the CPU.
20h Undefined command CPU received an undefined command or mode.
22h Parameter error Setting error was found in the command header part.
23h Transmission interlocked Transmission is interlocked by a command from another device.
Requested command cannot be executed because another command is
28h Command processing in progress
now being executed.
Requested command cannot be executed because the loader is now
2Bh Other loader processing in progress
performing another processing.
Requested command cannot be executed because the system is now
2Fh Initialization not completed
being initialized.
40h Data setting error Invalid data type or number was specified.
41h Specified data not found Specified data cannot be found.
44h Memory address setting error Specified address exceeds the valid range.
45h Memory size exceeded “Address + the number of read/write words” exceed the valid range.
A0h Command send destination setting error No module exists at specified destination station No.
A2h No response to command No response data is returned from the destination module.
Command cannot be communicated because an error occurred in the SX
A4h SX bus send error
bus.
Command cannot be communicated because NAK occurred while sending
A5h SX bus send NAK
data via the SX bus.
FFh Request from PC Specify when sending a request from a personal computer (PC).

4) Specification of connection destination, connection ID


Specifies the destination module.

Destination module Connection mode Connection ID (L) Connection ID (H)


CPU0 to CPU7 7Bh SX bus station No. of the destination CPU (FEh to F7h) 00h
P/PE link FL-net 7Bh SX bus station No. of the destination module (F6h to EFh) 00h

* 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.”

6) Number of bytes in data part


Indicates the number of bytes in the command data part. The total number of bytes in the request command during data write
operation and the response command during data read operation must not exceed 492 bytes.

7) BCC (block check character)


Indicates the checksum code for send data check. The BCC, consisting of one byte, is obtained by the following formula:

BCC = 00h - { (Data counter) + (Connection status) + • • • + (Data part) }

App.2-3
Appendix 2 Data Access by Command

Appendix 2-3 Details of Loader Commands


Appendix 2-3-1 Read data
1) Function
This command reads the specified number of words from the specified address of the specified data memory. If the requested
number of words to read exceeds the range of the specified memory, up to the end of the specified memory is read.

2) Command/mode code
Command: 00h, Mode: 00h

3) Data format of request command / response command

Request data Response data


Memory type Memory type
Memory address (L) Memory address (L)
Memory address (M) Memory address (M)
Memory address (H) Memory address (H)
Number of read words (L) Number of read words (L)
Number of read words (H) Number of read words (H)
Read data
.
.
.

4) Arrangement of read data


The read data is arranged as shown below.

MICREX-SX module Personal computer


15 0
12 34 34
56 78 12
78
56

5) Example of read data command


When reading 2-word data from the standard memory %MW1.1000 of the CPU module (CPU station No.0), request and
response commands are as shown below. (Data: %MW1.1000 = WORD#16#1234, %MW1.1001 = WORD#16#5678)
Request command : FF 7B FE 00 11 00 00 00 00 00 00 00 00 01 06 00 02 E8 03 00 02 00
Response command : 00 7B FE 00 11 00 00 00 00 00 00 00 00 01 0A 00 02 E8 03 00 02 00 34 12 78 56

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.

Target module Memory type Area name Remark


CPU module 02h Standard memory (%MW1)
04h Retain memory (%MW3)
08h System memory (%MW10)
PE-link module FFh Broadcast area (%MWo.1) (Note 1)
P-link module FFh Broadcast area (%MWo.1) (Note 2)
FL-net module FFh Common memory, etc. (%MWo.1)

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.

<Address correspondence table of PE-link>

Access from loader command


Access from application
H M L
%MWo .1.0 00 1E 00
High-speed 1 area
: : : :
(high-speed bit area)
%MWo .1.511 00 1F FF
%MWo .1.512 00 20 00
High-speed 2 area : : : :
%MWo .1.8703 00 3F FF
%MWo .1.8704 00 40 00
Low-speed 1 area : : : :
%MWo .1.12799 00 4F FF
%MWo .1.12800 00 50 00
Low-speed 2 area : : : :
%MWo .1.25087 00 7F FF

<Address correspondence table of P-link>

Access from loader command


Access from application
H M L
%MWo.1.0 00 00 00
High-speed 1 area
: : : :
(high-speed bit area)
%MWo.1.511 00 01 FF
%MWo.1.512 00 02 00
High-speed 2 area : : : :
%MWo.1.1663 00 06 7F
%MWo.1.1664 00 08 00
Low-speed 1 area : : : :
%MWo.1.14735 00 13 FF
%MWo.1.14736 00 14 00
Low-speed 2 area : : : :
%MWo.1.17807 00 1F FF

App.2-5
Appendix 2 Data Access by Command

Appendix 2-3-2 Write data


1) Function
This command writes the specified number of words to the specified address of the specified data memory.

2) Command/mode code
Command: 01h, Mode: 00h

3) Data format of request command / response command

Request data Response data


Memory type Memory type
Memory address (L) Memory address (L)
Memory address (M) Memory address (M)
Memory address (H) Memory address (H)
Number of write words (L) Number of write words (L)
Number of write words (H) Number of write words (H)
Write data
.
.
.

4) Arrangement of write data


The write data is arranged as shown below.

MICREX-SX module Personal computer


15 0
12 34 34
56 78 12
78
56

5) Example of write data command


When writing 1-word data to the retain memory %MW3.0 of the CPU module (CPU station No.0), request and response
commands are as shown below. (Write data: WORD#16#1234)
Request command : FF 7B FE 00 11 00 00 00 00 00 01 00 00 01 08 00 04 00 00 00 01 00 34 12
Response command : 00 7B FE 00 11 00 00 00 00 00 01 00 00 01 08 00 04 00 00 00 01 00

App.2-6
Appendix 2 Data Access by Command

Appendix 2-3-3 CPU batch start


1) Function
This command starts all the CPUs in the configuration at one time. Each CPU cold-starts or warm-starts depending on its
condition. CPUs that have already started or CPUs whose key switches are set at “RUN” do not perform any processing.
However, a response is returned normally without error.

2) Command/mode code
Command: 04h, Mode: 00h

3) Data format of request command / response command


None

4) Batch start command of CPUs


When starting all the CPUs at one time, request and response commands are as shown below.
Request command : FF 7B FE 00 11 00 00 00 00 00 04 00 00 01 00 00
Response command : 00 7B FE 00 11 00 00 00 00 00 04 00 00 01 00 00

Appendix 2-3-4 CPU batch initialize and start


1) Function
This command initializes and starts all the CPUs in the configuration at one time. Each CPU cold-starts. CPUs that have already
started or CPUs whose key switches are set at “RUN” do not perform any processing. However, a response is returned normally
without error.

2) Command/mode code
Command: 04h, Mode: 01h

3) Data format of request command / response command


None

4) Batch initialization start command of CPUs


When initializing and starting all the CPUs at one time, request and response commands are as shown below.
Request command : FF 7B FE 00 11 00 00 00 00 00 04 01 00 01 00 00
Response command : 00 7B FE 00 11 00 00 00 00 00 04 01 00 01 00 00

Appendix 2-3-5 CPU batch stop


1) Function
This command stops all the CPUs in the configuration at one time.
CPUs that have already started or CPUs whose key switches are set at “RUN” do not perform any processing. However, a
response is returned normally without error.

2) Command/mode code
Command: 04h, Mode: 02h

3) Data format of request command / response command


None

4) Batch stop loader command of CPUs


When stopping all the CPUs at one time, request and response commands are as shown below.
Request command : FF 7B FE 00 11 00 00 00 00 00 04 02 00 01 00 00
Response command : 00 7B FE 00 11 00 00 00 00 00 04 02 00 01 00 00

App.2-7
Appendix 2 Data Access by Command

Appendix 2-3-6 CPU batch reset


1) Function
This command resets all the CPUs in the configuration at one time. This command is executed regardless of the key switch
position of the CPU.

2) Command/mode code
Command: 04h, Mode: 03h

3) Data format of request command / response command


None

4) Batch reset command of CPUs


When resetting all the CPUs at one time, request and response commands are as shown below.
Request command : FF 7B FE 00 11 00 00 00 00 00 04 03 00 01 00 00
Response command : 00 7B FE 00 11 00 00 00 00 00 04 03 00 01 00 00

Appendix 2-3-7 CPU individual start


1) Function
This command starts a specified CPU in the configuration separately. The CPU cold-starts or warm-starts depending on its
condition. If the specified CPU has already been started, an error occurs. To specify the CPU, set the connection mode and
connection ID.

2) Command/mode code
Command: 04h, Mode: 04h

3) Data format of request command / response command


None

4) Example of individual start command of CPU


When starting a specified CPU separately (CPU1 in a multi-CPU system), request and response commands are as shown
below.
Request command : FF 7B FD 00 11 00 00 00 00 00 04 04 00 01 00 00
Response command : 00 7B FD 00 11 00 00 00 00 00 04 04 00 01 00 00

Appendix 2-3-8 CPU individual initialize and start


1) Function
This command Initializes and starts a specified CPU in the configuration separately.
The CPU cold-starts. If the specified CPU has already been started or the key switch is set at “RUN”/”STOP”, an error occurs.
To specify the CPU, set the connection mode and connection ID.
2) Command/mode code
Command: 04h, Mode: 05h

3) Data format of request command / response command


None

4) Example of individual initialization start command of CPU


When initializing and starting a specified CPU separately (CPU1 in a multi-CPU system), request and response commands are
as shown below.
Request command : FF 7B FD 00 11 00 00 00 00 00 04 05 00 01 00 00
Response command : 00 7B FD 00 11 00 00 00 00 00 04 05 00 01 00 00

App.2-8
Appendix 2 Data Access by Command

Appendix 2-3-9 CPU individual stop


1) Function
This command stops a specified CPU in the configuration separately.
If the specified CPU has already stopped or the key switch is set at “RUN”/”STOP,” an error occurs. To specify the CPU, set the
connection mode and connection ID.

2) Command/mode code
Command: 04h, Mode: 06h

3) Data format of request command / response command


None

4) Example of individual stop command of CPU


When stopping a specified CPU separately (CPU1 in a multi-CPU system), request and response commands are as shown
below.
Request command : FF 7B FD 00 11 00 00 00 00 00 04 06 00 01 00 00
Response command : 00 7B FD 00 11 00 00 00 00 00 04 06 00 01 00 00

Appendix 2-3-10 CPU individual reset


1) Function
This command resets a specified CPU in the configuration separately.
If the key switch is set to “RUN”/”STOP,” an error occurs. To specify the CPU, set the connection mode and connection ID.

2) Command/mode code
Command: 04h, Mode: 07h

3) Data format of request command / response command


None

4) Example of individual reset command of CPU


When resetting a specified CPU separately (CPU1 in a multi-CPU system), request and response commands are as shown
below.
Request command : FF 7B FD 00 11 00 00 00 00 00 04 07 00 01 00 00
Response command : 00 7B FD 00 11 00 00 00 00 00 04 07 00 01 00 00

App.2-9
Appendix 3 Additional Description of NP1L-RS3

Appendix 3
Additional Description of NP1L-RS3

Appendix 3-1 Supported Version of NP1L-RS3.....................................App.3-1


Appendix 3-2 General Specifications.....................................................App.3-1
Appendix 3-3 Names and Functions......................................................App.3-1
Appendix 3-3-1 Names.......................................................................................App.3-1
Appendix 3-3-2 Functions...................................................................................App.3-2

Appendix 3-4 Self-diagnosis...................................................................App.3-3


Appendix 3-4-1 Self-diagnosis mode 1...............................................................App.3-3
Appendix 3-4-2 Self-diagnosis mode 2...............................................................App.3-3
(1) RS to CS signal check..............................................................................App.3-3
(2) ER to DR signal check..............................................................................App.3-3
(3) RS-232C data check.................................................................................App.3-3
(4) Holding the result of the check..................................................................App.3-3
Appendix 3-5 Initialization Parameters..................................................App.3-3
Appendix 3-6 Detailed RAS.....................................................................App.3-4
Appendix 3 Additional Description of NP1L-RS3
The general purpose communication module (Type: NP1L-RS3) has two RS-232C ports. The functions and operations are almost
same as those of the other general purpose communication modules (Type:NP1L-RS1/RS2/RS4).
This section describes differences between NP1L-RS3 (hereinafter abbreviated as RS3) and the other modules (NP1L-RS1/RS2/
RS4). Read this appendix as well as the main chapters.

Appendix 3-1 Supported Version of NP1L-RS3


(Relevant page: P1-4)

Type Supported version


Standard CPU **30 or later (Same as NP1L-RS1/2/4.)
CPU
High-performance CPU **25 or later (Same as NP1L-RS1/2/4)
D300winV2 V2.2.6.0 or later
Loader D300winV3 V3.1.4.0 or later
Standard Loader V2.1.0.0 or later

To use NP1L-RS3, use the above version of CPU and loader.


* NP1L-RS3 supports “Modem-based loader function” and “Standard expansion FBs”.

Appendix 3-2 General Specifications


(Relevant page: P2-1)

Item Specification
Isolation method Not isolated
Internal current consumption 110mA or less
Mass Approx. 140g

Appendix 3-3 Names and Functions


(Relevant page: P2-3 to 2-6)

Appendix 3-3-1 Names


Status indication LED Mode selection switch

RS-232C port CH1


(D-sub, 9-pin, female)
Nameplate

RS-232C port CH2


(D-sub, 9-pin, female)

App.3-1
Appendix 3 Additional Description of NP1L-RS3

Appendix 3-3-2 Functions


1) Status indication LED
The table below shows only differences between NP1L-RS3 and the other modules.

Symbol Color Description


CH1 ALM Red Turns on when the communication data of CH1 is abnormal.
CH1 RXD Green Turns on when the port of CH1 is receiving data.
CH1 TXD Green Turns on when data is being sent from the port of CH1.
CH2 ALM Red Turns on when the communication data of CH2 is abnormal.
CH2 RXD Green Turns on when the port of CH2 is receiving data.
CH2 TXD Green Turns on when data is being sent from the port of CH2.

2) Mode selection switch

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

* In the case of switch No. F, use either CH1 or CH2.

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

Appendix 3-4 Self-diagnosis


(Relevant page: P3-10 to p3-11)

Appendix 3-4-1 Self-diagnosis mode 1


Basic operations of the self-diagnosis function are the same as those of NP1L-RS1/2/4. However, LED names are different.
1) LED lighting check
Of the external LEDs of the module, the lighting condition of those operated by general purpose communication module are
checked. When the mode selection switch is set to “7,” “TS1,” “TS2,” “CH2 ALM” and “CH1 ALM” LEDs light up in this order.

Appendix 3-4-2 Self-diagnosis mode 2


(1) RS to CS signal check
In this check, NP1L-RS3 turns RS signal ON to check whether CS signal is looped back and turns ON, and then checks that this
signal turns OFF.
When both CH1 and CH2 are normal, “TS2” lights up; proceeds to step (2).
If either CH1 or CH2 is abnormal, “TS2” blinks (at 0.5-second intervals) after 5 seconds ; proceeds to step (2).
If CH1 is abnormal, “ERR” lights up while “TS2” blinks.
If CH2 is abnormal, “CH2 ALM” lights up while “TS2” blinks.

(2) ER to DR signal check


In this check, NP1L-RS3 turns ER signal ON to check whether DR signal is looped back and turns ON, and then checks that this
signal turns OFF.
When both CH1 and CH2 are normal, “TS1” lights up; proceeds to step (3).
If either CH1 or CH2 is abnormal, “TS1” blinks (at 0.5-second intervals) after 5 seconds ; proceeds to step (3).
If CH1 is abnormal, “ERR” lights up while “TS1” blinks.
If CH2 is abnormal, “CH2 ALM” lights up while “TS1” blinks.

(3) RS-232C data check


The NP1L-RS3 sends 16 bytes of data once and checks the looped back data received.
When both CH1 and CH2 are normal, “CH1 ALM” lights up; proceeds to step (4).
If either CH1 or CH2 is abnormal, “CH1 ALM” blinks (at 0.5-second intervals) after 10 seconds ; proceeds to step (4).
If CH1 is abnormal, “ERR” lights up while “CH1 ALM” blinks.
If CH2 is abnormal, “CH2 ALM” lights up while “CH1 ALM” blinks.

(4) Holding the result of the check


After 10 seconds of displaying the results from (3) above, the module returns to step (1). Here, if the setting of the mode
selection switch has been changed, Self-diagnosis Mode 2 is ended to enter the designated mode.

Appendix 3-5 Initialization Parameters


(Relevant page: P4-7)

No. Item Specification


Designates an interface port on the general purpose communication module.
1 Port No. 0: CH1
1: CH2
12 RS-485 mode Disabled for NP1L-RS3.

App.3-3
Appendix 3 Additional Description of NP1L-RS3

Appendix 3-6 Detailed RAS


(Relevant page: P7-3)
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. (For NP1L-RS3 only. Currently, NP1L-RS1/RS2/RS4 do not support this information.)

General purpose communication


0
module status
1 CH1 port status
2 CH1 port status
3 Reserved
4 Self-diagnosis result 1
5 Self-diagnosis result 2
6 Reserved
7 Reserved
8 Number of parity error occurrences
9 Number of framing error occurrences
10 Number of overrun error occurrences

No.4 (Self-diagnosis result 1)


Bit 0: External RAM error
Bit 1 to 15: Not used
No.5 (Self-diagnosis result 2)

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

CH1 CTS ON error


CH1 CTS OFF error
CH1 DSR ON error
CH1 DSR OFF error
CH2 CTS ON error
CH2 CTS OFF error
CH2 DSR ON error
CH2 DSR OFF error
Not used
Not used
Not used
Not used
CH1 Send/Receive data error (SD  RD) (Send data error detected)
CH1 Loop back error (SD  RD) (Communication error detected)
CH2 Send/Receive data error (SD  RD) (Send data error detected)
CH2 Loop back error (SD  RD) (Communication error detected)

App.3-4
Appendix 4 Additional Description of NP1L-RS5

Appendix 4
Additional Description of NP1L-RS5

Appendix 4-1 Supported Version of NP1L-RS5..................................App.4-1


Appendix 4-2 General Specifications..................................................App.4-1
Appendix 4-3 Names and Functions...................................................App.4-1
Appendix 4-3-1 Names..................................................................................... App.4-1
Appendix 4-3-2 Functions................................................................................. App.4-2

Appendix 4-4 Self-diagnosis................................................................App.4-4


Appendix 4-4-1 Self-diagnosis mode 1............................................................. App.4-4
Appendix 4-4-2 Self-diagnosis mode 2............................................................. App.4-4
(1) RS-485 data check................................................................................. App.4-4
(2) Holding the result of the check................................................................ App.4-4
Appendix 4-5 Initialization Parameter.................................................App.4-4
Appendix 4-6 Loader Network Function.............................................App.4-4
Appendix 4-7 Detailed RAS..................................................................App.4-5
Appendix 4 Additional Description of NP1L-RS5
The general purpose communication module (Type: NP1L-RS5) has two RS-232C ports. The functions and operations are
almost same as those of the other general purpose communication modules (Type:NP1L-RS1/RS2/RS4).
This section describes differences between NP1L-RS5 (hereinafter abbreviated as RS5) and the other modules (NP1L-RS1/
RS2/RS4). Read this appendix as well as the main chapters.

Appendix 4-1 Supported Version of NP1L-RS5


(Relevant page: P1-4)

Type Supported version


SPH200 **30 or later (Same as NP1L-RS1/2/4.)
CPU
SPH300 **25 or later (Same as NP1L-RS1/2/4)
D300win V2 Not supported
Loader D300win V3 V3.3.2.0 or later
Standard Loader V2.2.2.1 or later

To use NP1L-RS5, use the above version of CPU and loader.


* NP1L-RS5 supports “Modem-based loader function” and “Standard expansion FBs”.

Appendix 4-2 General Specifications


(Relevant page: P2-1)

Item Specification
Internal current consumption 110mA or less
Mass Approx. 190g

Appendix 4-3 Names and Functions


(Relevant page: P2-3 to 2-6)

Appendix 4-3-1 Names


Status indication LED

Mode selection switch ONL CH1 TS1


ALM RXD TXD
ERR CH2 TS2

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

RS-485 station No.


F 0 12

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

Appendix 4-3-2 Functions


1) Status indication LED
The table below shows only differences between NP1L-RS5 and the other modules.

Symbol Color Description


CH1 ALM Red Turns on when the communication data of CH1 is abnormal.
CH1 RXD Green Turns on when the port of CH1 is receiving data.
CH1 TXD Green Turns on when data is being sent from the port of CH1.
CH2 ALM Red Turns on when the communication data of CH2 is abnormal.
CH2 RXD Green Turns on when the port of CH2 is receiving data.
CH2 TXD Green Turns on when data is being sent from the port of CH2.
TS1 Green Blinks when internal RAM error is detected in self-diagnosis mode 7.
TS2 Green Not used

2) Mode selection switch

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

* In the case of switch No. F, use either CH1 or CH2.

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

The second digit is set by dip switch.


OFF: 0
ON: 1
The first digit is set by rotary switch. (0 to F)

4) Terminating resistor ON/OFF switch


This switch is used to select ON/OFF of the RS-485 terminating resistor. There are three positions for this switch.

Switch position Status


Right 2-wire type, terminating resistor is available.
Center Terminating resistor is not available.
Left 4-wire type, terminating resistor is available.

5) RS-485 terminal block


This terminal block is used to connect RS-485 cable (20 poles, M3 screw).

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

For wiring, see “6-2 Wiring Method.”


However, for 2-wire, short-circuit SDA and RDA (+), SDB and RDB (-), and then connect them to other devices as terminals.
Since RS5 has a built-in zener diode, you do not need to connect one externally.

App.4-3
Appendix 4 Additional Description of NP1L-RS5

Appendix 4-4 Self-diagnosis


(Relevant page: P3-10 to p3-11)

Appendix 4-4-1 Self-diagnosis mode 1


Basic operations of the self-diagnosis function are the same as those of NP1L-RS1/2/4. However, LED names are different.
1) LED lighting check
Of the external LEDs of the module, the lighting condition of those operated by general purpose communication module are
checked. When the mode selection switch is set to “7,” “TS1,” “TS2,” “CH2 ALM” and “CH1 ALM” LEDs light up in this order.

Appendix 4-4-2 Self-diagnosis mode 2


(1) RS-485 data check
RS5 sends 16 bytes of data once and checks the looped back data received.
When both CH1 and CH2 are normal, “CH1 ALM” lights up; proceeds to step (2).
If CH1 is abnormal, “CH1 ALM” blinks (at 0.5-second intervals) and “ERR” turns ON after 10 seconds; proceeds to step 2.
If CH2 is abnormal, “CH2 ALM” blinks (at 0.5-second intervals) and “ERR” turns ON after 10 seconds; proceeds to step 2.

(2) Holding the result of the check


After 10 seconds of displaying the results from (1) above, the module returns to step (1). Here, if the setting of the mode
selection switch has been changed, Self-diagnosis Mode 2 is ended to enter the designated mode.

Appendix 4-5 Initialization Parameter


(Relevant page: P4-7)

No. Item Specification


Designates an interface port on general purpose communication module.
1 Port No. 0: CH1
1: CH2
8 DCE designation Not used for NP1L-RS5
9 ER/DR signal control Not used for NP1L-RS5
10 Signal flow control Not used for NP1L-RS5

Appendix 4-6 Loader Network Function


(Relevant page: P3-7)
If you use RS5 in a loader network configuration, connect cables to CH2.

App.4-4
Appendix 4 Additional Description of NP1L-RS5

Appendix 4-7 Detailed RAS


(Relevant page: P7-3)
• RS-485 station No. switch setting appears on the bit 5 to 9, 0 to 4 in the communication status area.

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)

General purpose communication


0
module status
1 CH1 port status
2 CH1 port status
3 Reserved
4 Self-diagnosis result 1
5 Self-diagnosis result 2
6 Reserved
7 Reserved
8 Number of parity error occurrences
9 Number of framing error occurrences
10 Number of overrun error occurrences

No.4 (Self-diagnosis result 1)


Bit 0: External RAM abnormal
Bit 1 to 15: Not used
No.5 (Self-diagnostic 2)

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

Appendix 5-1 Supplemental Description of CRC-16..........................App.5-1


Appendix 5 Supplemental Description of CRC-16

Appendix 5-1 Supplemental Description of CRC-16


The general purpose communication module can select CRC for the BCC calculation method. Although there are various
calculation methods for CRC, the general purpose communication module uses CRC-16 (X16 + X15 + X2 + 1).
The conditions for calculation is as follows. (The calculation method and conditions are the same as those of the MICREX-F
series general purpose communication modules/capsules.)
• Initial value: FFFFh
• Polynomial for digit overflow: A001h
• Right-shift calculation is performed. Overflow bits are discarded.

<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

Appendix 6-1 Overview.........................................................................App.6-1


Appendix 6-2 System Configuration Example....................................App.6-1
Appendix 6-3 Supported Versions.......................................................App.6-2
Appendix 6-4 Applicable FB.................................................................App.6-3
Appendix 6-5 Notes on Use..................................................................App.6-7
Appendix 6 Mounting Modules on T-link Expansion

Appendix 6-1 Overview


You can use a general purpose communication module (Type: NP1L-RS1 to RS5) on a T-link expansion by using a new version
of a T-link master (NP1L-TL1), a T-link interface (NP1L-RT1), and a loader. These modules are hereinafter abbreviated as
follows:
RS: General purpose communication module (NP1L-RSo)
TL1: T-link master (NP1L-TL1)
RT1: T-link interface (NP1L-RT1)

Appendix 6-2 System Configuration Example

Power
CPU TL1
supply

T-link

Power
RT1 RS
supply

System definition of the above system configuration

App.6-1
Appendix 6 Mounting Modules on T-link Expansion

Appendix 6-3 Supported Versions


The use of general purpose communication modules on a T-link expansion is supported by the following version of the T-link
master (NP1L-TL1), the T-link interface (NP1L-RT1), and the loader, without depending on the version of the general purpose
communication module.

Name Supported version


T-link master module (NP1L-TL1) Software version 48m or later
T-link interface module (NP1L-RT1) Software version 35* or later
D300win V3.5.2 or later
Loader
Standard V3.0.3 or later

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.

<How to check software version>


Check the software version that is printed on the front of the module.
The software version is represented by a combination of a major version (two-digit number) and miner version (- or alphabet).
When the specifications are greatly changed, the major version is changed.
When a minor change is made, the minor version is changed in the following order: “-” → “a” → “b” → “c” →...
When the major version is changed, the minor version is reset.

Module front view

Hardware major version

24
48

Software major version pm

Hardware minor version Software minor version

App.6-2
Appendix 6 Mounting Modules on T-link Expansion

Appendix 6-4 Applicable FB


Use the dedicated FB (_Cfr92) when RS is used on RT1. Other general purpose communication FBs (such as _Cfree and _cfrp2)
are not available.
The FB for D300win and the FB for Standard are prepared. Fuji Electric Co., Ltd. site offers these FBs.
• FB for D300win: _Cfr92.zwt
• FB for Standard: _Cfr92.zpj

After downloading the FB, follow the steps below.


• For D300win
Place the FB in the “LIBRALIES” folder of the D300win folder and unzip it in D300win.
Then, open a project file to be used, and import the library “_Cfr92.mwt and _C_com.mwt.” The FB can be called.
The FB name to be called is “_Cfr92.”
• For Standard
Place the FB in the LIBRALIES folder of the folder where Standard is installed.
Then, open a project file to be used, and import the library “_Cfr92.zpj.” The FB can be called.
The FB name to be called is “_Cfr92.”

<Memory capacity necessary to use FB>


The FB uses the memories as shown below.
D300win

Program capacity User FB instance System FB instance


Standard memory Retain memory
(step) memory memory
2849 468 words 1830 words 0 word 50 words

Standard

Program area User FB memory System FB memory Standard or retain memory


Approx. 1.8K words
Approx. 3.4K steps 892 words 82 words
(Including user send/receive area: Approx. 0.2K words)

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

Transmission data length


The transmission data length can be up to 184 bytes. Calculate it including the start code, end code and BCC.
For example, when variable length communication is performed with start code STX (1 byte) and end code CR, LF (2 bytes),
and without BCC, practically transmissible data is 181 bytes obtained by 184 - (1 + 2). The data length set for the transmission
data length is 184 bytes including the number of bytes of the start code and end code.
For variable length communication, the start code, end code, and BCC are set in the communication parameter. Therefore, it is
not necessary to set them as transmission data by the application. They are automatically attached when data communication is
performed. (Same operation as _Cfree)

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.

The figure below shows an example of an open request processing program.


In this example, the circuit No. of TL1 is 0 (the circuit No. can be checked in the property of TL1 in the system definition) and
the station No. of RT1 is 0.
A one-second timer is inserted in the program as interval timing to automatically retry if the Open OK is not turned on after an
open request is issued.

<Example for D300win>

(*Open request processing*)

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>

RT1 Open retry Open request


configuration request
flag

Open request

Open request Open request


memory

Open request
memory

Open OK Open retry


request

Open request Open OK

Send request Open status

App.6-6
Appendix 6 Mounting Modules on T-link Expansion

Appendix 6-5 Notes on Use


1) Fail-soft setting
Be sure to register RT1 for “fail-soft”. If RT1 or TL1 is reset when not registered for fail-soft, a fatal fault occurs.

2) The number of mountable modules and the FBs


When using multiple RS modules in “general purpose communication mode,” note the following limits.

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

• Setting screen in Standard

When RS is mounted on RT1, the loader network function is not available.

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.

START code (5Ah fixed)


Transmission header part
(3 bytes) Data counter (L) Command part
+
Data counter (H) Number of bytes of checksum code
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)

Number of bytes in data (L)

Number of bytes in data (H) Up to 492 bytes

Data

Checksum code (1 byte) BCC

Max. 200 bytes when RS is used on RT1

App.6-9
Appendix 7 Changing Communication Parameter in Loader mode

Appendix 7
Changing Communication Parameter in
Loader mode

Appendix 7-1 Overview.........................................................................App.7-1


Appendix 7-2 How to Change Communication Setting.....................App.7-2
Appendix 7-2-1 When using D300win loader.................................................... App.7-2
Appendix 7-2-2 When using Standard loader................................................... App.7-3
Appendix 7 Changing Communication Parameter in Loader mode

Appendix 7-1 Overview


When using general purpose communication modules in "loader mode," the default communication parameter settings are as
follows: Transmission speed: 38400bps, Data length :8 bits, Stop bit: 1, and Parity: Even. You can change these settings by
using the FB.
The parameter area (PARA array of the FB) uses 40 words of memory area. The table below shows the parameters that can be
changed and the setting ranges.
The changed communication settings are cleared and return to the initial values when the PLC is reset (or the power supply is
turned off and then on again.)
* This function is supported by V42 or later version of general purpose communication modules.

Communication parameter Communication parameter


Parameter address Item
default value setting range
+0 SX bus station No. - -
+1 Port No. - -
+2 Message port № - -
0: 1200bps
1: 2400bps
2: 4800bps
+4 Transmission speed 38400 3: 9600bps
4: 19200bps
5: 38400bps
6: 57600bps
0: 7 bits (Do not set to 0.)
+5 Data length 8
1: 8 bits (Be sure to use at 8 bits)
0: None
+6 Parity Even 1: Odd
2: Even
0: 1 bits
+7 Stop bit 1
1: 2 bits

App.7-1
Appendix 7 Changing Communication Parameter in Loader mode

Appendix 7-2 How to Change Communication Setting


To change communication setting, use the FB for general purpose communication modules (_cfr32).

Appendix 7-2-1 When using D300win loader

Parameter setting request When the parameter setting is


Keep this terminal always on. completed normally, “OK” turns on.

Although these terminals are not actually used,


used, assign
assign unusedunused
memories.
memories.
Each of them occupies
uses 512 512
words
words
of memories.
of memories.

Assign a work memory for FB operation.


Do not assign a memory that is used for other purposes.
This terminal occupies 1556 words of memory.

App.7-2
Appendix 7 Changing Communication Parameter in Loader mode

Appendix 7-2-2 When using Standard loader

WL0: SX bus station No. → 1

WL1: Port No. → 0

WL2: Message port No. → 1

WL4: Transmission speed → 4 = 19200bps

WL5: Data bit → 1 = 8 bits

WL6: Parity → 1 = Odd

WL7: Stop → 0 = 1 bit

Parameter setting request


Keep this terminal always on. When the parameter setting
is completed normally, “OK”
turns on.

Although these terminals are not actually used,


assign unused memories.
Each of them occupies 512 words of memories.

Set the first address of the parameter.

Assign a work memory for FB operation.


Do not assign a memory that is used for
other purposes.
This terminal occupies 1556 words of
memory.

App.7-3
Appendix 8 Selecting Commercial RS-232C Cables

Appendix 8
Selecting Commercial RS-232C Cables

Appendix 8-1 Overview.........................................................................App.8-1


Appendix 8-2 Connector Specifications on the PLC side.................App.8-1
Appendix 8-3 How to Select Commercially Available RS-232C
Cable...............................................................................App.8-2
Appendix 8-4 Signal Names of RS-232C.............................................App.8-9
Appendix 8 Selecting Commercial RS-232C Cables

Appendix 8-1 Overview


Check the following points for both the PLC and external device to select an appropriate commercially available RS-232C cable.
• Specifications of RS-232C connector:
connector shape, number of pins, gender (female/male), connector fixing screw type (millimeter/inch screw)
• Pin arrangement of RS-232C connector
• Wiring diagram of RS-232C cable

Appendix 8-2 Connector Specifications on the PLC side


The connector on the PLC side is D-sub 9 pin female. Use a male connector on the cable side.
For fixing screws on the PLC side, millimeter screws (M2.6) are equipped. (Since they are fixed on the printed-circuit board, they
cannot be replaced with inch screws.)
* Many of commercially available cables with a D-sub 9-pin connector are equipped with inch screws. Replace the screws on
the cable side with millimeter screws (M2.6).
Cables that are equipped with inch screws for the connector fixing screws on the PLC side are also available (Make to Order).
For details, contact Fuji sales department. (Add the suffix "Z607" to the model name to order.)

<Connector pin arrangement>

Pin Signal Signal direction


Description
No. name PLC External device
1 CD ← Carrier detect
2 RD ← Receive data
3 SD → Send data
4 ER → Data terminal ready
5 SG Signal ground (common return)
Millimeter screw 6 DR ← Data set ready
(M2.6)
7 RS → Request to send
8 CS ← Clear to send
9 RI ← Call indication

App.8-1
Appendix 8 Selecting Commercial RS-232C Cable

Appendix 8-3 How to Select Commercially Available RS-232C Cable


There are various commercially available RS-232C cables that have different connector specifications (connector shape,
number of pins, gender (female/male), and connector fixing screw type). The cable connections are also different.
In general, the connector specifications and wiring diagram are indicated on the package of commercially available RS-232C
cables. Choose a cable according to the purpose of use.
Check the following points.
• The specifications of the connector on the PLC side (and the external device side) match those of the connector on the cable
side (connector shape, number of pins, gender (female/male), connector fixing screw type).
• Signal lines necessary for communication are connected.
• Connections are made according to the signal direction.
• The the terminals below are used in pairs.
SD and RD
ER and DR
RS and CS
There are two connection patterns for paired terminals.
a) The signal direction of paired terminals on the PLC side is the same as that on the external device side.
→ Connect the paired terminals. (This connection is called "crossover wiring.")
For example, when SD is signal output, and RD is signal input on both the PLC side and external device side (Wring
example 1),
Connect SD on the PLC side (signal direction →) and RD on the external device side (signal direction ←)
Connect RD on the PLC side (signal direction ←) and SD on the external device side (signal direction →)
b) The signal direction of paired terminals on the PLC side is opposite to that on the external device side (mainly for modems)
→ Connect the same terminals. (This connection is called "straight through wiring.")
For example, when SD is signal output and RD is signal input on the PLC side, while RD is signal input and RD is signal
output on the external device side (Wring example 2) ,
Connect SD on the PLC side (signal direction →) and SD on the external device side (signal direction ←)
Connect RD on the PLC side (signal direction ←) and RD on the external device side (signal direction →)

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

Pin Signal Signal direction


Description
No. name Personal computer PLC
1 CD ← Carrier detect
2 RD ← Receive data
3 SD → Send data
4 ER → Data terminal ready
5 SG Signal ground (common return)
Inch screw 6 DR ← Data set ready
7 RS → Request to send
8 CS ← Clear to send
9 RI ← Call indication

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

PLC side Personal computer side


Signal Signal Signal Signal
Pin No. Pin No.
name direction direction name
1 CD ← → CD 1
2 RD ← → RD 2
3 SD → ← SD 3
4 ER → ← ER 4
5 SG SG 5
6 DR ← → DR 6
7 RS → ← RS 7
8 CS ← → CS 8
9 RI ← → RI 9

Connection 2

PLC side Personal computer side


Signal Signal Signal Signal
Pin No. Pin No.
name direction direction name
1 CD ← → CD 1
2 RD ← → RD 2
3 SD → ← SD 3
4 ER → ← ER 4
5 SG SG 5
6 DR ← → DR 6
7 RS → ← RS 7
8 CS ← → CS 8
9 RI ← → RI 9

* 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)

Replace with millimeter Replace with


screws (M2.6) and millimeter screws (M2.6).
millimeter nuts (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

Pin Signal Signal direction


Description
No. name Personal computer PLC
1 CD → Carrier detect
2 RD → Receive data
3 SD ← Send data
4 ER ← Data terminal ready
5 SG Signal ground (common return)
Inch screw 6 DR → Data set ready
7 RS ← Request to send
8 CS → Clear to send
9 RI → Call indication

* The signal direction of a modem is opposite to that of a PLC.

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.)

PLC side Modem side


Signal Signal Signal Signal
Pin No. Pin No.
name direction direction name
1 CD ← ← CD 1
2 RD ← ← RD 2
3 SD → → SD 3
4 ER → → ER 4
5 SG SG 5
6 DR ← ← DR 6
7 RS → → RS 7
8 CS ← ← CS 8
9 RI ← ← RI 9

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

RS-232C straight cable


supplied with modem
D-sub, 9-pin
Female-Male
D-sub, 9-pin
Female D-sub, 9-pin
Millimeter screw Female
(M2.6)

Replace with millimeter Replace with


screws (M2.6) and millimeter screws (M2.6).
millimeter nuts (M2.6).

App.8-8
Appendix 8 Selecting Commercial RS-232C Cable

Appendix 8-4 Signal Names of RS-232C


The signal names of RS-232C may be different depending on the device.
For signal names that are not shown on this manual, see the correspondence table below.

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

Appendix 9-1 Notion about Data Length when Using


Non-procedural FB........................................................App.9-1
Appendix 9 Data Length when Using Non-procedural FB

Appendix 9-1 Notion about Data Length when Using Non-procedural FB


This section describes the notion about data length when using the nun-procedural FBs such as _cfree, _cfr32, and _cfrp2,
taking data sending as an example. The same applies to data receiving.

Memory in PLC
In the case of data (Code conversion "None") setting on RS-232C/RS-485 line
(Array of FB for data sending)

S_DAT[0] Data 2 Data 1 1 byte


S_DAT[1] Data 4 Data 3
S_DAT[2] Data 6 Data 5 Start code Data 1 Data 2 Data 3 Data 4 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).

In the case of data (Code conversion: ASCII/EBCDIC) setting on RS-232C/RS-485 line

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.

You might also like