advertisement
MELSEC iQ-R Serial Communication Module
User's Manual (Application)
-RJ71C24
-RJ71C24-R2
-RJ71C24-R4
SAFETY PRECAUTIONS
(Read these precautions before using this product.)
Before using this product, please read this manual and the relevant manuals carefully and pay full attention to safety to handle the product correctly.
The precautions given in this manual are concerned with this product only. For the safety precautions for the programmable controller system, refer to the user's manual for the module used and the MELSEC iQ-R Module Configuration Manual.
In this manual, the safety precautions are classified into two levels:" WARNING" and " CAUTION".
WARNING
Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
CAUTION
Indicates that incorrect handling may cause hazardous conditions, resulting in minor or moderate injury or property damage.
Under some circumstances, failure to observe the precautions given under " CAUTION" may lead to serious consequences.
Observe the precautions of both levels because they are important for personal and system safety.
Make sure that the end users read this manual and then keep the manual in a safe place for future reference.
1
2
[Design Precautions]
WARNING
● Configure safety circuits external to the programmable controller to ensure that the entire system operates safely even when a fault occurs in the external power supply or the programmable controller.
Failure to do so may result in an accident due to an incorrect output or malfunction.
(1) Emergency stop circuits, protection circuits, and protective interlock circuits for conflicting operations (such as forward/reverse rotations or upper/lower limit positioning) must be configured external to the programmable controller.
(2) When the programmable controller detects an abnormal condition, it stops the operation and all outputs are:
• Turned off if the overcurrent or overvoltage protection of the power supply module is activated.
• Held or turned off according to the parameter setting if the self-diagnostic function of the CPU module detects an error such as a watchdog timer error.
(3) All outputs may be turned on if an error occurs in a part, such as an I/O control part, where the
CPU module cannot detect any error. To ensure safety operation in such a case, provide a safety mechanism or a fail-safe circuit external to the programmable controller. For a fail-safe circuit example, refer to the MELSEC iQ-R Module Configuration Manual.
(4) Outputs may remain on or off due to a failure of a component such as a relay and transistor in an output circuit. Configure an external circuit for monitoring output signals that could cause a serious accident.
● In an output circuit, when a load current exceeding the rated current or an overcurrent caused by a load short-circuit flows for a long time, it may cause smoke and fire. To prevent this, configure an external safety circuit, such as a fuse.
● Configure a circuit so that the programmable controller is turned on first and then the external power supply. If the external power supply is turned on first, an accident may occur due to an incorrect output or malfunction.
● Configure a circuit so that the external power supply is turned off first and then the programmable controller. If the programmable controller is turned off first, an accident may occur due to an incorrect output or malfunction.
● For the operating status of each station after a communication failure, refer to manuals for the network used. For the manuals, please consult your local Mitsubishi representative. Incorrect output or malfunction due to a communication failure may result in an accident.
● When connecting an external device with a CPU module or intelligent function module to modify data of a running programmable controller, configure an interlock circuit in the program to ensure that the entire system will always operate safely. For other forms of control (such as program modification, parameter change, forced output, or operating status change) of a running programmable controller, read the relevant manuals carefully and ensure that the operation is safe before proceeding. Improper operation may damage machines or cause accidents. When a Safety CPU is used, data cannot be modified while the Safety CPU is in SAFETY MODE.
● Especially, when a remote programmable controller is controlled by an external device, immediate action cannot be taken if a problem occurs in the programmable controller due to a communication failure. To prevent this, configure an interlock circuit in the program, and determine corrective actions to be taken between the external device and CPU module in case of a communication failure.
[Design Precautions]
WARNING
● Do not write any data to the "system area" and "write-protect area" of the buffer memory in the module. Also, do not use any "use prohibited" signals as an output signal from the CPU module to each module. Doing so may cause malfunction of the programmable controller system. For the
"system area", "write-protect area", and the "use prohibited" signals, refer to the user's manual for the module used. For areas used for safety communications, they are protected from being written by users, and thus safety communications failure caused by data writing does not occur.
● If a communication cable is disconnected, the network may be unstable, resulting in a communication failure of multiple stations. Configure an interlock circuit in the program to ensure that the entire system will always operate safely even if communications fail. Incorrect output or malfunction due to a communication failure may result in an accident. When safety communications are used, an interlock by the safety station interlock function protects the system from an incorrect output or malfunction.
[Design Precautions]
CAUTION
● Do not install the control lines or communication cables together with the main circuit lines or power cables. Doing so may result in malfunction due to electromagnetic interference. Keep a distance of
100mm or more between those cables.
● During control of an inductive load such as a lamp, heater, or solenoid valve, a large current
(approximately ten times greater than normal) may flow when the output is turned from off to on.
Therefore, use a module that has a sufficient current rating.
● After the CPU module is powered on or is reset, the time taken to enter the RUN status varies depending on the system configuration, parameter settings, and/or program size. Design circuits so that the entire system will always operate safely, regardless of the time.
● Do not power off the programmable controller or do not reset the CPU module while the settings are being written. Doing so will make the data in the flash ROM or SD memory card undefined. The values need to be set in the buffer memory and written to the flash ROM or the SD memory card again. Doing so may cause malfunction or failure of the module.
● When changing the operating status of the CPU module from external devices (such as the remote
RUN/STOP functions), select "Do Not Open by Program" for "Opening Method" of "Module
Parameter". If "Open by Program" is selected, an execution of the remote STOP function causes the communication line to close. Consequently, the CPU module cannot reopen the line, and external devices cannot execute the remote RUN function.
3
4
[Security Precautions]
WARNING
● To maintain the security (confidentiality, integrity, and availability) of the programmable controller and the system against unauthorized access, denial-of-service (DoS) attacks, computer viruses, and other cyberattacks from external devices via the network, take appropriate measures such as firewalls, virtual private networks (VPNs), and antivirus solutions.
[Installation Precautions]
WARNING
● Shut off the external power supply (all phases) used in the system before mounting or removing the module. Failure to do so may result in electric shock or cause the module to fail or malfunction.
[Installation Precautions]
CAUTION
● Use the programmable controller in an environment that meets the general specifications in the
MELSEC iQ-R Module Configuration Manual. Failure to do so may result in electric shock, fire, malfunction, or damage to or deterioration of the product.
● To mount a module, place the concave part(s) located at the bottom onto the guide(s) of the base unit, and push in the module until the hook(s) located at the top snaps into place. Incorrect interconnection may cause malfunction, failure, or drop of the module.
● To mount a module with no module fixing hook, place the concave part(s) located at the bottom onto the guide(s) of the base unit, push in the module, and fix it with screw(s). Incorrect interconnection may cause malfunction, failure, or drop of the module.
● When using the programmable controller in an environment of frequent vibrations, fix the module with a screw.
● Tighten the screws within the specified torque range. Undertightening can cause drop of the component or wire, short circuit, or malfunction. Overtightening can damage the screw and/or module, resulting in drop, short circuit, or malfunction. For the specified torque range, refer to the MELSEC iQ-
R Module Configuration Manual.
● When using an extension cable, connect it to the extension cable connector of the base unit securely.
Check the connection for looseness. Poor contact may cause malfunction.
● When using an SD memory card, fully insert it into the SD memory card slot. Check that it is inserted completely. Poor contact may cause malfunction.
[Installation Precautions]
CAUTION
● Securely insert an extended SRAM cassette or a battery-less option cassette into the cassette connector of the CPU module. After insertion, close the cassette cover and check that the cassette is inserted completely. Poor contact may cause malfunction.
● Beware that the module could be very hot while power is on and immediately after power-off.
● Do not directly touch any conductive parts and electronic components of the module, SD memory card, extended SRAM cassette, battery-less option cassette, or connector. Doing so can cause malfunction or failure of the module.
[Wiring Precautions]
WARNING
● Shut off the external power supply (all phases) used in the system before installation and wiring.
Failure to do so may result in electric shock or cause the module to fail or malfunction.
● After installation and wiring, attach a blank cover module (RG60) to each empty slot before powering on the system for operation. Also, attach an extension connector protective cover
*1
to each unused extension cable connector as necessary. Directly touching any conductive parts of the connectors while power is on may result in electric shock.
*1 For details, please consult your local Mitsubishi Electric representative.
5
6
[Wiring Precautions]
CAUTION
● Individually ground the FG and LG terminals of the programmable controller with a ground resistance of 100 ohms or less. Failure to do so may result in electric shock or malfunction.
● Use applicable solderless terminals and tighten them within the specified torque range. If any spade solderless terminal is used, it may be disconnected when the terminal screw comes loose, resulting in failure.
● Check the rated voltage and signal layout before wiring to the module, and connect the cables correctly. Connecting a power supply with a different voltage rating or incorrect wiring may cause fire or failure.
● Connectors for external devices must be crimped or pressed with the tool specified by the manufacturer, or must be correctly soldered. Incomplete connections may cause short circuit, fire, or malfunction.
● Securely connect the connector to the module. Poor contact may cause malfunction.
● Do not install the control lines or communication cables together with the main circuit lines or power cables. Doing so may result in malfunction due to noise. Keep a distance of 100mm or more between those cables.
● Place the cables in a duct or clamp them. If not, dangling cables may swing or inadvertently be pulled, resulting in malfunction or damage to modules or cables.
In addition, the weight of the cables may put stress on modules in an environment of strong vibrations and shocks.
Do not clamp the extension cables with the jacket stripped. Doing so may change the characteristics of the cables, resulting in malfunction.
● Check the interface type and correctly connect the cable. Incorrect wiring (connecting the cable to an incorrect interface) may cause failure of the module and external device.
● Tighten the terminal screws or connector screws within the specified torque range. Undertightening can cause drop of the screw, short circuit, fire, or malfunction. Overtightening can damage the screw and/or module, resulting in drop, short circuit, fire, or malfunction.
● When disconnecting the cable from the module, do not pull the cable by the cable part. For the cable with connector, hold the connector part of the cable. For the cable connected to the terminal block, loosen the terminal screw. Pulling the cable connected to the module may result in malfunction or damage to the module or cable.
● Prevent foreign matter such as dust or wire chips from entering the module. Such foreign matter can cause a fire, failure, or malfunction.
● When a protective film is attached to the top of the module, remove it before system operation. If not, inadequate heat dissipation of the module may cause a fire, failure, or malfunction.
[Wiring Precautions]
CAUTION
● Programmable controllers must be installed in control panels. Connect the main power supply to the power supply module in the control panel through a relay terminal block. Wiring and replacement of a power supply module must be performed by qualified maintenance personnel with knowledge of protection against electric shock. For wiring, refer to the MELSEC iQ-R Module Configuration Manual.
● For Ethernet cables to be used in the system, select the ones that meet the specifications in the user's manual for the module used. If not, normal data transmission is not guaranteed.
[Startup and Maintenance Precautions]
WARNING
● Do not touch any terminal while power is on. Doing so will cause electric shock or malfunction.
● Correctly connect the battery connector. Do not charge, disassemble, heat, short-circuit, solder, or throw the battery into the fire. Also, do not expose it to liquid or strong shock. Doing so will cause the battery to produce heat, explode, ignite, or leak, resulting in injury or fire.
● Shut off the external power supply (all phases) used in the system before cleaning the module or retightening the terminal screws, connector screws, or module fixing screws. Failure to do so may result in electric shock.
7
8
[Startup and Maintenance Precautions]
CAUTION
● When connecting an external device with a CPU module or intelligent function module to modify data of a running programmable controller, configure an interlock circuit in the program to ensure that the entire system will always operate safely. For other forms of control (such as program modification, parameter change, forced output, or operating status change) of a running programmable controller, read the relevant manuals carefully and ensure that the operation is safe before proceeding. Improper operation may damage machines or cause accidents.
● Especially, when a remote programmable controller is controlled by an external device, immediate action cannot be taken if a problem occurs in the programmable controller due to a communication failure. To prevent this, configure an interlock circuit in the program, and determine corrective actions to be taken between the external device and CPU module in case of a communication failure.
● Do not disassemble or modify the modules. Doing so may cause failure, malfunction, injury, or a fire.
● Use any radio communication device such as a cellular phone or PHS (Personal Handy-phone
System) more than 25cm away in all directions from the programmable controller. Failure to do so may cause malfunction.
● Shut off the external power supply (all phases) used in the system before mounting or removing the module. Failure to do so may cause the module to fail or malfunction.
● Tighten the screws within the specified torque range. Undertightening can cause drop of the component or wire, short circuit, or malfunction. Overtightening can damage the screw and/or module, resulting in drop, short circuit, or malfunction.
● After the first use of the product, do not perform each of the following operations more than 50 times
(IEC 61131-2/JIS B 3502 compliant).
Exceeding the limit may cause malfunction.
• Mounting/removing the module to/from the base unit
• Inserting/removing the extended SRAM cassette or battery-less option cassette to/from the
CPU module
• Mounting/removing the terminal block to/from the module
• Connecting/disconnecting the extension cable to/from the base unit
● After the first use of the product, do not insert/remove the SD memory card to/from the CPU module more than 500 times. Exceeding the limit may cause malfunction.
● Do not touch the metal terminals on the back side of the SD memory card. Doing so may cause malfunction or failure of the module.
● Do not touch the integrated circuits on the circuit board of an extended SRAM cassette or a batteryless option cassette. Doing so may cause malfunction or failure of the module.
● Do not drop or apply shock to the battery to be installed in the module. Doing so may damage the battery, causing the battery fluid to leak inside the battery. If the battery is dropped or any shock is applied to it, dispose of it without using.
[Startup and Maintenance Precautions]
CAUTION
● Startup and maintenance of a control panel must be performed by qualified maintenance personnel with knowledge of protection against electric shock. Lock the control panel so that only qualified maintenance personnel can operate it.
● Before handling the module, touch a conducting object such as a grounded metal to discharge the static electricity from the human body. Wearing a grounded antistatic wrist strap is recommended.
Failure to discharge the static electricity may cause the module to fail or malfunction.
● Use a clean and dry cloth to wipe off dirt on the module.
[Operation Precautions]
CAUTION
● When changing data and operating status, and modifying program of the running programmable controller from an external device such as a personal computer connected to an intelligent function module, read relevant manuals carefully and ensure the safety before operation. Incorrect change or modification may cause system malfunction, damage to the machines, or accidents.
● Do not power off the programmable controller or reset the CPU module while the setting values in the buffer memory are being written to the flash ROM in the module. Doing so will make the data in the flash ROM or SD memory card undefined. The values need to be set in the buffer memory and written to the flash ROM or SD memory card again. Doing so can cause malfunction or failure of the module.
9
10
[Computer Connection Precautions]
CAUTION
● When connecting a personal computer to a module having a USB interface, observe the following precautions as well as the instructions described in the manual for the personal computer used.
Failure to do so may cause the module to fail.
(1) When the personal computer is AC-powered
When the personal computer has a 3-pin AC plug or an AC plug with a grounding wire, connect the plug to a grounding receptacle or ground the grounding wire. Ground the personal computer and the module with a ground resistance of 100 ohms or less.
When the personal computer has a 2-pin AC plug without a grounding wire, connect the computer to the module by following the procedure below. For power supplied to the personal computer and the module, using the same power source is recommended.
1. Unplug the personal computer from the AC receptacle.
2. Check that the personal computer is unplugged. Then, connect the personal computer to the module with a USB cable.
3. Plug the personal computer into the AC receptacle.
(2) When the personal computer is battery-powered
The personal computer can be connected to the module without taking specific measures.
For details, refer to the following.
Cautions When Using Mitsubishi Electric Programmable Controllers or GOTs Connected to a
Personal Computer With the RS-232/USB Interface (FA-A-0298)
When the USB cable used is the GT09-C30USB-5P manufactured by Mitsubishi Electric, specific measures are not required to connect the AC-powered personal computer to the module. However, note that the signal ground (SG) is common for the module and its USB interface. Therefore, if an SG potential difference occurs between the module and the connected devices, it causes failures of the module and the connected devices.
[Disposal Precautions]
CAUTION
● When disposing of this product, treat it as industrial waste.
● When disposing of batteries, separate them from other wastes according to the local regulations. For details on battery regulations in EU member states, refer to the MELSEC iQ-R Module Configuration
Manual.
[Transportation Precautions]
CAUTION
● When transporting lithium batteries, follow the transportation regulations. For details on the regulated models, refer to the MELSEC iQ-R Module Configuration Manual.
● The halogens (such as fluorine, chlorine, bromine, and iodine), which are contained in a fumigant used for disinfection and pest control of wood packaging materials, may cause failure of the product.
Prevent the entry of fumigant residues into the product or consider other methods (such as heat treatment) instead of fumigation. The disinfection and pest control measures must be applied to unprocessed raw wood.
CONDITIONS OF USE FOR THE PRODUCT
(1) MELSEC programmable controller ("the PRODUCT") shall be used in conditions; i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major or serious accident; and ii) where the backup and fail-safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT.
(2) The PRODUCT has been designed and manufactured for the purpose of being used in general industries.
MITSUBISHI ELECTRIC SHALL HAVE NO RESPONSIBILITY OR LIABILITY (INCLUDING, BUT NOT LIMITED TO
ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT, WARRANTY, TORT, PRODUCT
LIABILITY) FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO PROPERTY CAUSED BY the
PRODUCT THAT ARE OPERATED OR USED IN APPLICATION NOT INTENDED OR EXCLUDED BY
INSTRUCTIONS, PRECAUTIONS, OR WARNING CONTAINED IN MITSUBISHI ELECTRIC USER'S, INSTRUCTION
AND/OR SAFETY MANUALS, TECHNICAL BULLETINS AND GUIDELINES FOR the PRODUCT.
("Prohibited Application")
Prohibited Applications include, but not limited to, the use of the PRODUCT in;
• Nuclear Power Plants and any other power plants operated by Power companies, and/or any other cases in which the public could be affected if any problem or fault occurs in the PRODUCT.
• Railway companies or Public service purposes, and/or any other cases in which establishment of a special quality assurance system is required by the Purchaser or End User.
• Aircraft or Aerospace, Medical applications, Train equipment, transport equipment such as Elevator and Escalator,
Incineration and Fuel devices, Vehicles, Manned transportation, Equipment for Recreation and Amusement, and
Safety devices, handling of Nuclear or Hazardous Materials or Chemicals, Mining and Drilling, and/or other applications where there is a significant risk of injury to the public or property.
Notwithstanding the above restrictions, Mitsubishi Electric may in its sole discretion, authorize use of the PRODUCT in one or more of the Prohibited Applications, provided that the usage of the PRODUCT is limited only for the specific applications agreed to by Mitsubishi Electric and provided further that no special quality assurance or fail-safe, redundant or other safety features which exceed the general specifications of the PRODUCTs are required. For details, please contact the Mitsubishi Electric representative in your region.
(3) Mitsubishi Electric shall have no responsibility or liability for any problems involving programmable controller trouble and system trouble caused by DoS attacks, unauthorized access, computer viruses, and other cyberattacks.
11
12
INTRODUCTION
Thank you for purchasing the Mitsubishi Electric MELSEC iQ-R series programmable controllers.
This manual describes the functions and programming to use the module listed below.
Before using the product, please read this manual and relevant manuals carefully and develop familiarity with the performance of MELSEC iQ-R series programmable controller to handle the product correctly.
When applying the example programs provided in this manual to an actual system, ensure the applicability and confirm that it will not cause system control problems.
Please make sure that the end users read this manual.
The program examples shown in this manual are the examples in which C24 is assigned to the input/output
No. X/Y0 to X/Y1F unless otherwise specified. To use the program examples shown in this manual, the input/ output number assignment is required. For details on the assignment of input/output number, refer to the following manual.
MELSEC iQ-R Module Configuration Manual
Relevant products
RJ71C24, RJ71C24-R2, RJ71C24-R4
CONTENTS
PART 1 BASIC FUNCTIONS
CHAPTER 1 DATA COMMUNICATION USING MC PROTOCOL
26
CHAPTER 2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
30
CHAPTER 3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
56
CHAPTER 4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
89
13
14
Processing when Simultaneous Transmission is Performed during Full-Duplex Communications . . . 107
CHAPTER 5 DATA COMMUNICATION USING MODBUS
112
CHAPTER 6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
118
CHAPTER 7 DEBUG SUPPORT FUNCTION
142
PART 2 ADDITIONAL FUNCTIONS
CHAPTER 8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING
FUNCTION 151
CHAPTER 9 COMMUNICATIONS BY THE MODEM FUNCTION
180
CHAPTER 10 RECEIVING DATA WITH AN INTERRUPT PROGRAM 251
CHAPTER 11 CHANGING DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTE
UNITS SETTING) 257
CHAPTER 12 CHANGING DATA COMMUNICATION MONITORING TIME 259
15
16
CHAPTER 13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION
CONTROL 268
CHAPTER 14 DATA COMMUNICATIONS USING HALF-DUPLEX
COMMUNICATIONS 275
CHAPTER 15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA
COMMUNICATION 282
CHAPTER 16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES 299
CHAPTER 17 DATA COMMUNICATIONS USING USER FRAMES 308
Application Program for Data Transmission using a Combination that does not Specify the Start
CHAPTER 18 TRANSPARENT CODES AND ADDITIONAL CODES 358
CHAPTER 19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) 379
CHAPTER 20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU
MODULE IN M:N BASIS 398
17
18
CHAPTER 21 SWITCHING THE MODE AFTER STARTING 409
CHAPTER 22 USING SEND/RECEIVE DATA MONITORING FUNCTION 419
CHAPTER 23 INDEPENDENT/LINKED OPERATION OF INTERFACE 429
CHAPTER 24 PARAMETER REGISTRATION TO CPU MODULE 434
CHAPTER 25 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT
SPECIFICATION 436
CHAPTER 26 ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION
FUNCTION 438
CHAPTER 27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN
SEND DATA 440
PART 3 PARAMETER SETTINGS AND TROUBLESHOOTING
CHAPTER 28 PARAMETER SETTING 454
CHAPTER 29 TROUBLESHOOTING 482
Read request signal does not turn ON even though the target device transmitted a message and the RD
19
20
APPENDIX 544
INDEX 687
RELEVANT MANUALS
Manual name [manual number]
MELSEC iQ-R Serial Communication Module User's
Manual(Application)
[SH-081251ENG] (this manual)
MELSEC iQ-R Serial Communication Module User's
Manual(Startup)
[SH-081250ENG]
MELSEC iQ-R Module Configuration Manual
[SH-081262ENG]
Description
Functions, input/output signals, buffer memory, parameter setting, and trouble shooting of Serial communication module
Specifications, procedures prior to operation, system configurations, wring, and data communication examples of Serial communication module
The combination of the MELSEC iQ-R series modules, common information on the installation/wiring in the system, and specifications of the power supply module, base unit, SD memory card, and battery
Dedicated instructions for an intelligent function module
Available form
Print book e-Manual
Print book e-Manual
PDF e-Manual
PDF e-Manual
MELSEC iQ-R Programming Manual (Module
Dedicated Instructions)
[SH-081976ENG]
MELSEC iQ-R Serial Communication Module
Function Block Reference
[BCN-P5999-0379]
GX Works3 Operating Manual
[SH-081215ENG]
MELSEC Communication Protocol Reference
Manual
[SH-080008]
FBs of a Serial communication module
System configurations, parameter settings, and operation methods for the online function in GX Works3
Specifications, accessible range, message protocols, and functions of
MELSEC Communication Protocol e-Manual
PDF e-Manual
Print book e-Manual
PDF e-Manual refers to the Mitsubishi Electric FA electronic book manuals that can be browsed using a dedicated tool.
e-Manual has the following features:
• Required information can be cross-searched in multiple manuals.
• Other manuals can be accessed from the links in the manual.
• The hardware specifications of each part can be found from the product figures.
• Pages that users often browse can be bookmarked.
• Sample programs can be copied to an engineering tool.
21
22
TERMS
Unless otherwise specified, this manual uses the following terms.
Terminology
3C frame
(Formats 1 to 4)
4C frame
(Formats 1 to 4)
4C frame
(Format 5)
Bidirectional protocol
Buffer memory
BUFRCVS
C24
CPRTCL
CPU module
CSET
Data communication function
Engineering tool
GETE
Independent operation
INPUT
Intelligent function module
Interlink operation
MC protocol
Multidrop connection
Nonprocedural protocol
ONDEMAND
OUTPUT
Packet
Predefined protocol
Predefined protocol support function
PRR
PUTE
Redundant system with redundant extension base unit
Remote head module
Description
A message format for C24 for data communications with ASCII code data using the MC protocol
This is the same message format as the communication frame using the dedicated protocol for the QnA series Serial
Communication Module.
• QnA compatible 3C frame (Formats 1 to 4): QnA frame (Formats 1 to 4)
• QnA compatible 4C frame (Formats 1 to 4): QnA extension frame (Formats 1 to 4)
A message format for C24 for data communication with binary code data using the MC protocol
This is the same message format as the communication frame using the dedicated protocol for the QnA series Serial
Communication Module.
• QnA compatible 4C frame (Format 5): QnA extension frame (Format 5)
A data communication function to communicate any data between a CPU module and the target device using the communication procedure for C24
A memory of an Intelligent function module to store data (including setting value and monitored value) sent to/receive from
CPU module
An abbreviation for Z.BUFRCVS
Another term for the MELSEC iQ-R series Serial Communication Module
An abbreviation for G.CPRTCL or GP.CPRTCL
A generic term for MELSEC iQ-R series CPU module
An abbreviation for ZP.CSET
A generic term for data communication functions using MC protocol, predefined protocol, nonprocedural protocol, bidirectional protocol, MODBUS, and simple CPU communication
A tool for setting, programming, debugging, and maintaining programmable controllers
For the supported tools, refer to the following manual.
MELSEC iQ-R Module Configuration Manual
An abbreviation for G.GETE or GP.GETE
A mode of interface operation to communicate data with the target device with a function specified in each communication protocol setting without interaction between two interfaces of C24
An abbreviation for G.INPUT
A generic term for modules which has functions other than input and output, such as A/D converter module and D/A converter module
A mode of interface operation to communicate data with the target device with the two interfaces linked one another when two interfaces of C24 are connected to target devices respectively
The two interfaces communicate data with the same data communication function (MC protocol (identical format) or nonprocedural protocol) and the same transmission specifications. (Interlink operation of the predefined protocol and the bidirectional protocol is not allowed.)
An abbreviation for MELSEC communication protocol, which is a name of communication method to access a CPU module form a target device using the communication procedure for Serial communication modules or Ethernet communication modules
A name of connection when more than one target devices or other C24s are connected on a 1:n basis or an m:n basis using the RS-422/485 interface of C24
A data communication function to communicate any data between a CPU module and the target device using user's communication procedure
An abbreviation for G.ONDEMAND or GP.ONDEMAND
An abbreviation for G.OUTPUT or GP.OUTPUT
A data string used for communication with a target device by predefined protocol
A data communication function to send/receive data using a protocol of the target device for data communication between
C24 and the target device
This setting is configured with GX Works3 (the predefined protocol support function).
A function available using GX Works3 (the predefined protocol support function)
The function includes the following:
• Setting the protocol appropriate to respective target devices
• Writing or reading the protocol setting data to/from CPU module or C24
• Debug support function
An abbreviation for G.PRR or GP.PRR
An abbreviation for G.PUTE or GP.PUTE
A redundant system that is configured using extension base unit(s)
An abbreviation for RJ72GF15-T2 CC-Link IE Field Network remote head module.
Terminology
SPBUSY
Target device
UINI
User frame
Description
An abbreviation for G.SPBUSY or GP.SPBUSY
A generic term for GOT, measuring instruments, ID modules, barcode readers, regulators, and other C24s connected to this
C24 for data communication
An abbreviation for ZP.UINI
A data name used to send/receive data by registering the fixed format part of messages to be sent/received between C24 and the target device to the module (The contents of a user frame data should conform to the specifications of the target device.)
The data array of the head and tail sections in messages to be sent/received (transmission control code, C24 station number, sum check, fixed data, etc.) are registered to C24 respectively before use.
This is used for the on-demand function of MC protocol and the data transmit/receive function by nonprocedural protocol.
23
24
MEMO
PART 1 BASIC FUNCTIONS
This part explains the basic functions of C24.
1 DATA COMMUNICATION USING MC PROTOCOL
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
5 DATA COMMUNICATION USING MODBUS
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
25
1
DATA COMMUNICATION USING MC
PROTOCOL
MC protocol is a communication method for programmable controllers, which enable device data and programs in the CPU module to be read from/written to target devices via C24.
C24 returns a response message automatically based on requests from the target devices. Thus, programs for response messages are not required.
For details of the MC protocol, refer to the following manual.
MELSEC Communication Protocol Reference Manual
ENQ Command Characters
Sum check code
Sum check code
ETX
Characters
STX
1.1
Accessing to CPU Module Using MC Protocol
This section explains how to access to a CPU module using MC protocol.
Reading/writing device memory of CPU module
Read/write data from/to the device memory of the access target CPU or intelligent function module buffer memory. For the accessible range, refer to the following manual.
MELSEC Communication Protocol Reference Manual
Reading/writing programs and parameters
This function reads and writes program files and parameter files stored in the CPU module.
Remote control of CPU module
This function performs remote RUN/STOP/PAUSE/latch clear/reset operations.
Monitoring of CPU module
This function monitors the operation status and data in the device memory of the CPU module.
Transmitting data to a target device from a CPU module
This function requests data transmission from a CPU module to a target device, and transmits on-demand data to the target device.
26
1 DATA COMMUNICATION USING MC PROTOCOL
1.1 Accessing to CPU Module Using MC Protocol
File access method
To access to a file, which the password setting is configured, from external devices using the MC protocol, specifying the command for file password is required.
1.
Specify the password with a request message.
2.
Perform the password authentication by using the specified password.
For command requiring the password authentication, specify "0040" with the setting value of "subcommand" in the request message.
Function
Deleting file
Copying file
Changing file attribute
Opening file
Command (subcommand)
1822 (0040)
1824 (0040)
1825 (0040)
1827 (0040)
For more details on the commands, refer to the following manual.
MELSEC Communication Protocol Reference Manual
1.2
Data Communication
MC protocol uses the following communication frames for data communication.
Transmit/receive data from the target device in the data format corresponding to the MC protocol.
For details on the communication frames format, refer to the following manual.
MELSEC Communication Protocol Reference Manual
Formats and codes
There are five formats for the data communication frames:
1
4
5
2
3
Setting value format
Format 1
Format 2
Format 3
Format 4
Format 5
Code of communication data
ASCII code
ASCII code
ASCII code
ASCII code
Binary code
Remarks
A format that a block number is added
A format enclosed with STX and ETX
A format that CR and LF are added at the end
This can be used only for 4C frame.
Set the format in the Communication protocol setting of an Engineering tool.
Reference
MELSEC Communication
Protocol Reference Manual
Communication using binary code shortens the communication time since the amount of communication data is about a half of the one in data communications using ASCII code.
1
1 DATA COMMUNICATION USING MC PROTOCOL
1.2 Data Communication
27
Frames
The following explains the types of frame (data communication message) used for a target device to access a supported equipment using the MC protocol, and the purpose of each frame.
The data communication frames are as shown below.
Frame
4C frame
3C frame
2C frame
1C frame
Feature and purpose
Accessing from a target device to the maximum access range is available.
The message format of access route is more simple than
4C frame.
Data communication software for MELSEC-QnA series programmable controller can be used.
1C frame is the same message structure as when accessing using MELSEC-A series computer link modules.
Data communication software for MELSEC-A series programmable controller can be used.
Compatible message format
Dedicated protocol for C24 (QnA extension frame)
Dedicated protocols for C24 (QnA frame)
Dedicated protocols for C24 (QnA simplified frame)
Dedicated protocols for A series Computer link modules.
Format
Formats 1 to 5
Formats 1 to 4
Parameter settings for MC protocol communication
Set the transmission setting and the communication protocol, etc. for a target device.
Select from "MC protocol (Format 1)" to "MC protocol (Format 5)" for "Communication protocol setting".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
Configure other settings according to the system being used.
For details of the settings, refer to the following chapter.
Applicability of multiple CPU systems
When a target device accesses to RCPU, which is a multiple CPU system, accessing to the control CPU or Non-control CPU of the multiple CPU system is available by specifying the target RCPU in "Request destination module I/O number" of MC protocol 4C frame.
E
N
Q
28
1 DATA COMMUNICATION USING MC PROTOCOL
1.2 Data Communication
Applicability of remote password function
The remote password function prevents unauthorized access to a CPU module from a remote location.
By setting a remote password to the CPU module, this function can be applicable.
For the method for setting remote password, refer to the following manual.
GX Works3 Operating Manual
Using MX Component
MX Component is an ActiveX control library that supports various types of communication paths between a personal computer and CPU module.
By using MX Component, an arbitrary system can be configured. Furthermore, the communication program for the target device can be created without considering the content of MC protocol (transmission/reception procedures).
For details, refer to the following manuals.
MX Component Version 4 Operating Manual
MX Component Version 4 Programming Manual
1
1 DATA COMMUNICATION USING MC PROTOCOL
1.2 Data Communication
29
2
DATA COMMUNICATION USING PREDEFINED
PROTOCOL
Data can be transmitted and received between the CPU module and an target device with a protocol appropriate to the target device (such as a measuring instrument and a barcode reader).
Since devices or buffer memory data can be taken into communication packets, this protocol communication is suitable for data that may change every transmission.
The protocol setting required to communicate with the target device is configured in Engineering tool.
Protocols can be selected from the predefined protocol library offered or can be arbitrarily created and edited.
In addition, since the registered setting data is written to the CPU built-in memory, SD memory card, or flash ROM, the program size in the CPU module can be reduced.
For an example of data communication using the predefined protocol, refer to the following manual.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
Data communication using the predefined protocol
Ò
Setting protocols
The setting can be easily configured with the Predefined protocol support function of Engineering tool.
Ó
Writing protocols
The set protocols are written to the C24.
CR
Send
Data ENQ
STX
Ô
Executing protocols
Protocols can be executed with a dedicated instruction.
One dedicated instruction can execute multiple protocols.
Data
Receive
CR
Data communications using protocols corresponding to the target device are available.
The number of protocols and packets that can be registered are as follows:
• Protocols: Up to 128
• Packets: Up to 256
Depending on the packet to be registered, the maximum numbers of packets above may not be registered.
The usage rate of the packet data area differs depending on the types of protocol.
It can be confirmed on the status bar of the "Protocol Setting" screen displayed by following the procedure as follows:
• Select [Tool] [Predefined Protocol Support Function] of Engineering tool, and set "Module Type" and
"Connection Destination CPU" on the "Predefined Protocol Support Function" window. And, add the protocol on the "Predefined Protocol Support Function" screen.
30
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1
Data Communication Procedure
By using the Predefined protocol support function, data can be communicated with a target device in the following procedure.
Operating procedure
1.
Select a protocol in "Predefined Protocol Support Function", and write the protocol setting data.
Page 32 Creating protocol setting data
2.
Set the module parameter to "Predefined protocol".
3.
Execute the protocol written with the dedicated instruction (CPRTCL).
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
4.
Monitor the executed protocol in the Protocol execution log.
The transmitted/received data and the communication control signal status can also be checked using the Circuit trace function.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
2
Communication using the modem function is not available for the predefined protocol.
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1 Data Communication Procedure
31
Creating protocol setting data
Create a protocol setting data using the Predefined protocol support function.
■
Selecting target module of a protocol setting data
Select a target module of the protocol setting data.
Engineering tool [Tool] [Predefined Protocol Support Function]
■
Creating new protocol setting data
Create new protocol setting data.
[File] [New]
Item
Protocol No.
Manufacturer
Model
Protocol Name
Communication Type
Send/ Receive
Packet Name
Packet Setting
Description
Displays the protocol number to be used for a predefined protocol dedicated instruction in programs.
Displays the manufacture's name of a device to which a protocol to be set is applied.
Displays the model name of a device to which a protocol to be set is applied.
Displays the name of a protocol to be set.
Displays the communication type in a protocol to be set.
• Send Only: Send one send packet once.
• Receive Only: Receive a packet if it matches any of up-to-16 registered receive packets.
• Send&Receive: Send one send packet, and receives a packet if it matches any of up-to-16 registered receive packets.
Displays the packet direction.
• : For 'Send'
• (1) to (16): For 'Receive', a receive packet number is displayed in ().
Displays the packet name.
Displays the existence or non-existence of variables in an element, and set or unset of the variables.
With 'Variable Unset', 'Element Unset', or 'Element error', the settings cannot be written to a CPU module or C24.
• No Variable: There is no variable in the element.
• Variable Set: All variables are set.
• Variable Unset: There are one or more unset variables.
• Element Unset: There is no element in the editable protocol.
• Element error: The element does not meet requirement.
32
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1 Data Communication Procedure
■
Adding protocols
Add a protocol.
[Edit] [Add Protocol]
Item
Type
Description
Select a protocol type to be added.
Protocol No.
Model
Protocol Name
Set the number of the protocol to be added.
Set a manufacturer's name of the protocol to be added.
Set a model of the protocol to be added.
Set a name of the protocol to be added.
*1 These items can be set only when "Predefined Protocol Library" is selected in "Type".
Setting range
• Predefined Protocol Library
• User Protocol Library
• Add New
1 to 128
2
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1 Data Communication Procedure
33
■
Configuring detailed setting of protocols
Set the transmission/reception parameters of the protocol.
Select a row of any protocol on the "Protocol Setting" screen [Edit] [Protocol Detailed Setting].
Item
Connected Device
Information
Protocol Setting
Information
Receive Setting
Send Setting
Description
Manufacturer
Type
Model
Version
Explanation
Protocol No.
Set a manufacturer's name of the connected device.
Set a device type of the connected device.
Set a model of the connected device.
Set a device version of the connected device.
Set equipment description for the connected device.
Displays a protocol number of the selected protocol.
Protocol Name Set a protocol name of the protocol.
Communication Type Select a communication type of the protocol.
Clear OS area
(receive data area) before protocol execution
Receive Wait Time
Select whether to clear the OS area (receive data area) of the module before the protocol execution.
If 'Disable' is selected, the data received in the module before the protocol execution also become a receive target of the protocol.
Set waiting time after the module turns to the 'waiting for reception' status.
If the communication with target devices is not available due to such as a cable disconnection and no matched packet can be received within the set time, the module determines an error and cancels the 'waiting for reception' status.
Number of Send
Retries
Send Retry Interval
Standby Time
Monitoring Time
Set the number of times the module retries to send when the sending from the module has not been completed within the set time of "Monitoring Time".
The module determines an error if the sending has not been completed despite the specified number of times of sending retries.
Set the interval between the failure of sending from the module and the retry when the sending from the module has not been completed within the set time of "Monitoring Time".
Set standby time between when a protocol set to the module turns to the execution status and when it actually sends the data. By setting this item, the send timing of the module can be adjusted to readiness of target devices to receive data.
Set waiting time between when the module turns to the 'sending' status and when the sending is completed.
If the communication with target devices is not available due to such as a cable disconnection and the sending cannot be completed within the set time, the module determines an error and cancels the 'sending' status.
*1 For a protocol selected from the predefined protocol library, "Connected Device Information" and "Protocol Setting Information" cannot be modified.
34
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1 Data Communication Procedure
● Processing when the data transmitted error occurred (when the number of send retries is set to '2')
When the set value of "Number of Retries" is 2, the module determines an error at the following timing if it cannot send the data.
CPRTCL instruction execution
Standby time
Monitoring time
Retry interval
The module
Monitoring time
Retry interval
Monitoring time
CPRTCL instruction abnormal completion
Monitoring timeout
Data transmission First retry
Monitoring timeout
Second retry
Monitoring timeout
2
The communication parameters can be set for multiple protocols by clicking the [Communication Parameter
Batch Setting] button and setting "Setting Protocol No. Range", "Receive Setting", or "Send Setting".
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1 Data Communication Procedure
35
■
Setting packets
Set the packet elements to be transmitted/received on the "Packet Setting" screen.
"Protocol setting" screen desired packet setting
The screen above is an example when "Predefined Protocol Library" is selected on the "Add protocol" screen.
When "Add New" or "User Protocol Library" is selected, press the [Change Type] button or [Add New] button to configure the packet.
For details of packet elements, refer to the following section.
36
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1 Data Communication Procedure
■
Writing protocol setting data
Write data of the protocol settings to a CPU module or C24.
[Online] [Write to Module]
Write the protocol setting data after selecting the module to be written and memory.
When writing data to the CPU module, the protocol setting data is written to "Module Extended Parameter".
The following data is not displayed even when reading from CPU module because it will not be written as a protocol setting data. However, the protocol selected from the predefined library is displayed.
• Manufacturer
• Packet name
• Type, Version, Explanation in the protocol detailed setting
• Element name in the packet setting
The operation when the predefined protocol setting is written to a multiple target memory is as follows:
● When the predefined protocol setting is written to both CPU built-in memory and an SD memory card
The CPU module operates according to the settings of "Memory Card Parameter". For details on the "Memory Card
Parameter", refer to the following manual.
MELSEC iQ-R CPU Module User's Manual (Application)
● When the predefined protocol setting is written to a CPU built-in memory or an SD memory card, and C24
The predefined protocol settings of the CPU built-in memory or SD memory card is enabled in the following timing. (If the predefined protocol settings are written both CPU built-in memory and SD memory card, the CPU module operates according to the settings of "Memory Card Parameter".
When the predefined protocol is enabled, the predefined protocol settings of C24 will be overwritten with the predefined protocol of CPU built -in memory or SD memory card.
• When the power is turned OFF ON
• When the CPU module is reset
• When the CPU module is switched STOP RUN
Setting method
Set the predefined protocol settings in "Various control specification" of "Basic Settings". (
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
1.
Set the "Communication protocol setting" in "Various control specification" to "Predefined protocol".
2.
Set the required parameters other than above.
Dedicated instruction to be used
Use the CPRTCL instruction.
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.1 Data Communication Procedure
37
2
2.2
Communication Type of Protocols
A send packet to the target devices and a receive packet from the target devices at the time of process execution are registered in a protocol.
The packet elements which are set to the Predefined protocol support function is applied to the actual data portion of the packet to be transmitted.
For details of packet elements, refer to the following section.
Ex.
Example of a packet configuration
Data area
Header Station No.
Command
Number of byte to be read
Read data
Maximum data length: 2048 bytes
Check code Terminator
With the Predefined protocol support function, communications with target devices are performed using the following procedures (communication types).
Communication type name
Send Only
Processing
Receive Only
Send & Receive
Sends a send packet once.
One send packet is required.
Receives a packet if it matches any of up to 16 defined receive packets.
One or more receive packets are required.
Sends a send packet, and then receives a packet if it matches any of up to 16 defined receive packets.
One send packet and one or more receive packets are required.
For the operation of each operation type, refer to the following section.
Page 581 Operation Image and Data Structure of Predefined Protocol
38
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.2 Communication Type of Protocols
2.3
Packet
A packet consists of packet elements.
Up to 32 elements can be set in a packet, and the maximum data length is 2048 bytes per packet.
Packet elements
The following explains the details of the packet elements.
For data examples on packet elements, refer to the following section.
Page 587 Data examples of packet elements
Header
Use this element when a specific code or character string exists at the head of a packet.
• When sending: Sends a specified code and character string.
• When receiving: Verifies a header and received data.
Item
Element Name
Code Type
Setting Value
Description
Set a name of the element.
Select a data type of the setting value.
ASCII String/ASCII Control Code/HEX
Set data within 1 to 50 bytes.
The setting ranges that can be set for each code type are as follows:
• ASCII String: 20H to 7EH
• ASCII Control Code: 00H to 1FH, and control code of 7FH
• HEX: hexadecimal data of 00H to FFH
• Only one header can be used in a packet.
• A header can be set only at the head of a packet.
Remarks
Setting example
• ASCII String: 'ABC'
• ASCII Control Code: STX
• HEX : FFFF
2
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
39
Static Data
Use this element when a specific code or character string such as command exists in a packet.
• When sending: Sends a specified code and character string.
• When receiving: Verifies the received data.
Item
Element Name
Code Type
Setting Value
Description
Set a name of the element.
Select a data type of the setting value.
ASCII String/ASCII Control Code/HEX
Set data within 1 to 50 bytes.
The setting ranges that can be set for each code type are as follows:
• ASCII String: 20H to 7EH
• ASCII Control Code: 00H to 1FH, and control code of 7FH
• HEX: hexadecimal data of 00H to FFH
Multiple static data elements can be placed to desired positions in the data portion.
Terminator
Use this element when a code or character string indicating the end of the packet is included.
Remarks
Setting example
• ASCII String: 'ABC'
• ASCII Control Code: US
• HEX : FFFF
Item
Element Name
Code Type
Setting Value
Description
Set a name of the element.
Select a data type of the setting value.
ASCII String/ASCII Control Code/HEX
Set data within 1 to 50 bytes.
The setting ranges that can be set for each code type are as follows:
• ASCII String: 20H to 7EH
• ASCII Control Code: 00H to 1FH, and control code of 7FH
• HEX: hexadecimal data of 00H to FFH
• Only one terminator can be used in a packet.
• Only a check code and static data can be placed after a terminator.
Remarks
Setting example
• ASCII String: 'ABC'
• ASCII Control Code: ETX
• HEX : FFFF
40
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
Length
Use this element when an element indicating the data length is included in a packet.
• When sending: Calculates the data length of a specified range, and adds the result to a send packet.
• When receiving: Verifies the data (value) corresponds to the length in the received data as the data length of a specified range.
2
Item
Element Name
Code Type
Data Length
Data Flow
Calculating
Range
Start
End
Description
Set a name of the element.
Select a format of the data length.
ASCII Hexadecimal/ASCII Decimal/HEX
Select the data length on the line.
The range is 1 to 4.
Forward Direction
(Upper Byte → Lower Byte)
• When sending: Sends a calculated length from the upper byte.
• When receiving: Receives data from the upper byte.
Reverse Direction
(Lower Byte → Upper Byte)
Byte Swap
(by Word)
• When sending: Sends a calculated length from the lower byte.
• When receiving: Receives data from the lower byte.
• When sending: Sends a calculated length swapping the upper byte and lower byte by word.
• When receiving: Receives data swapping the upper byte and lower byte by word.
Select the start packet element number for the calculating range.
The range is 1 to 32.
Select the end packet element number for the calculating range.
The range is 1 to 32.
Remarks
Cannot be set when
"Data Length" is 1 byte.
• Only one length can be used in a packet.
• When there is no element other than a length, an element error occurs.
• When the number of digits of calculation result is greater than that specified in "Data Length", digits greater than the specified digit are omitted (ignored).
Example) When "2 bytes" is specified in "Data Length" and the calculation result is "123 bytes", the data length is considered as "23".
• When any of a Non-conversion variable (Variable length), Conversion variable (Variable number of data),
Conversion variable (Fixed number of data/Variable number of digits
*1
), and Non-verified reception
(Variable number of characters) is placed behind a Length and they are not included in the calculating range of the Length, place any of the following data immediate after the Non-conversion variable (Variable length),
Conversion variable (Variable length) or Non-verified reception.
Static Data
Terminator
Check code + Static Data
Check code + Terminator
• When "Code Type" is "ASCII Hexadecimal", a corresponding packet is regarded as a mismatch packet if a string except for '0' to '9', 'A' to 'F', and 'a' to 'f' is received.
• When "Code Type" is "ASCII Decimal", a corresponding packet is regarded as a mismatch packet if a string except for '0' to '9' is received.
*1 Excluding a case where "Number of Send Data" is '1' and "Delimiter" is not 'No delimiter'.
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
41
Non-conversion Variable
Use this element to send the data in the device memory of a CPU module or buffer memory as a part of a send packet, or store a part of a receive packet to the device memory of a CPU module or buffer memory.
Item
Element Name
Fixed Length/Variable
Length
Data Length/
Maximum Data Length
Unit of Stored Data
Byte Swap
Data Storage Area
Specification
Description
Set a name of the element.
Fixed Length Sends and receives the data whose length is fixed.
Variable Length • When sending: Specifies the data length at the time of the protocol execution and sends data.
• When receiving: Receives data whose data length is variable.
Set the length of data to be transmitted and received.
(For the variable length data, set the maximum data length that can be specified to the data length storage area.)
The range is 1 to 2048.
Lower Byte + Upper Byte • When sending: Sends each one word (2 bytes) data in the data storage area in the order of the lower byte to the upper byte.
• When receiving: Stores the received data to the data storage area in the order of the lower byte to the upper byte.
Lower Bytes Only • When sending: Sends only lower byte of data in the data storage area. C24 ignores data in the upper byte.
• When receiving: Stores the received data in the only lower byte of the data storage area. C24 stores
00H in the upper byte.
Disable (lower -> upper)/
Enable (upper -> lower)
• When sending: When "Enable" is selected, sends data swapping the upper byte and lower byte by word (2 bytes).
When "Unit of Stored Data" is "Lower Byte + Upper Byte" and "Data Length" is an odd number of bytes, sends the upper byte at transmission of the last byte.
When "Unit of Stored Data" is "Lower Bytes Only" and "Data Length" is an odd number of bytes, sends data without any byte swap at transmission of the last byte.
• When receiving: When 'Enable' is selected, receives data swapping the upper byte and lower byte by word (2 bytes).
When "Unit of Stored Data" is "Lower Byte + Upper Byte" and "Data Length" is an odd number of bytes, stores the last byte to the upper byte.
When "Unit of Stored Data" is "Lower Bytes Only" and "Data Length" is an odd number of bytes, stores the last byte without any byte swap.
Specify a start device to store variable value.
■ Settable devices
• Input (X)
• Output (Y)
• Internal relay (M)
• Latch relay (L)
• Link relay (B)
• Data register (D)
• Link register (W)
File register
• File register (R,ZR)
Buffer memory
• G device (G)
*1 Do not set local devices.
*2 Set within the device range specified in the following screen.
Project window [Parameter] CPU module type [CPU Parameter] [Memory/Device Setting]
42
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
The following explains the configuration of the data storage area.
■
When "Fixed Length/Variable Length" is "Fixed Length"
An area starting from the device number which is specified on the "Element Setting" screen is considered as the data storage area.
The data storage area to be occupied varies depending on the setting of "Unit of Stored Data".
• When "Lower Byte + Upper Byte" is selected, the same size as the data length is occupied.
(However, when the data length of a send packet is an odd number, the upper byte (lower byte for "Byte Swap") of the last device is not sent. When the data length of a receive packet is an odd number, the last data is stored with one byte of 00H added.)
• When "Lower Bytes Only" is selected, twice the size of the data length is occupied.
Specified device
(Word)
+0
2
Data storage area
Send packet: Users store the transmitted data
Receive packet: C24 stores the received data
+n
■
When "Fixed Length/Variable Length" is "Variable Length"
An area starting from the device number which is specified on the "Element Setting" screen +1 is considered as the data storage area.
The data storage area to be occupied varies depending on the setting of "Unit of Stored Data".
• When "Lower Byte + Upper Byte" is selected, the same size as the data length + one word (length for the data length storage area) are occupied.
(However, when the data length of a send packet is an odd number, the upper byte (lower byte for "Byte Swap") of the last device is not transmitted. When the data length of a receive packet is an odd number, one byte of 00H is added to the last data and stored.)
• When "Lower Bytes Only" is selected, twice size of the data length + one word (length for the data length storage area) are occupied.
(Word)
+0
Specified device
Data length storage area *1
Send packet: Users store the send data length (data length on the line)
Receive packet: The C24 stores the receive data length (data length on the line)
+1
Data storage area
Send packet: Users store the send data
Receive packet: The C24 stores the receive data
+n
*1 The unit of data length is byte.
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
43
Precautions
● When receiving variable length data whose length exceeds the "Maximum data length", C24 stores data as long as the maximum data length and omits the rest. (A protocol completes successfully.)
● Out of packet data received from target devices, the data corresponding to variable needs to be discriminated from a terminator or a static data immediately after non-conversion variable. The reception processing may not be performed normally if they cannot discriminated.
Ex.
When value of a terminator or value of a static data following a non-conversion variable is used in a non-conversion variable,
C24 recognizes it as data of a terminator or a static data following a non-conversion variable and performs the verification/ reception processing.
● Multiple Non-conversion variable (Fixed length) elements can be placed in a packet, and multiple Non-conversion variable
(Variable length) elements can also be placed in a send packet. However, only one Non-conversion variable (Variable length) can be placed in a receive packet, and any of the following requirements need to be met.
• Place any of the following items immediate after the non-conversion variable.
Static Data
Terminator
Check code + Static Data
Check code + Terminator
• Place a Length before a Non-conversion variable and include the Non-conversion variable in the calculating range.
In addition, two or more of the following four elements cannot be placed in the same packet.
• Variable number of data [Conversion variable]
• Fixed number of data and variable number of digits [Conversion variable] (Excluding a case where "Number of Send Data" is '1' and "Delimiter" is not 'No delimiter'.)
• Variable length [Non-conversion variable]
• Variable number of characters [Non-verified reception]
44
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
Conversion Variable
This element converts the numerical data in the device memory of a CPU module or buffer memory to an ASCII string and sends it, or converts the received data (ASCII string) to the numerical data and stores it to the device memory of a CPU module or buffer memory.
2
Item
Element Name
Conversion
Fixed Number of Data/
Variable Number of
Data
Number of Send Data/
Maximum Number of
Data
Number of Send Digits of Data
Blank-padded
Character at Send
Conversion Unit
Sign
Sign Character
Number of Decimals
Description
Set a name of the element.
When sending
HEX ASCII Decimal
HEX ASCII
Hexadecimal
When receiving
ASCII Decimal HEX
ASCII Hexadecimal
HEX
Converts numeric value stored in the data storage area to ASCII decimal.
Converts numeric value stored in the data storage area to ASCII hexadecimal.
Treats received data as ASCII decimal, converts it to numeric value, and stores it to the data storage area.
Treats received data as ASCII hexadecimal, converts it to numeric value, and stores it to the data storage area.
Fixed Number of Data
Variable Number of Data
Fixes the number of data to be sent and received.
• When sending: Specifies the number of data to be sent at the time of the protocol execution and sends the data.
• When receiving: Receives data of which the number is variable.
For Variable number of digits, delimiters are required.
Set the number of data to be transmitted and received. (For "Variable Number of Data", set the maximum number of data that can be specified to the data quantity storage area.)
The range is 1 to 256.
1 to 10 Set the number of digits per one transmitted and received data.
When the number of send digits of data is less than the specified number of digits of data, upper digits are filled with blank-padded characters.
Variable Number of Digits
0/Space
• When sending: Sends only the data portion converted to an ASCII string in variable length.
• When receiving: Receives only an ASCII string of the data portion in variable length. When the number of send data/maximum data length is set to 2 or greater, blank-padded characters are required.
Select a character used to fill upper digits when the number of digits of data is not "Variable
Number of Digits" and the number of digits of transmitted/received data is less than the specified number of send digits of data.
Select how many words are manipulated as one data in the data storage area.
For 'Word', converts data manipulating one word as one data.
For 'Double word', converts data manipulating two words as one data.
Unsigned/Signed Select whether to add signs to date in the data storage area.
This item can be set when "Conversion" is "HEX ASCII Decimal" or "ASCII Decimal
HEX".
None/+/0/Space
No Decimal Point/Variable Point/1 to
9
Select the sign character for positive value on line.
This item can be set when "Conversion" is "HEX ASCII Decimal" or "ASCII Decimal
HEX", and "Sign" is "Signed".
The sign character for negative value is fixed to "-".
Select the decimal point position of data on line.
This item can be set when "Conversion" is "HEX ASCII Decimal" or "ASCII Decimal
HEX".
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
45
Item Description
Delimiter No Delimiter/Comma/Space Select the delimiter inserted after one data.
A delimiter is not added to the end of data when the number of data is 2 or more.
Specify a start device to store variable value.
Data Storage Area
Specification
The following explains the configuration of the data storage area.
■
When "Fixed Number of Data/Variable Number of Data" is "Fixed Number of Data"
An area starting from the device number which is specified on the "Element Setting" screen is considered as the data storage area.
Specified device
(Word)
+0
Data storage area
Send packet: Users store the transmitted data
Receive packet: C24 stores the received data
+n
■
When "Fixed Number of Data/Variable Number of Data" is "Variable Number of Data"
An area starting from the device number which is specified on the "Element Setting" screen +1 is considered as the data storage area.
(Word)
+0
Specified device
Data quantity storage area
Send packet: Users store the transmission data count
Receive packet: C24 stores the data count
+1
Data storage area
Send packet: Users store the transmitted data
Receive packet: C24 stores the received data
+n
■
Occupied size in data storage area
The size occupied in the data storage area varies depending on the settings of "Conversion Unit" and "Number of Decimals".
Occupied size in data storage area per one data Setting item
Conversion Unit
Word
Double Word
Number of Decimals
No Decimal point/Fixed point
Variable point
No Decimal point/Fixed point
Variable point
1 word
2 words
2 words
4 words
46
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
■
Data storage area configuration per one data
The following shows the data storage area configuration per one data.
● "Conversion Unit": Word, "Number of Decimals": No decimal Point/Fixed point
Data storage area
0H Numeric data
● "Conversion Unit": Word, "Number of Decimals": Variable point
For 'Variable Point', the decimal point position is set in the data storage area.
Data storage area
0H Numeric data
1H Decimal point position
In the decimal point position area, the decimal point position is set as follows.
Send/receive data (number of digits of data is 5)
12345
1234.5
123.45
12.345
1.2345
Numeric data
12345 (3039H)
12345 (3039H)
12345 (3039H)
12345 (3039H)
12345 (3039H)
Decimal point position
1 (1H)
10 (0AH)
100 (64H)
1000 (3E8H)
10000 (2710H)
● "Conversion Unit": Double word, "Number of Decimals": No Decimal Point/Fixed point
Data storage area
0H
1H
Numeric data
(L)
(H)
● "Conversion Unit": Double word, "Number of Decimals": Variable Point
For 'Variable Point', the decimal point position is set in the data storage area.
Data storage area
0H
1H
2H
3H
Numeric data
(L)
(H)
Decimal point position
(L)
(H)
In the decimal point position area, the decimal point position is set as follows.
Send/receive data (number of digits of data is 10)
1234567890
123456789.0
12345678.90
:
1234567.890
1.234567890
Numeric data
1234567890 (499602D2H)
1234567890 (499602D2H)
1234567890 (499602D2H)
:
1234567890 (499602D2H)
1234567890 (499602D2H)
Decimal point position
1 (1H)
10 (0AH)
100 (64H)
:
1000 (3E8H)
1000000000 (3B9ACA00H)
■
Range of value that can be used in the data storage area
The following table shows the range of value that can be used in the data storage area.
Conversion
HEX ASCII decimal
ASCII decimal HEX
HEX ASCII hexadecimal
ASCII hexadecimal
HEX
Sign
Unsigned
Signed
Conversion unit
Word
Double word
Word
Double word
Word
Double word
Range of value
0 to 65535 (0H to FFFFH)
0 to 4294967295 (0H to FFFFFFFFH)
-32768 to 32767 (8000H to FFFFH, 0H to 7FFFH)
-2147483648 to 2147483647 (80000000H to FFFFFFFFH, 0H to 7FFFFFFFH)
0H to FFFFH
0H to FFFFFFFFH
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
47
2
■
Considerations for configuring packet element
To place a Conversion variable in a packet, the following requirements need to be met.
• To place Conversion variable in send packet
Multiple Conversion variable elements can be placed in one packet, and they can be placed in desired positions in the data portion.
• To place Conversion variable in receive packet
Multiple Conversion variable elements can be placed in one packet in the cases other than "Variable number of data" and
(3) of "Fixed number of data".
Variable number of data
( Only one Conversion variable can be placed in one packet, and either of the following (1) or (2) need to be met. )
Fixed number of data
Variable number of digits
Fixed number of digits (1 to
10)
(1)
(2)
(3)
(4)
(5)
(6)
■ For discriminating the data length of a Conversion variable, any of the following items is placed immediate after the
Conversion variable.
• Static data
• Terminator
• Check code + Static data
• Check code + Terminator
■ A "Length" is placed before a Conversion variable. (The Conversion variable needs to be included in the calculating range.)
■ When the number of data is 2 or more, or the number of data is 1 with no delimiter, only one Conversion variable can be placed in a packet and it needs to be placed in the order mentioned in [Variable number of data].
■ When a Conversion variable (the number of data is 1, with delimiter, and variable number of digits) and the following four elements are placed in the same packet, these four elements need to be placed behind the Conversion variable
(the number of data is 1, with delimiter, and variable number of digits).
• "Conversion Variable" (variable number of data)
• Conversion variable (fixed number of data and variable number of digits) (The case of (3). Excluding a case where
"Number of Send Data" is '1' and "Delimiter" is not "No Delimiter".)
• Non-conversion variable (variable length)
• Non-verified reception (variable number of characters)
Note that two or more of these four elements cannot be placed in the same packet.
■ When a Conversion variable (variable decimal point) and the four elements mentioned in (4) are placed in the same packet, these elements need to be placed behind the Conversion variable (variable decimal point).
■ When a Conversion variable (unsigned) and the four elements mentioned in (4) are placed in the same packet, these elements need to be placed behind the Conversion variable (unsigned).
Precautions
An error may occur on C24 in any of the following cases.
• A string other than '0'-'9', 'A'-'F', or 'a'-'f' is received
When "Conversion" is "ASCII Hexadecimal HEX", an ASCII BIN conversion error (7F20H) may occur if a string other than '0'-'9', 'A'-'F', or 'a'-'f' is received.
• A string other than '0'-'9' is received
When "Conversion" is "ASCII Decimal HEX", an ASCII BIN conversion error (7F20H) may occur if a string other than
'0'-'9' is received. However, the error does not occur in the following cases.
Item
Sign/Sign Character
Number of Decimals
Delimiter
C24 operation
When "Signed" is selected, a signed character can be received.
However, when a signed character which is not at the head of data is received, an ASCII BIN conversion error
(7F20H) may occur.
When any other than "No decimal point" is selected, '. ' (a period) can be received.
However an ASCII BIN conversion error (7F20H) may occur when '. ' (a period) which is not at the specified number of digits of data is received.
An ASCII BIN conversion error (7F20H) may also occur when "Variable point" is selected and '. ' (a period) which is at the head or end of a unit of data is received.
When any other than "No delimiter" is selected, a delimiter can be received.
However an ASCII BIN conversion error (7F20H) may occur when a delimiter which is not at a boundary of data is received.
48
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
• A data of which number of digits exceeds the upper limit is received
When "Number of Send Digits of Data" is "Variable Number of Digits", an abnormal digit number error (7D19H) may occur if the number of digits of received data exceeds the upper limit shown below.
Conversion unit
Word
Double word
Conversion
ASCII Decimal HEX
ASCII Hexadecimal HEX
ASCII Decimal HEX
ASCII Hexadecimal HEX
Upper limit of number data to be received
5 digits
4 digits
10 digits
8 digits
• A data whose decimal point position is greater than the number of digits is specified
When "Number of Decimals" is 'Variable Point' in a send packet, a decimal point place specification error (7D21H) may occur if the decimal point position is greater than the number of digits.
• A data whose number of digits is '0' is received
When "Number of Send Digits of Data" is "Variable Number of Digits", an abnormal digit number error (7D19H) may occur if the number of digits of received data is '0'.
• A data whose number of digits are fewer than the digits specified in "Number of Send Digits of Data" are received
An insufficient digit number error (7D18H) may occur if data whose number of digits are fewer than the digits specified in
"Number of Send Digits of Data" are received.
Example) When "Number of Send Digits of Data" is set to 4 digits
Conversion variable Terminator
2
Receive data "1" "2" "3" ETX
An error occurs when 'Conversion
Variable' of the received data ends up with three digits while the setting of
"Number of Digits of Data" is four digits.
• A data whose number exceeds "Maximum number of data" is received
When receiving data of which the number exceeds the "Maximum number of data", C24 stores data as many as the maximum number of data and omits the rest. (A protocol completes successfully.)
• A data that cannot be distinguished between Terminator or a Static data
In received packet data from target devices, C24 needs to be able to discriminate data corresponding to a Conversion variable from those of a Terminator or a Static data following a Conversion variable.
The reception processing may not be performed normally if they cannot be distinguished.
Example) When the value of Terminator or a Static data following the Conversion variable is used as a Conversion variable,
C24 recognized it as a fixed data following the Conversion variable, verify, and perform reception processing.
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
49
Check Code
Use this element when an element indicating check code data is included in a packet.
C24 automatically calculates a specified check code at timing of sending/receiving, and adds it to a send packet or detects an error of a receive packet.
Item
Element Name
Processing Method
Code Type
Data Length
Data Flow
Complement Calculation
Calculating
Range
Start
End
Description
Set a name of the element.
Select a calculating method.
Horizontal parity/Sum check/16-bit CRC (for MODBUS)
ASCII Hexadecimal
ASCII Decimal
HEX
• When sending: Select a format in which a calculated check code is sent.
• When receiving: Select a format in which data are received.
Select the data length on the line (byte).
The range is 1 to 4.
Remarks
Not settable when "Processing
Method" is "16-bit CRC (for
MODBUS)"
Forward Direction
(Upper byte Lower byte)
• When sending: Sends a calculated check code, from the upper byte.
• When receiving: Handles received data as a check code, from the upper byte.
Reverse Direction
(Lower byte
Byte Swap
(by word)
Upper byte)
• When sending: Sends a calculated check code, from the upper byte.
• When receiving: Receives data from the lower byte.
Effective when the data length is 2 to 4 (bytes).
• When sending: Sends a calculated check code by swapping the upper byte and lower byte by word. When receiving: Receives data by swapping the upper byte and lower byte by word, and handles as a check code.
Effective when the data length is 4 bytes.
Select the complement calculation.
No complement calculation/One's complement/Two's complement
Not settable when "Processing
Method" is "16-bit CRC (for
MODBUS)"
Not settable when "Processing
Method" is "16-bit CRC (for
MODBUS)", or when the "Data
Length" is set to "1 (byte)".
Not settable when "Processing
Method" is "16-bit CRC (for
MODBUS)"
Select the start packet element number for the calculating range.
The range is 1 to 32.
Select the end packet element number for the calculating range.
The range is 1 to 32.
Precautions
• When "Code Type" is "ASCII Hexadecimal", an ASCII BIN conversion error (7F20H) may occur if a string except for '0' to
'9' 'A' to 'F' 'a' to 'f' is received.
• When "Code Type" is "ASCII Decimal", an ASCII BIN conversion error (7F20H) may occur if a string except for '0' to '9' is received.
• Only one check code can be placed in a packet.
• Packet elements placed behind a check code cannot be included in the calculating range.
• A check code cannot be included in the calculated range.
• When a calculated check code (Sum check/Horizontal parity/16-bit CRC) does not match a received check code, a sum check error (7F24H) may occur.
• One or more elements are required before a check code.
50
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
Non-verified reception
Use this element when received data includes unnecessary data while receiving data.
C24 skips characters as many as the specified number if a receive packet includes a non-verified reception.
Item
Element Name
Data Length
Description
Set a name of the element.
0 (variable number of characters)
1 to 2048 (specified number of characters)
Set this item when the number of characters not to be verified varies in each of communication.
Set the number of characters not to be verified.
Precautions
• When "Data Length" is '0', the following requirements need to be met.
■ Only one Non-verified reception can be placed in a packet.
■ Include a Non-verified reception in the calculating range of a Length. Otherwise, place any of the following data immediate after a Non-verified reception.
• Static Data
• Terminator
• Check code + Static Data
• Check code + Terminator
■ Two or more of the following four elements cannot be placed in the same packet.
• "Conversion Variable" (variable number of data)
• Conversion variable (Fixed number of data and Variable number of digits) (Excluding a case when the number of data is '1' with delimiter.)
• Non-conversion variable (Variable length)
• Non-verified reception (Variable number of characters)
• In received packet data from target devices, C24 needs to be able to discriminate data corresponding to a Non-verified reception from those of a Terminator or a Static Data following a Non-verified reception. The receive processing may not be performed normally if they cannot be distinguished.
Ex.) When value of a Terminator or value of a Static Data following a Non-verified reception is used in a Non-verified reception, C24 recognizes it as data of a Terminator or a Static Data following a Non-verified reception and performs the verify/receive process.
2
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
51
2.4
Execution Condition of Predefined Protocol
Communication
The predefined protocol communication can be performed when the 'predefined protocol ready' (X1D) is ON.
When executing the predefined protocol communication in the program, use the 'predefined protocol ready' (X1D) as an interlock signal.
This signal turns ON only when the communication protocol setting is set to predefined protocol
ON/OFF timing of predefined protocol ready (X1D)
After the protocol setting data is written to a flash ROM, 'predefined protocol ready' (X1D) turns OFF while checking the written data.
When the written data is normal, 'predefined protocol ready' (X1D) turns ON.
STOP/RUN of the CPU module and
Writing protocol setting data to flash ROM
Performed by user
Performed by C24
Predefined protocol ready (X1D)
Power ON
Checks the protocol setting data.
Turns OFF while checking.
Checking time
CH1, 2 ERR. occurred (XE/XF)
OFF
Turns ON if the protocol setting data is normal.
52
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.4 Execution Condition of Predefined Protocol Communication
Execution timing for mode switching request signal (Y2/Y9) or UINI instruction
It is assumed that the protocol setting data written to the flash ROM is normal, or the protocol setting data is not written to the flash ROM.
■
Execution timing for mode switching request signal (Y2/Y9)
Communication protocol before change: CH1 and CH2 are other than the predefined protocol mode.
Communication protocol after change: CH1 or CH2 is the predefined protocol mode.
Mode switching request
(Y2/Y9)
2
Mode switching in progress
(X6/XD)
ON
Predefined protocol ready
(X1D)
OFF
CH1 and CH2 are other than predefined protocol mode
CH1 or CH2 is the predefined protocol mode
Communication protocol before change: CH1 or CH2 is the predefined protocol mode.
Communication protocol after change: CH1 or CH2 is the predefined protocol mode.
Mode switching request
(Y2/Y9)
Mode switching in progress
(X6/XD)
ON ON
Predefined protocol ready
(X1D)
CH1 or CH2 is the predefined protocol mode
CH1 or CH2 is the predefined protocol mode
Communication protocol before change: CH1 or CH2 is the predefined protocol mode.
Communication protocol after change: CH1 and CH2 are other than the predefined protocol mode.
Mode switching request
(Y2/Y9)
Mode switching in progress
(X6/XD)
ON
Predefined protocol ready
(X1D)
CH1 or CH2 is the predefined protocol mode
OFF
CH1 and CH2 are other than predefined protocol mode
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.4 Execution Condition of Predefined Protocol Communication
53
■
Execution timing for UINI instruction
Communication protocol before change: CH1 and CH2 are other than the predefined protocol mode.
Communication protocol after change: CH1 or CH2 is the predefined protocol mode.
Program
END processing
END processing
UINI instruction execution
END processing
END processing
UINI instruction
Completion device
OFF
Status indication device at completion
OFF
ON
ON
Abnormal completion
Normal completion
One scan
ON
Mode switching in progress
(X6/XD)
Predefined protocol ready (X1D)
OFF
OFF
ON
CH1 and CH2 are other than predefined protocol mode
CH1 or CH2 is the predefined protocol mode
C24
Setting processing
Communication disabled
Communication protocol before change: CH1 or CH2 is the predefined protocol mode.
Communication protocol after change: CH1 or CH2 is the predefined protocol mode.
Program
END processing
END processing
UINI instruction execution
END processing
END processing
UINI instruction
Completion device
OFF
Status indication device at completion
OFF
Mode switching in progress
(X6/XD)
Predefined protocol ready (X1D)
OFF
ON
CH1 or CH2 is the predefined protocol mode
ON
C24
Setting processing
Communication disabled
ON
ON Abnormal completion
Normal completion
One scan
ON
CH1 or CH2 is the predefined protocol mode
54
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.4 Execution Condition of Predefined Protocol Communication
Communication protocol before change: CH1 or CH2 is the predefined protocol mode.
Communication protocol after the change: CH1 and CH2 are other than the predefined protocol mode.
Program
END processing
END processing
UINI instruction execution
END processing
END processing
UINI instruction
Completion device
OFF
Status indication device at completion
OFF
Mode switching in progress
(X6/XD)
Predefined protocol ready (X1D)
OFF
ON
CH1 or CH2 is the predefined protocol mode
ON
C24
Setting processing
Communication disabled
ON
ON Abnormal completion
Normal completion
One scan
OFF
CH1 and CH2 are other than predefined protocol mode
2
2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.4 Execution Condition of Predefined Protocol Communication
55
3
DATA COMMUNICATION USING
NONPROCEDURAL PROTOCOL
Nonprocedural protocol enables to transmit and receive data between a CPU module and target device by setting a data format and transmission control procedure arbitrarily.
A program for data communication is required for the CPU module.
Use this protocol for data communication with any given data format.
Send
Arbitrary data
Arbitrary data
Receive
The predefined protocol is recommended for data communication appropriate to the protocol of the target device, such as a measuring instrument or barcode reader.
Communication using the nonprocedural protocol can be replaced with that of the predefined protocol.
The predefined protocol support function of Engineering tool allows the easy replacement.
With the predefined protocol, the required program is only for starting communication according to the specified protocol, and this can reduce the number of steps considerably.
For the communication using the predefined protocol, refer to the following chapter.
Page 30 DATA COMMUNICATION USING PREDEFINED PROTOCOL
Parameter settings of data communication using nonprocedural protocol
Set the transmission setting and the communication protocol, etc. for a target device.
Set the "Nonprocedural protocol" for "Communication protocol setting".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
Configure other settings according to the system being used.
For details of the settings, refer to the following chapter.
56
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1
Receiving Data from Target Device
This section explains data reception from a target device.
Receiving methods
The following shows the methods for receiving data in any format using the nonprocedural protocol.
There are two methods for receiving data: the 'reception by receive end code' for receiving variable length messages, and the
'reception by receive end data quantity' for receiving fixed length messages. If the receive end code and the receive end data quantity are not determined, the 'reception by time out for the no-reception monitoring time (timer 0)' is also available.
The receive end code and receive end data quantity used for data reception can be changed to any setting values by the user using Engineering tool.
C24 turns the 'CH reception data read request' (X3/XA) ON when it receives the receive end code before data equivalent to the receive end data quantity has been received.
Therefore, when receiving data using the receive end code, set a value which is bigger than the maximum number of data sent from the target device in the receive end data quantity designation.
For the changing methods for the receive end code and receive end data quantity, refer to the following section.
Page 77 Receive end data quantity and receive end code settings
Method
Reception by the receive end code
Reception by receive end data quantity
Reception by time out for the no-reception monitoring time
(timer 0)
Application
Receives variable length messages
Receives fixed length messages.
Receives messages the receive end code and the receive end data quantity of which are not determined. For specifying a no-reception monitoring time (timer 0), refer to the following section.
Page 260 No-reception Monitoring Time (timer 0) Setting
CPU module
Ò
Reception data read request
Ó Ô
INPUT instruction
C24
Receive data count
Reception area
(buffer memory)
10
(00
H
) (0A
H
)
A STX
(41
H
) (02
H
)
C B
(43
H
) (42
H
)
Received data
E D
(45
H
) (44
H
)
G F
(47
H
) (46
H
)
ETX H
(03
H
) (48
H
)
Head data Receive complete code
Target device
S
T
X
A B C D E F G H
E
T
X
(02
H
) (41
H
) (42
H
) (43
H
) (44
H
) (45
H
) (46
H
) (47
H
) (48
H
) (03
H
)
Transmitted data
3
CH1/CH2 Control timing Description
Reception data read request
INPUT instruction
INPUT instruction completion device
X3/XA
INPUT
When data is received from the target device using either 'reception by receive end code' or 'reception by receive end data quantity' method, the CH reception data read request' (X3/XA) turns ON.
Control data is stored in the device designated with the INPUT instruction.
When the INPUT instruction is executed, received data is read from the receive data storage area of the buffer memory.
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
57
Data reception by receive end code (for variable length reception)
This method is used to transmit data by adding the receive end code set in C24 at the end of a message transmitted from a target device.
The receive end code can be changed according to the specifications of the target device. Arbitrary 1-character (1-byte) code within the range of 00H to FFH can be designated.
Setting
0D0AH (default)
H
FFFFH
Description
The receive end code is not changed.
Arbitrary code is designated for the receive end code. (00H to FFH)
No receive end code
Remarks
CR, LF is added to the end of the message and sent from the target device.
The designated receive end code data is added to the end of the message and sent from the target device.
Data reception by receive end data quantity is available.
• When C24 receives the receive end code data preset with Engineering tool by the user, it issues a reception data read request to the program.
The read request from C24 allows the program to read the received data up to the receive end code received from the target device.
• C24 issues a reception data read request to the CPU module in the cases below, according to the setting value of the receive end code.
■
When receive end code is not changed (Default value: 0D0AH)
(CR+LF is added to the end of the message and sent from the target device.)
• When LF is received within the time set in the no-reception monitoring time (timer 0) after CR is received, C24 stores the receive data up to CR+LF to the receive data storage area in the buffer memory and turns ON the 'CH reception data read request' (X3/XA) to the CPU module.
Target device
C24
C
R
Timer 0 setting time
L
F
Reception data read request (X3/XA)
• If LF is not received within the time set in the no-reception monitoring time (timer 0) after CR is received, C24 stores the received data up to CR to the receive data storage area on the buffer memory, and turns ON the following signals to the
CPU module.
Nonprocedural and no-reception monitoring time
Method 0 :'CH reception abnormal detection' (X4/XB)
Method 1 :'CH reception data read request' (X3/XA)
*1
Target device
C24
C
R
(*2)
Timer 0 setting time
[Format is 0]
Reception abnormal detection (X4/XB)
58
Reception data read request (X3/XA)
[Format is 1]
*1 It is used when a message of which receive end code and receive end data quantity have not been determined due to the non-reception monitoring time (timer 0) time out in the nonprocedural protocol. (
Page 261 Nonprocedural no-reception monitoring time method designation (Method 0/1))
*2 CR is handled as 1-byte data in the message.
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
■
When the receive end code is changed and an arbitrary code is designated (designate from
0000H to 00FFH)
(User defined receive end code data is added to the end of the message and transmitted from the target device).
When C24 receives the receive end code data changed by the user, it stores the received data up to the receive end code in the receive area on the buffer memory and turns ON the 'CH reception data read request' (X3/XA) to the CPU module.
Receive complete code data
Target device
C24
3
Reception data read request (X3/XA)
■
When the receive end code is not designated (FFFFH designated)
Reading by the receive end data quantity is enabled.
For more information on reading by the receive end data quantity, refer to the following section.
Page 59 Data reception by receive end data quantity (for fixed length reception)
Data reception by receive end data quantity (for fixed length reception)
• This method is used to receive messages of the same length (size) from the target device every time.
• When C24 receives data equivalent to the receive end data quantity preset with Engineering tool by the user, it issues a reception data read request to the program.
Upon the read request by the C24, the program reads the data equivalent to the receive end data quantity from the target device.
• The receive end data quantity default value is set to 511 (words). However, it can be changed within the receive data storage area depending on the data contents exchanged with the target device.
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
59
Receive area and receive data arrangement
The following shows the receive area and the receive data arrangement for performing data reception using the nonprocedural protocol.
Receive area
The receive area is a memory area for storing the data received from the target device, and the receive data quantity to read the received data to the CPU module.
By default, the receive area is assigned to the addresses, Un\G1536 to 2047 (CH1 side) and Un\G2560 to 3071 (CH2 side).
CH1 address Buffer memory
The receive data count units (word/byte) depends on the word/byte units designation with Engineering tool.
Un\G 1536
Un\G 1537
Receive data count
Writes the received data storage count when the CPU module is requested to read the received data.
Received data Stores the arbitrary data portion of the received data.
Un\G 2047
(Default)
The position and size of the receive area in the buffer memory can be changed with Engineering tool in accordance with the specifications of the target device and the receive data length. (
Configure the settings as follows:
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
• Designate the start address for the area to be used as receive area in the user setting area (Un\G1024 to 6911, Un\G9728 to 16383) to "Receiving buffer memory start address designation".
• Designate the length of area to be used as the receive area in the user setting area (Un\G1024 to 6911, Un\G9728 to
16383) by address count (0001H to 1A00H) to "Receiving buffer memory size specification".
When changing the position and size of the receive area in the buffer memory, if any of the functions below are used concurrently, make sure that the addresses of the receive area do not overlap with the buffer memory addresses assigned for storing send/receive data with the functions.
• MC protocol buffer memory read/write function
• MC protocol on-demand function
• Predefined protocol function (Send/receive data storage area)
• Nonprocedural protocol transmission/reception function
• Bidirectional protocol transmission/reception function
• Send/receive data monitoring function
Set the size of data per data transmission from the target device to C24 to be equal to or smaller than the size of the receive data storage area in the buffer memory.
• (Receive data storage area) (Amount of data in any data portion to be transmitted from the target device)
To transmit data whose size is larger than the receive data storage area, increase the receive area, or divide the send data before sending.
The position and size of the receive area can be changed in the buffer memory.
• 'Receiving buffer memory start address designation' (Un\G166/326)
• 'Receive buffer memory length designation' (Un\G167/327)
60
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
Receive data arrangement
The following explains the data arrangement when data received from a target device is stored to the receive area.
• The received message is stored to the C24 buffer memory (Receive data storage area).
• The data is stored to the receive data storage area in the order of data reception from (L) (H) of the low address to
(L) (H) of the next address.
Under the following conditions, when the receive end data quantity is an odd byte, 00H is stored in the upper byte of the last data storage position:
When the unit for the receive end data quantity is designated in bytes.
When data reception is performed using the receive end code.
Ex.
When receive data "ABCDEFG123" was stored (The receive area is the default value.)
C24
Target device
Head
"321GFEDCBA"
OS area
(*1)
CH1 address
Un\G 1536
Un\G 1537
Un\G 1538
Un\G 1539
Un\G 1540
Un\G 1541
Un\G 1542
Buffer memory
(B)
42H
(D)
44H
(F)
46H
(1)
31H
(3)
33H
5 or 10
(A)
41H
(C)
43H
(E)
45H
(G)
47H
(2)
23H
Receive data count storage area
Received data storage area
The received data are stored in the order of low address (L)→(H), next address (L)→(H) as they were received.
3
*1 The OS area of C24 is the memory (8448 bytes) that temporarily stores the data to be received while a reception data read request is being issued to the CPU module. (Reading received data in the OS area cannot be performed by the user.)
When the program finishes reading the received data in the buffer memory in response to the current read request, the received data in the OS area, and any succeeding received data, is stored successively in the receive area in the buffer memory when the next read request is issued.
Also, when the free OS area, which stores the received data, is reduced to 64 bytes (default value) or less, a request to discontinue data transmission from the target device is issued by the following transmission control (The RS (RTS) signal does not turn OFF):
When DTR control is set, the ER(DTR) signal turns OFF.
When DC1/DC3 control is set, DC3 is sent.
When there is no more free OS area to store received data, SIO error occurs and the SIO information bit of the 'CH side LED lighting status and communication error status' (Un\G513/514) turns ON. In that case, succeeding received data is discarded until a free area becomes available in the OS area.
For more details on the transmission control, refer to the following section.
Page 268 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
61
Reception operation
■
Data reception when the receive data storage area > receive data length
Ex.
When data of 511 words or less is received by the CH1 side interface on the condition that the receive area for the CH1 interface is Un\G1536 to 2047 (default value)
Complete code
Target device
C24
100 words
Reception data read request (X3)
Program INPUT
Number of data to be read: 100 words
■
Data reception when the receive data storage area < receive data length (Reception using the receive end code)
The data link processing is required in the program.
Ex.
When data of 534 words is received by the CH1 side interface on the condition that the receive area for the CH1 interface is
Un\G1536 to 2047 (default value).
Complete code
Target device
C24
511 words 23 words
Reception data read request (X3)
Program INPUT INPUT
Number of data to be read:
511 words
Number of data to be read:
23 words
62
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
■
Data reception when the receive data storage area < receive data length (Reception by receive end data quantity)
If a specified receive end data quantity is bigger than the receive data storage area, the 'receive buffer memory length designation' (Un\G167/327, default: 512) minus 1 is used as the receive end data quantity instead.
(Receive data storage area) > (Data length transmitted from the target device)
Ex.
When 550 words of data is received by the CH1 interface three times on the condition that the receive area for the CH1 interface is Un\G1536 to 2047 (default value).
1st data 2nd data 3rd data
Target device 511 words 39 words 472 words 78 words 733 words 117 words
C24
3
Reception data read request (X3)
Program INPUT INPUT
Read data....
1st 511 words
INPUT
Read data....
1st 39 words and
2nd 472 words
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
63
Program for data reception
Program example for data reception
The following shows the program for data reception using the nonprocedural protocol and its example.
For details on the INPUT instruction, refer to the dedicated instructions.(
Page 580 Dedicated Instructions)
X3 Read request
*1
M0
(CH1)
Create control data from D0
X4
Abnormal detection
G.INPUT
Un D0 D10 M0
M0 M1
Processing for normal completion
(received data is stored)
M1
Processing for abnormal completion
(Reading and discarding received data, retransmission request, etc.)
*1 When the completion device is OFF, execute the INPUT instruction.
When INPUT instruction is executed when the completion device is ON, data may not be received properly.
64
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
(CH1)
Module READY (X1E)
Ò
Reception data read request
(X3)
Reception abnormal detection (X4)
INPUT instruction
Ó
ON during abnormal reception detection
Ó
ON during abnormal reception detection
INPUT INPUT
Ô Ô
INPUT instruction completion device
INPUT instruction completion device + 1
(Normal completion/abnormal completion)
(M0)
(M1)
Õ Õ
1 scan
Receive data count (Un\G1536)
Received data (from Un\G1537) m n
Received data 1
1
Received data 2
Data reception
Data reception-1 Data reception-2
Start the programmable controller of the host station. The setting values specified with an Engineering tool are stored in
C24.
When the amount of data specified by the receive end data quantity or data containing the receive end code is received from the target device, the 'CH1 reception data read request' (X3) turns ON.
After the control data for the INPUT instruction is stored in the device, the program executes the INPUT instruction and reads the received data.
Before executing the INPUT instruction, check that the INPUT instruction completion device (M0) is OFF.
Once reading of the received data is completed, the INPUT instruction completion device turns ON.
When the completion device + 1 (abnormal completion signal) turns ON, the error code is stored in the control data completion status (S1 + 1).
■
Program example
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
Label to be defined Define the global label as shown below.
Description
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
Device
X3
X4
3
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
65
(0) Specify the reception channel.
Specify the allowable number of data to be received.
Specify the execution instruction.
C24
Address Buffer memory
Un\G600 Data reception result
D0
D1
D2
D3
D4
For normal completion
I/O No.
Interface number
Allowable number of data to be received
Reception result
Receive data count
(1)
(10)
(0)
(n)
D10 to
Dm
Receive data
Receive data to
Un\G1536
Un\G1537 to
Un\G2047
Receive data count
Receive data
* When the number of received data is bigger than the allowable number of data to be received, only the data equivalent to the allowable number will be stored and the rest of the data will be discarded.
D0
D1
D2
D3
D4
For abnormal completion
I/O No.
Interface number
Allowable number of data to be received
Reception result
(1)
(10)
(other than 0)
Receive data count (n)
D10 to
Dx
Received data
Receive data to
From the buffer memory (Un\G600)
From the buffer memory (Un \ G1536)
* Data received prior to an error will be stored in the received data storage device.
66
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
• Received data can also be read by using an interrupt programs. (
Page 251 RECEIVING DATA WITH
Note that if the reading of data received from the same interface is performed, it is not possible to combine reading data by the main program and that by the interrupt program.
Use either of the above programs to read the data received.
• The SPBUSY instruction is used to read the execution status when using a dedicated instruction. (
3
• More than one INPUT instruction cannot be executed simultaneously on the same interface.
Execute the next INPUT instruction only after the execution of the first INPUT instruction is completed.
• When the send/receive data quantity is set in word units and the receive data quantity is an odd byte when requesting the reading of received data to the CPU module, the receive data quantity is processed as follows:
Receive data quantity = Receive data byte count/2...Round up after the decimal point.
Also, 00H is stored in the higher byte of the last data storage position in the receive area where received data is stored.
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
67
Reception error detection and check methods
The following explains how to detect and confirm errors that may occur when receiving data from target devices.
The following items are considered as the primary causes of errors that may occur during data reception.
Cause of reception error
A transmission error occurred due to noise.
A timeout occurred for the no-reception monitoring time (timer 0).
Data that could not be converted using the ASCII-BIN conversion is included.
Data larger than the size that could be stored in the OS area of C24 is received.
Reference
MELSEC iQ-R Serial Communication
Module User's Manual(Startup)
Page 260 No-reception Monitoring
Page 380 ASCII-BIN Conversion for
Page 61 Receive data arrangement
Detection/checking of reception error by a program
■
Detecting a reception error
The following device and input signals turn ON.
• INPUT instruction completion device + 1
• 'CH reception abnormal detection' (X4/XB)
• 'CH Error occurrence' (XE/XF)
■
Checking a reception error
The reception error code can be checked using the INPUT instruction control data ((S1) + 1).
Or, it can be checked by reading the 'data reception result' (Un\G600/616).
For details on how to check the error code contents and corrective actions, refer to the following section.
'CH Error occurrence' (XE/XF) turns OFF when the data transmission/reception processing is performed normally.
Detection/checking of reception error with module and Engineering tool
■
Confirmation using the indicator LED
When C24 detects an error, including a transmission error, the ERR LED turns ON.
■
Confirmation using Engineering tool
Monitor the 'data reception result' (Un\G600/616) to check the error code.
Considerations
The following describes the considerations for received data in case of errors.
■
Storing received data
The received data for which an error was detected is discarded and only the normally received data is stored in C24.
Thus, there may be missing data among the data that has been read to the CPU module when a reception error occurs.
■
Reading received data
When receive data is read to the CPU module by turning the 'CH reception abnormal detection' (X4/XB) ON, the data that was normally received prior to the error detection is read.
Read and discard received data as needed.
68
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
CPU module
Reception abnormal detection
INPUT instruction
C24
Receive data count
Reception area
(buffer memory)
3
(00
H
) (03
H
)
A
(41
H
)
STX
(02
H
)
C
(43
H
)
B
(42
H
)
Received data
E
(45
H
)
D
(44
H
)
Reception error occurred data
Head data Receive complete code
Target device
S
T
X
A B C D E F G H
E
T
X
(02
H
) (41
H
) (42
H
) (43
H
) (44
H
) (45
H
) (46
H
) (47
H
) (48
H
) (03
H
)
Transmitted data
3
Module READY (X1E)
Reception data read request (X3)
Reception abnormal detection (X4)
INPUT instruction
INPUT instruction completion device
INPUT instruction completion device + 1
(normal completion/abnormal completion)
Receive data count (Un\G1536)
Received data (from Un\G1537) n
INPUT
3
Received data
1 scan
ERR LED turns ON
Reception abnormal detection data
Data reception
When the data of "G" or later in the reception message shown in the above figure is received normally, the data is stored in the
C24 OS area.
The received data stored in the OS area will be read to the CPU module in the next read operation.
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
69
Receive data clear
For the data reception using the nonprocedural protocol, if the transmission of data from a transmitting device is interrupted due to any trouble, clearing the data received up to the present time on the receiving device side and receiving again from the first data may be required.
The methods for clearing received data in the C24 are shown below.
Use any of the methods to clear received data as necessary.
• Receive data clear request by the dedicated instruction "CSET" (
Page 70 Receive data clear with dedicated instruction
• Write to/read from the 'receive data clear request' (Un\G168/328). (MOV instruction) (
Page 72 Receive data clear with
• Receive data clear request with Engineering tool. (
Page 76 Receive data clear request procedure using Engineering tool)
Precautions
When transmitting data to a target device from C24, do not execute a clear request of the receive data with Engineering tool.
If a receive data clear request is executed when transmitting data to a target device, C24 stops data transmission and terminates the dedicated instruction for transmission abnormally. (The transmission completion signal does not turn ON.) If a receive data clear request is executed during data reception, the data received up to that point are cleared.
Receive data clear processing
C24 performs the following processing when the receive data clear is performed.
• C24 regards the received data up to the present time as invalid data.
• C24 clears the receive data quantity up to the present time to "0". (The receive area in the buffer memory is not initialized).
• C24 sets the status in the one prior to the start of data reception.
Procedure for clearing the received data by the program
Using the following instructions, clear the received data by a program.
• Dedicated instruction "CSET"
• MOV instruction
For the procedure to clear received data by a program, refer to the following.
Receive data clear with dedicated instruction "CSET"
This instruction clears the received data up to the present time without interrupting the data transmission processing.
For details on CSET instruction, refer to the dedicated instruction. (
Page 580 Dedicated Instructions)
■
Procedure for clearing (For the CH1 side interface)
If the CSET instruction is executed while the 'CH reception data read request' (X3/XA) or 'CH reception abnormal detection signal' (X4/XB) is ON, the CSET instruction is kept waiting until the signal is turned OFF.
The receive data clear processing is executed to the OS area of the C24. (
Page 61 Receive data arrangement)
70
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
■
Program example
The following shows the CH1 receive data clear program example using CSET instruction.
Category Setting content
Label to be defined Define the global label as shown below.
3
(0)
(17)
Set the execution type.
Set the request type (receive data clear).
Execute receive data clear.
Processing for normal completion and abnormal completion
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
71
Receive data clear with MOV instruction
Write to/read from the 'receive data clear request' (Un\G168/328) in the procedure below with the MOV instruction.
When resuming data communication with a target device, resume it after completing the receive data clear processing with
C24.
Depending on the data communication system, it may be necessary to restart data communications with the target device after notifying the target device from the CPU module that resumption of communications is possible.
Create a program including contacts indicating the following status (such as flag for the user) in MOV instruction.
• Contacts indicating that the 'CH reception data read request' (X3/XA) and 'CH reception abnormal detection' (X4/XB) are OFF
• Contact indicating that no dedicated instruction (OUTPUT/PRR/INPUT) is currently being executed
• Contact indicating that receive data clear processing is not currently being performed
■
Clear Procedure (When the CH1 side interface is used)
C24
Transmission request execution disabled
Dedicated instruction for transmission execution
Receive
Ó data clear disabled, too processing
“1”
Ô
Receive data clear request
(Un \ G168)
“0” “0”
CPU module
(Program)
Ò
MOV instruction
(Write "1" to address A8H)
Write "1" to the 'receive data clear request' (Un\G168) with the MOV instruction when no data reception, data transmission, or receive data clearing processing is being performed.
The receive data clear processing is executed to the OS area of the C24.(
Page 61 Receive data arrangement)
When receive data clear processing is completed, the 'receive data clear request' (Un\G168) becomes "0".
72
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
■
Program example
The following shows the CH1 receive data clear program example using MOV instruction.
The dedicated instructions (OUTPUT/INPUT) is used for data transmission/reception.(
Page 580 Dedicated Instructions)
Category Label name/FB name
Module label C24_1
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.uSet_Request_ReceiveDataClear_D
Label to be defined Define the global label as shown below.
Description
Target module
Module READY
Watchdog timer error
CH1 Reception data read request
CH1 Reception abnormal detection
CH1_Receive data clear request
Device
X1E
X1F
X3
X4
U0\G168
3
FB M+RJ71C24_Output Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
73
74
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
(6)
(8)
Set the receive data clear acknowledgement flag.
Execute receive data clear processing.
(21) Read receive data clear status.
Reset the receive data clear acknowledgement flag.
Reset the receive data clear in progress flag.
Set the transmission request.
(35)
(37) Designate the transmission channel.
Set the send data quantity.
Set the send data (string).
Set the send data (numeric value).
Set the transmission request.
(108) OUTPUT instruction normal completion
(110) OUTPUT instruction abnormal completion
(112) Reset the transmission processing request.
Reset the transmission request.
(115) Reset the OUTPUT instruction execution completion flag.
Reset the OUTPUT instruction abnormal completion flag.
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
75
3
Receive data clear request procedure using Engineering tool
The following shows the method which uses "Intelligent Function Module Monitor" of Engineering tool.
For the operation method of the Intelligent Function Module Monitor function, refer to the following manual.
GX Works3 Operating Manual
Operating procedure
1.
Register C24 in "Intelligent Function Module Monitor".
2.
Set "CH Receive data clear request" of "Receiving end specification" to "Requested".
3.
The received data is cleared.
76
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
Receive end data quantity and receive end code settings
Setting method before receiving data
The following default values have been set for the receive end data quantity and receive end code that are used for data reception with the nonprocedural protocol.
Setting data Allowable range Remarks
Receive end data quantity
Default value
511 (1FFH) Less than the size of the receive data storage area
Buffer memory address where the setting value is stored
Un\G164/324
Receive end code 0D0AH
(CR+LF)
0000H to 00FFH
FFFFH
Un\G165/325
Unit is in accordance with the word/byte units designation.
When any code is set.
When there is no receive end code.
The receive end data quantity and the receive end code setting value can be changed by the program before data reception processing.
The default value can be changed in the following unit parameter of Engineering tool.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
For details, refer to the following section.
Setting method after receiving data
Other than through the setting using Engineering tool or the MOV instruction at the startup of the C24, the receive end data quantity and receive end code setting values can be changed even after data communication has started if the timing is as shown below.
The following describes the restriction of the module, and the timing and procedure for changing setting values to continue the data receive processing by changing the setting values for data reception using the nonprocedural protocol after the start of data communication.
■
How to receive data
Reception using an interrupt program
*1
cannot be performed. (Transmission using a dedicated instruction (OUTPUT) can be performed.)
Data must be received by the main program.
The following shows the I/O signals.
*1 For details on the data reception using interrupt programs, refer to the following section.
Page 251 RECEIVING DATA WITH AN INTERRUPT PROGRAM
Type Signal name
Reception
Input/Output Signals
CH1 side CH2 side
X3
X4
XA
XB
Reception data read request
Reception abnormal detection
Device that turns ON/OFF
CPU module C24
3
When the 'CH reception abnormal detection' (X4/XB) turns ON, read the error code from the buffer memory below, and then check the type of error and take corrective actions.(
• 'Data reception result' (Un\G600/616)
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
77
■
Setting values that can be changed
Of the initial settings from Engineering tool stored in the buffer memory, only the following setting values can be changed after data communication has started.
• 'Receive end data quantity designation' (Un\G164/324)
• 'Receive end code designation' (Un\G165/325)
■
Timing and procedure for changing the setting values
● Timing of change
To change the receive end code and receive end data quantity after data communication has started, change the setting when the status of the I/O signals relating to the reading of received data is as shown below.
• 'CH Reception data read request' (X3/XA) or 'CH reception abnormal detection' (X4/XB): ON
● Change procedure
When the 'CH reception data read request' (X3/XA)/'CH reception abnormal detection' (X4/XB) turns ON upon data reception from the target device, perform the following and execute the INPUT instruction.
• Change the setting values for the receive end code and the receive end data quantity.
Ex.
When reading data received in the CH1 side interface
Target device
CPU module
Data 1 Data 2
Data read request using setting value -A/-1
Reception data read request (X3)
Ò
Ó
Õ
INPUT instruction
Received data count designation
(Un\G164) Setting value-A
Ô
Receive data code designation
(Un\G165)
Setting value-1
Setting value-B
Setting value-2
■
Program example
Category
Module label
Label name/FB name
C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.uSet_ReceivedDataCount_Reception_D
C24_1.stnCH1.uSet_ReceiveCompleteCode_Reception_D
Label to be defined Define the global label as shown below.
Data read request using setting value -B/-2
Description
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
CH1_'Receive end data quantity designation
CH1_Receive end code designation
Device
X3
X4
U0\G164
U0\G165
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
78
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
(0)
(63)
(66)
Specify the reception channel.
Specify the allowable number of data to be received.
Set the receive end data quantity.
Set the receive end code.
Normal completion
Abnormal completion
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
79
3
3.2
Transmitting Data to Target Device
This section explains data transmission from the CPU module to a target device.
Sending methods
The following shows how to send data in any format using the nonprocedural protocol.
CPU module
Transmission data
S
T
X
A B C D E F G H
E
T
X
(02
H
) (41
H
) (42
H
) (43
H
) (44
H
) (45
H
) (46
H
) (47
H
) (48
H
) (03
H
)
Ò Ó
OUTPUT instruction
C24
Transmission data count
Transmission area
(buffer memory)
(00
H
)
10
(0A
H
)
A
(41
H
)
C
(43
H
)
STX
(02
H
)
B
(42
H
)
Transmission data designation
E
(45
H
)
D
(44
H
)
G
(47
H
)
ETX
(03
H
)
F
(46
H
(48
H
H
Target device
)
)
Ô
Transmission data
ETX
(03
H
)
H
(48
H
)
Contents CH1/CH2 Control timing
A
(41
H
)
STX
(02
H
)
Transmission command
OUTPUT instruction completion device
OUTPUT instruction
OUTPUT
Send data is stored in the device designated with the OUTPUT instruction.
Control data is stored in the device designated with the OUTPUT instruction.
When the OUTPUT instruction is executed, C24 transmits the amount of data designated by the send data quantity from the send data area in ascending order of the send data area addresses.
80
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
Send area and send data arrangement
This section explains the send area and the send data arrangement for performing data transmission using the nonprocedural protocol.
Send area
The send area is a memory to write data and the data quantity that are transmitted from the CPU module to a target device via
C24.
The send area is assigned to the address, Un\G1024 to 1535 (CH1 side), Un\G2048 to 2559 (CH2 side) by default.
CH1 address
Un\G1024
Un\G1025
Buffer memory
Transmission data count designation area
The unit of transmission data count(words/bytes) is in accordance with the word/byte units designation with Engineering tool.
The transmission data count designated with the OUTPUT instruction is written.
Transmission data designation
The transmission data designated with the OUTPUT instruction is written.
Un\G1535
(Default)
The position and size of the send area in the buffer memory can be changed with Engineering tool in accordance with the specifications of the target device and the send data length. (
Configure the settings as follows:
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
• Designate the start address for the area to be used as the send area in the user setting area (Un\G1024 to 6911, Un\G9728 to 16383) to "Send buffer memory start address designation".
• Designate the length of the area to be used as the send area in the user setting area (Un\G1024 to 6911, Un\G9728 to
16383) by address count (0001H to 1A00H) to "Send buffer memory size specification".
When changing the position and size of the send area in the buffer memory, if any of the functions below are used concurrently, make sure not to overlap with the buffer memory addresses assigned for storing send/receive data handled with the functions.
• MC protocol buffer memory read/write function
• MC protocol on-demand function
• Predefined protocol function (Send/receive data storage area)
• Nonprocedural protocol transmission/receive function
• Bidirectional protocol transmission/receive function
• Send/receive data monitoring function
Set the size of data per data transmission from the target device to C24 to be equal to or smaller than the size of the send data storage area in the buffer memory.
• (Send data storage area) (Amount of data in any data portion to be transmitted from C24)
To transmit data whose size is larger than the send data storage area, increase the send area, or divide the send data before sending.
3
The position and size of send area can be changed in the buffer memory.
• 'Send buffer memory start address designation' (Un\G162/322)
• 'Send buffer memory length designation' (Un\G163/323)
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
81
Send data arrangement
The following example shows an arrangement of the send data to be sent to the target device when storing it in the send area.
Ex.
When transmitting 'ABCDEFG123' (The send area is the default value.)
CH1 address
Un\G 1024
Buffer memory
5 or 10
(1)
Un\G 1025
Transmission data count designation
In accordance with the word/byte units designation
Word units : 5
Bytes units : 10
Un\G 1026
Un\G 1027
Un\G 1028
Un\G 1029
Un\G 1030
(B)
42
H
(D)
44
H
(F)
46
H
(1)
31
H
(3)
33
H
(5)
35
H
(A)
41
H
(C)
43
H
(E)
45
H
(G)
47
H
(2)
23
H
(4)
34
H
(2)
Transmission data designation
Sequentially store the transmission data to low address (L) → (H), next address (L) → (H), in the order of transmission.
82
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
Program for data transmission
Program example for data transmission
The following shows the program for data transmission using nonprocedural protocol and its example.
For details on OUTPUT instructions, refer to the dedicated instruction. (
Page 580 Dedicated Instructions)
Transmission instruction (CH1)
Create transmission data from D11
M0 M1
M1
Create control data from D0
G.OUTPUT
Un D0 D11 M0
Processing for normal completion
Processing for abnormal completion(retransmission, etc.)
Ò Module READY (X1E)
Transmission instruction
Ó
Ô
OUTPUT instruction
OUTPUT instruction completion device
OUTPUT instruction completion device + 1
(normal completion/abnormal completion)
Transmission data count (Un\G1024)
Transmission data (from Un\G1025)
0
OUTPUT
Õ
ON when transmission abnormal completion
1 scan n
Transmission data
Data transmission
Start the programmable controller on the host station.
The value set with Engineering tool is stored in the C24.
Input the user data transmission command signal.
Executes the OUTPUT instruction after storing the send data and the control data for the OUTPUT instruction in the device.
Data is sent when the OUTPUT instruction is executed.
C24 transmission processing completes and the OUTPUT instruction completion device turns ON.
When the completion device +1 (abnormal completion signal) turns ON, the error code is stored in the control data completion status (S1 + 1).
3
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
83
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_Output Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
84
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
(0)
(3)
(69)
Convert the transmission command into pulse.
Store the data to be transmitted.
Designate the transmission channel.
Designate the send data quantity.
Set the instruction execution flag.
Reset the completion flag by an external command.
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
85
3
C24
Address Buffer memory
Un\G599 Data transmission result
D0
D1
D2
For normal completion
I/O No.
Interface number
Transmission data count
D11 to
D15
Transmission data
(1)
(5)
(4241
H
) to
(0A0D
H
)
D101 Transmission result (0)
D0
D1
D2
For abnormal completion
I/O No.
Interface number
Transmission data count
D11 to
D15
Transmission data
(1)
(5)
(4241
H
) to
(0A0D
H
)
D101 Transmission result (other than 0)
Un\G1024 Transmission data count designation
Un\G1025 to
Transmission data designation
Un\G1535
From buffer memory (Un\G599)
The SPBUSY instruction is used to read the execution status when using a dedicated instruction. (
More than one OUTPUT instruction cannot be executed simultaneously on the same interface.
Execute the next OUTPUT instruction only after the execution of the first OUTPUT instruction is completed.
86
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
Transmission error detection and check methods
The following explains how to detect and confirm errors that may occur when sending data to target devices.
The following items are considered as the primary causes of errors that may occur during data transmission.
Cause of transmission error
A timeout occurred for the send monitoring time (timer 2).
The send data quantity exceeding the size that can be stored in the send area is designated.
Reference
Page 265 Send Monitoring Time (timer 2) Setting
Page 81 Send area and send data arrangement
Detection/checking of transmission error by a program
■
Detecting a transmission error
The following device and input signal turn ON.
• OUTPUT instruction completion device + 1
• 'CH Error occurrence' (XE/XF)
■
Checking a transmission error
The transmission error code can be checked using the OUTPUT instruction control data ((S1) + 1).
Or, it can be checked by reading the 'data transmission result' (Un\G599/615).
For details on how to check the error code contents and corrective actions, refer to the following section.
'CH Error occurrence' (XE/XF) turns OFF when the data transmission/reception processing is performed normally.
Detection/checking of transmission error with module and Engineering tool
■
Confirmation using the indicator LED
When C24 detects an error, including a transmission error, the ERR LED turns ON.
■
Confirmation using Engineering tool
Monitor the 'data transmission result' (Un\G599/615) to check the error code.
When a transmission error occurs, the CPU module may not transmit all the designated data.
Establishing any communication procedure by the user so that normal transmission can be checked by receiving a response to data transmission is recommended.
3
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.2 Transmitting Data to Target Device
87
3.3
Considerations for Data Communication
The following describes considerations for data communications using the nonprocedural protocol.
Factors that initialize the C24 transmission sequence
The initial status means the status where transmission has stopped and received data has been discarded.
C24 transmission sequence initialization factors are as follows.
• When the power is turned ON, the CPU module is reset, or the C24 mode is switched.
• When the received data was cleared.
Framing error on the target device side
When nothing is transmitted from C24 to a target device through the RS-422/485 interface, a framing error may be generated by the noise etc, on the target device side.
Send an arbitrary code first so that the target device identifies the head of the data transmitted from C24.
Check the C24 interface specifications before data communication.
Data communications with target device using the multidrop connection
When communicating data by the multidrop connection between the target device and the CPU module in a 1:n basis, data transmitted by the target device is received by C24.
For the multidrop connection, data reception using a user frame should be performed. (
If data is not received by user frame, create a program that ignores (reads and discards) the received data other than the received data addressed to the host station, including the data indicating the target CPU module in the message.
Ex.
STX
(
02
H
)
Space
(
20
H
)
Station
No. 0
(
30
H
)
Station
No. 2
(
32
H
)
Data length
(BIN data)
Data CR
(
0D
H
)
LF
(0A
H
)
Retry processing for data reception errors
The data when reception error occurred is discarded and only the data for the normal reception is taken into the C24.
For this reason, the received message may be missing data if reception error occurs.
To assure the correct transmission and reception of data, it is recommended that a normal/error response message is received and a response message reception timeout check is conducted for the data transmitted between the CPU module and the target device, and that measures such as retransmitting the data (transmission retry) is taken when an abnormal response is received or when an error timeout occurs.
88
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.3 Considerations for Data Communication
4
DATA COMMUNICATION USING
BIDIRECTIONAL PROTOCOL
This communication enables data transfer between a target device and a CPU module using the data format and transmission control procedure for the bidirectional protocol.
The feature of this data communication is that a response message is sent from the data receiving side to the data sending side to inform whether the communication has been completed.
Use this to check if the data communication has been completed normally.
A program for data communication is required for the CPU module.
Ò arget device sends data to the C24
When receiving data
ENQ
Data length
When normal
Arbitrary data
When abnormal
Sum check code
ACK
Error code
NAK
Ó The C24 notifies whether the data communication has been completed normally by a response message.
4
Communication using the bidirectional protocol can be replaced with those of the predefined protocol.
The Predefined protocol support function of Engineering tool allows the easy replacement.
With the predefined protocol, the required program is only for starting communication according to the specified protocol, and this can reduce the number of steps considerably.
For the communication using the predefined protocol, refer to the following chapter.
Page 30 DATA COMMUNICATION USING PREDEFINED PROTOCOL
Parameter setting for data communication using bidirectional protocol
Set the transmission setting and the communication protocol, etc. for a target device.
Set "Bidirectional protocol" for "Communication protocol setting".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
Configure other settings according to the system being used.
For details of the settings, refer to the following chapter.
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
89
4.1
Receiving Data from Target Device
This section explains data reception from a target device.
Receiving methods
The following shows how to receive data sent from the target device using the bidirectional protocol.
Since the size of each message to be received is recognized using the "data length" information contained in the message, messages of any size can be sent from the target device.
CPU module
Program
Ó
Read request
Ô
Read
(BIDIN instructions)
Arbitrary data
(00H to FFH)
C24
Buffer memory
Reception area
(When normal)
Arbitrary data
Ò
ENQ Data length Data area Sum check code
(When abnormal)
(00H to FFH)
Ignored
Error code NAK
Ó
Õ
ACK
Target device
Contents
Reception data read request
BIDIN instruction completion device
BIDIN instruction
CH1/CH2
X3/XA
Control Timing
BIDIN
90
When the control code ENQ is received, C24 starts data reception processing.
When data portion for the data length is received, C24 ends the reception processing of arbitrary data portion.
• When sum check code is enabled in the transmission setting of Engineering tool, C24 checks whether the message is normal or abnormal using the sum check code received immediately after the message and the sum check code calculated by internal processing.
• When sum check code is disabled in the transmission setting of Engineering tool, messages are not checked using the sum check codes.
When the message has normally been received, the 'CH reception data read request' (X3/XA) turns ON.
• If an error has been detected when receiving the message, C24 transmits an abnormal completion response message
(NAK message) to the target device.
• The reception data read request will not be sent to the CPU module. (The 'CH reception abnormal detection' (X4/XB) does not turn ON.)
C24 stores the control data in the device designated with the BIDIN instruction, and then executes the BIDIN instruction.
• Received data is read from the receive area in the buffer memory.
When the BIDIN instruction has been executed, C24 transmits a normal completion response (ACK message) to the target device.
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
Receive area, receive data arrangement and contents
This section shows the receive area and the receive data arrangement for performing data reception using the bidirectional protocol.
Receive area
The receive area is a memory that stores the data length (receive data quantity) and data portion received from a target device.
By default, the receive area is assigned to the addresses, Un\G1536 to 2047 (CH1 side) and Un\G2560 to 3071 (CH2 side).
CH1 address
Un\G1536
Un\G1537
Buffer memory
Receive data count
The units of data length (word/byte) is in accordance with the word/byte units designation with Engineering tool.
Data length
The contents of data length of the received message are stored.
Un\G2047
(Default)
Received data Data portion
The contents of the data area of received message are stored in ascending address order.
The position and size of the receive area in the buffer memory can be changed with Engineering tool in accordance with the specifications of the target device and the receive data length. (
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
Configure the settings as follows:
• Designate the start address for the area to be used as receive area in the user setting area (Un\G1024 to 6911, Un\G9728 to 16383) to "Receiving buffer memory start address designation".
• Designate the length of area to be used as the receive area in the user setting area (Un\G1024 to 6911, Un\G9728 to
16383) by address count (0001H to 1A00H) to "Receiving buffer memory size specification".
When changing the position and size of the receive area in the buffer memory, if any of the functions below are used concurrently, make sure that the addresses of the receive area do not overlap with the buffer memory addresses assigned for storing send/receive data with the functions.
• MC protocol buffer memory read/write function
• MC protocol on-demand function
• Predefined protocol function (Send/receive data storage area)
• Nonprocedural protocol transmission/receive function
• Bidirectional protocol transmission/receive function
• Send/receive data monitoring function
Set the size of data per data transmission from the target device to C24 to be equal to or smaller than the size of the receive data storage area in the buffer memory.
• (Receive data storage area) (Amount of data in any data portion to be transmitted from the target device)
To transmit data whose size is larger than the receive data storage area, increase the receive area, or divide the send data before sending.
4
The position and size of the receive area can be changed in the buffer memory.
• 'Receiving buffer memory start address designation' (Un\G166/326)
• 'Receive buffer memory length designation' (Un\G167/327)
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
91
Receive data arrangement
The following shows the example of the arrangement of data received from the target device when it is stored in the receive area.
• The received message is stored to the C24 buffer memory (Receive data storage area).
• The data is stored in the receive data storage area in the order of the data reception from low address, (L) (H), to next address, (L) (H).
Ex.
When received data "ABCDEFG123" was stored (for the CH1 side)
C24
Receive data count
Received data
Reception area
(buffer memory)
(00
H
)
5
B
(42
H
)
D
(44
H
)
F
(46
H
)
1
(31
H
)
3
(33
H
)
(05
H
)
A
(41
H
)
C
(43
H
)
E
(45
H
)
G
(47
H
)
2
(32
H
)
Received data
ENQ
Data length
(0005H)
L H
A B C D E F G 1 2 3
L
Sum check code
H
05
H
00
H
41
H
42
H
43
H
44
H
45
H
46
H
47
H
31
H
32
H
33
H
77
H
02
H
Transmitted data (Response message)
ACK
06
H
(Normal completion)
Target device
When the data length unit is in bytes, 00H is stored in the higher byte of the last data storage position in the receive area when the data length of the message is an odd byte.
92
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
Contents of received data
The following shows the contents of data to be received, including data to be transmitted. (
Page 100 Send area and send data arrangement)
■
Control codes
The types of control codes are shown in the table below.
Description Signal name
ENQ
ACK
NAK
Code
(hexadecimal)
05H
06H
15H
Enquiry
Acknowledge
Negative Acknowledge
Application
Code for starting data transmission
Response code to the target side when data was received normally
Response code to the target side when data could not be received normally
(Error code is sent immediately after the response code.)
• Target device C24
C24 checks and processes the control code received.
It cannot be read from the program.
• C24 target device
C24 adds the control code to be transmitted.
■
Data length
This indicates the number of bytes or words for the data portion of the message.
The unit of data length (words/bytes) is in accordance with the word/byte units designation with Engineering tool.
• Target device C24
C24 checks the length of the data received.
When the reception is normal, C24 stores the received data in the receive data storage area in the C24 buffer memory, assigning the first byte as the lower byte (L).
• C24 target device
The length of data to be transmitted is the send data quantity designated by the program using the BIDOUT instruction.
C24 transmits this value as is from the lower byte (L).
■
Data portion
This consists of an array of original one-byte data to be transmitted to the target device side, which can handle 00H to FFH code data.
• Target device C24
If the receive data portion is normal, C24 takes the codes as is and stores them in the receive data storage area in sequence, beginning with the lowest address.
The storage size is in accordance with the data length in the message and the word/byte units designation with Engineering tool.
• C24 target device
The portion of data to be transmitted is the send data designated by the program using the BIDOUT instruction.
C24 transmits the data for the send data quantity according to the word/byte units designation with Engineering tool from the lowest address in the send data specification area using the code as is.
4
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
93
■
Sum check code
The sum check code expresses the numeric value for the lower two bytes (16 bits) of the results (sum) from the addition of the data length and the data portion in the message as binary code data.
When sum check code is enabled in the transmission setting of Engineering tool, it is necessary to add a sum check code at the end of the message.
• Target device C24
C24 checks and processes the sum check code received. It cannot be read from the program.
When "None" is specified for "Sum check code", once data portion of message corresponding to the data length is received, the succeeding data received will be ignored up to the control code that follows.
• C24 target device
C24 calculates and adds the sum check code to be transmitted.
When "None" is specified, no sum check code is transmitted.
Ex.
Sum check code when "ABCDEFGHIJ " and the numeric value 100 are sent as data (when the unit is in bytes.)
Target device
Arbitrary data
Data
E
N
Q
Data length
(000CH)
A B C D E F G H I J
100
(0064H)
Sum check code
05
H
L H
0C
H
00
H
41
H
L
42
H
43
H
44
H
45
H
46
H
47
H
48
H
49
H
4A
H
64
H
H L
00
H
27
H
H
03
H
C24
0C
H
+00
H
+41
H
+42
H
+43
H
+44
H
+45
H
+46
H
+
47
H
+48
H
+49
H
+4A
H
+64
H
+00
H
Contents of 0327H memory b15
0 0 0
Added value = 0327H
0
(H)
To
0 0 1 b8 b7
1 0 0 1
(L)
To
0 0 1 b1 b0
1 1
03
H
27
H
(L) (H)
■
Error code
The error code indicates the definition of the error during NAK response.
For details on the error codes, refer to the following section.
• Target device C24
For error codes from the target device, transmit the codes specified by the user.
The error codes (0022H to 005FH) that are not used by C24 can be used.
C24 stores the received error codes as a completion status in the control code for the BIDOUT instruction. They are also stored in the 'data transmission result' (Un\G599).
• C24 target device
C24 adds an error code.
When an error code is transmitted, C24 writes the same error code in the 'data reception result' (Un\G600).
94
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
Program for data reception
Program example for data reception
The following shows the program for data reception using the bidirectional protocol and program example.
For details on the BIDIN instruction, refer to the dedicated instructions. (
Page 580 Dedicated Instructions)
(CH1)
X3 Reception data read request
Create control data from D0
G.BIDIN
Un D0 D10 M0
M0 M1
Processing for normal completion(Storing received data)
Module READY (X1E)
Reception data read request (X3)
BIDIN instruction
Ò
BIDIN instruction completion device
BIDIN instruction completion device +1
(Normal completion/Abnormal completion)
(OFF)
Receive data count (Un\G1536)
Received data (Un\G1537 to 2047) m
Ó
Ô
BIDIN
Õ
1 scan n
Received data
Data reception Response transmission
Start the programmable controller of the host station. The setting values specified with an Engineering tool are stored in
C24.
When data is received from the target device, the 'CH1 reception data read request' (X3) turns ON.
After the control data for the BIDIN instruction is stored in the device, the sequence program executes the BIDIN instruction and reads the receive data.
When the reading of receive data is completed, a response message (ACK message when the operation was completed normally) is sent and the device that has completed the BIDIN instruction turns ON.
4
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
95
■
Program example
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
Label to be defined Define the global label as shown below.
Description
Target module
CH1 Reception data read request
Device
X3
FB M+RJ71C24_BidirectionalInput Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(54)
(56)
Specify the reception channel.
Specify the receive data quantity.
Set the BIDIN instruction execution direction.
Abnormal completion
Reset the abnormal completion flag by an external command.
96
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
C24
Address
Un\G600
Buffer memory
Data reception result
D0
D1
D2
D3
D4
For normal completion
I/O No.
Interface number
Allowable receive data count
Reception result
Receive data count
D10 to
Dm
Received data
Received data to
(1)
(10)
(0)
(n)
Un\G1536
Un\G1537 to
Un\G2047
Receive data count
Received data
* When the received data count is larger than the allowable received data count, only the data up to the allowable received data count will be stored and the rest of the data will be discarded.
• Received data can also be read by using an interrupt programs. (
Page 251 RECEIVING DATA WITH
Note that if the reading of data received from the same interface is performed, it is not possible to combine reading data by the main program and that by the interrupt program.
Use either of the above programs to read the data received.
• The SPBUSY instruction is used to read the execution status when using a dedicated instruction. (
• More than one BIDIN instruction cannot be executed simultaneously on the same interface.
Execute the next BIDIN instruction only after the execution of the first BIDIN instruction is completed.
• When the send/receive data quantity is set in byte units and the receive data quantity is an odd byte when requesting the reading of received data to the CPU module, 00H is stored in the higher byte of the last data storage position in the receive area where received data is stored.
4
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
97
Reception error detection and check methods
The following explains how to detect and confirm errors that may occur when receiving data from target devices.
The following items are considered as the primary causes of errors that may occur during data reception.
Cause of reception error
A transmission error occurred due to noise.
A timeout occurred for the no-reception monitoring time (timer 0).
A timeout occurred for the send monitoring time (timer 2).
Data that could not be converted with the ASCII-BIN conversion was included.
The receive data length was too long to be stored in the receive area.
Simultaneous transmissions occurred.
Reference
MELSEC iQ-R Serial Communication Module User's
Manual(Startup)
Page 260 No-reception Monitoring Time (timer 0) Setting
Page 265 Send Monitoring Time (timer 2) Setting
Page 391 ASCII-BIN Conversion for Data Communicated with Bidirectional Protocol
Page 91 Receive area, receive data arrangement and contents
Page 107 Processing when Simultaneous Transmission is
Performed during Full-Duplex Communications
Confirmation using a program
■
Detecting a reception error
'CH Error occurrence' (XE/XF) turns ON.
■
Checking a reception error
Read the 'data reception result' (Un\G600/616), and check it.
For details on how to check the error code contents and corrective actions, refer to the following section.
'CH Error occurrence' (XE/XF) turns OFF when the data transmission/reception processing is performed normally.
Confirmation using the module and Engineering tool
■
Confirmation using the indicator LED
When C24 detects an error, including a transmission error, the ERR LED turns ON.
■
Confirmation using Engineering tool
Read the 'data reception result' (Un\G600/616), and check the error code.
Considerations
• All of the received data for which an error was detected is ignored and a response message indicating an abnormal completion (NAK message) is transmitted to the target device. The 'CH reception abnormal detection' (X4/XB) does not turn ON.
When an error is detected during a message reception, C24 does not request the CPU module to read the received data.
• The receive area in the buffer memory will contain the data received normally just before the error occurrence. (Data will not be rewritten.)
Receive data clear
Data communications using the bidirectional protocol must be performed after a response message is received in reply to the preceding data transmission.
If C24 detects an error while receiving data, it transmits an NAK message (response message) to the target device after the completion of the data reception and ignores the data being received when the error was detected.
Therefore, the received data does not have to be cleared.
98
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.1 Receiving Data from Target Device
4.2
Transmitting Data to Target Device
This section explains the data transmission from the CPU module to a target device.
Sending methods
The following shows the method of transmitting data to the target device through data communication using the bidirectional protocol.
CPU module
Program
Ò
Write
(BIDOUT instruction)
Data
(00H to FFH)
Ó
C24
Buffer memory
Transmitted area
Ö
Transmission completed
Arbitrary data
Ô
Sum check code Data portion Data length ENQ
(00H to FFH)
Õ
(When normal)
ACK
(When abnormal)
NAK
Error code
Target device 4
Contents
Transmission instruction
BIDOUT instruction completion device
BIDOUT instruction
CH1/CH2 Control timing
BIDOUT
Data such as control data and send data are stored in the device designated with the BIDOUT instruction, and then the
BIDOUT instruction is executed.
The send data quantity and send data are written into the send area in the buffer memory.
C24 transmits data by adding the control code ENQ to the head of the data.
• When sum check code is enabled in the transmission setting with Engineering tool, C24 adds the sum check code calculated by internal processing to the end of the message and then transmits the message.
• When sum check code is disabled in the transmission setting with Engineering tool, sum check code is not transmitted.
A response for the data transmission (for normal completion: ACK message; for abnormal completion: NAK message) is received.
Once the transmission processing of C24 is completed, the execution of the BIDOUT instruction is completed.
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
99
Send area and send data arrangement
This section explains the send area and the send data arrangement for performing data transmission using the bidirectional protocol.
For details on the contents of send data, refer to the following section.
Page 93 Contents of received data
Send area
The send area is a memory area for storing the data and the data quantity that are transmitted from the CPU module to a target device via C24.
The send area is assigned to the address, Un\G1024 to 1535 (CH1 side), Un\G2048 to 2559 (CH2 side) by default.
CH1 address Buffer memory
The unit of transmission data count
(words/bytes) is in accordance with the word/byte units designation with Engineering tool.
Un\G1024
Un\G 1025
Transmission data count designation
Transmission data count
The transmission data count designated with the
BIDOUT instruction is written, and sent as the data length.
Transmission data designation
Un\G 1535
(Default)
Transmission data
The transmission data designated with the
BIDOUT instruction is written and then sent.
The position and size of the send area in the buffer memory can be changed with Engineering tool in accordance with the specifications of the target device and the send data length. (
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
Configure the settings as follows:
• Designate the start address for the area to be used as the send area in the user setting area (Un\G1024 to 6911, Un\G9728 to 16383) to "Send buffer memory start address designation".
• Designate the length of the area to be used as the send area in the user setting area (Un\G1024 to 6911, Un\G9728 to
16383) by address count (0001H to 1A00H) to "Send buffer memory size specification".
When changing the position and size of the send area in the buffer memory, if any of the functions below are used concurrently, make sure not to overlap with the buffer memory addresses assigned for storing send/receive data handled with the functions.
• MC protocol buffer memory read/write function
• MC protocol on-demand function
• Predefined protocol function (Send/receive data storage area)
• Nonprocedural protocol transmission/receive function
• Bidirectional protocol transmission/receive function
• Send/receive data monitoring function
Set the size of data per data transmission from the target device to C24 to be equal to or smaller than the size of the send data storage area in the buffer memory.
• (Send data storage area) (Amount of arbitrary data portion to be transmitted from the CPU module)
To transmit data whose size is larger than the send data storage area, increase the send area, or divide the send data before sending.
The position and size of send area can be changed in the buffer memory.
• 'Send buffer memory start address designation' (Un\G162/322)
• Send buffer memory size specification (Un\G163/323)
100
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
Send data arrangement
The following example shows an arrangement of the send data to be sent to the target device when storing it in the send area.
Ex.
When transmitting "ABCDEFG123"
C24
Transmission data count designation
Transmission data designation
Transmission area
(buffer memory)
(00
H
)
B
(42
H
)
D
(44
H
)
F
(46
H
)
1
(31
H
)
3
(33
H
)
5
(05
H
)
A
(41
H
)
C
(43
H
)
E
(45
H
)
G
(47
H
)
2
(32
H
)
Transmission data
Sum check code
H L
3 2 1 G F E D C B A
Data length
(0005H) ENQ
H L
02
H
77
H
33
H
32
H
31
H
47
H
46
H
45
H
44
H
43
H
42
H
41
H
00
H
05
H
Receive data (response message)
ACK
06
H
(Normal completion)
Target device
4
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
101
Program for data transmission
Program example for data transmission
The following shows the program for data transmission and program example.
For details on the BIDOUT instruction, refer to the dedicated instructions. (
Page 580 Dedicated Instructions)
Transmission instruction (CH1)
Create transmission data from D11
M0 M1
M1
Create control data from D0
G.BIDOUT
Un D0 D11 M0
Processing for normal completion
Processing for abnormal completion (retransmission, etc.)
Module READY (X1E)
Transmission instruction
BIDOUT instruction
BIDOUT instruction completion device
BIDOUT instruction completion device + 1
(Normal completion/abnormal completion)
Transmission data count (Un\G1024)
Transmission data (from Un\G1025)
Ò
Ó
Ô
0
Data transmission
BIDOUT
Õ
ON when transmission abnormal completion
1 scan n
Transmission data
Receiving response
Start the programmable controller on the host station.
The values specified with Engineering tool are stored in C24.
Inputs the user data transmission command signal.
Execute the BIDOUT instruction after storing the send data and the control data for the BIDOUT instruction in the device.
Data is sent when the BIDOUT instruction is executed.
A response for the data transmission (for normal completion: ACK message; for abnormal completion: NAK message) is received.
When the response is received, C24 transmission processing completes and the device that has completed the BIDOUT instruction turns ON.
102
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
When the BIDOUT instruction ends abnormally due to the reception of an NAK message, the complete device +1 (abnormal completion signal) turns ON and the error code is stored in the control data completion status (S1+1).
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
4
FB M+RJ71C24_BidirectionalOutput Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
103
(0)
(3)
(67)
Convert the transmission command into pulse.
Store the data to be transmitted.
Designate the transmission channel.
Designate the send data quantity.
Set the instruction execution flag.
Reset the completion flag by an external command.
104
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
C24
Address Buffer memory
Un\G599 Data transmission result
D0
D1
D2
For normal completion
I/O No.
Interface number
Transmission data count
D11 to
D15
Transmission data
(1)
(5)
(4241
H
) to
(0A0D
H
)
D101 Transmission result (0)
D0
D1
D2
For abnormal completion
I/O No.
Interface number
Transmission data count
D11 to
D15
Transmission data
(1)
(5)
(4241
H
) to
(0A0D
H
)
D101 Transmission result (other than 0)
Un\G1024 Transmission data count designation
Un\G1025 to
Transmission data designation
Un\G1535
From buffer memory (Un\G599)
The SPBUSY instruction is used to read the execution status when using a dedicated instruction. (
4
More than one BIDOUT instruction cannot be executed simultaneously on the same interface.
Execute the next BIDOUT instruction only after the execution of the first BIDOUT instruction is completed.
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
105
Transmission error detection and check methods
The following explains how to detect and confirm errors that may occur when transmitting data to target devices.
The following items are considered as the primary causes of errors that may occur during data transmission.
Cause of transmission error
A transmission error occurred due to noise.
A timeout occurred for the no-reception monitoring time (timer 0).
A timeout occurred for the response monitoring time (timer 1).
A timeout occurred for the send monitoring time (timer 2).
Data that could not be converted with the ASCII-BIN conversion was included.
The send data quantity exceeding the size that can be stored in the send area is designated.
Simultaneous transmissions occurred.
Reference
MELSEC iQ-R Serial Communication Module
User's Manual(Startup)
Page 260 No-reception Monitoring Time (timer 0)
Page 263 Response Monitoring Time (timer 1)
Page 265 Send Monitoring Time (timer 2) Setting
Page 391 ASCII-BIN Conversion for Data
Communicated with Bidirectional Protocol
Page 100 Send area and send data arrangement
Page 107 Processing when Simultaneous
Transmission is Performed during Full-Duplex
Confirmation using a program
■
Detecting a transmission error
The following device and input signal turn ON.
• BIDOUT instruction completion device + 1
• 'CH Error occurrence' (XE/XF)
■
Checking a transmission error
The transmission error code can be checked using the BIDOUT instruction control data ((S1) + 1).
Or, it can be checked by reading the 'data transmission result' (Un\G599/615).
For details on how to check the error code contents and corrective actions, refer to the following section.
'CH Error occurrence' (XE/XF) turns OFF when the data transmission/reception processing is performed normally.
Confirmation using the module and Engineering tool
■
Confirmation using the indicator LED
When C24 detects an error, including a reception error, the ERR LED turns ON.
■
Confirmation using Engineering tool
Monitor the 'data transmission result' (Un\G599/615) to check the error code.
106
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.2 Transmitting Data to Target Device
4.3
Processing when Simultaneous Transmission is
Performed during Full-Duplex Communications
This section explains the processing when simultaneous transmission is performed during full-duplex communications.
Processing when simultaneous transmissions occur
The following explains the processing by C24 when the target device and C24 transmit data at the same time during data communications using the bidirectional protocol.
Note that transmission from a target device and from C24 are not performed simultaneously for data communication by halfduplex communications. (
Page 275 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS)
The processing on the C24 side differs depending on the settings with Engineering tool when transmission from a target device and C24 is performed at the same time.
Set "Send data enable/disable" and "Receive data enable/disable" to "Enable" or 'Disable" with Engineering tool.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
The setting value for "Send data enable/disable" and "Receive data enable/disable" is stored in the following area on the buffer memory.
For processing of transmitted/received data on the C24 side for each setting of the 'simultaneous transmitted data valid/invalid designation' (Un\G155/315), refer to the "Processing of transmitted/received data when simultaneous transmission occur".
Setting contents with
Engineering tool
Value stored to buffer memory
(Un\G155/315)
Send data enable/disable:
Enable
Receive data enable/disable:
Enable
Send data enable/disable:
Disable
Receive data enable/disable:
Enable
Send data enable/disable:
Enable
Receive data enable/disable:
Disable
Send data enable/disable:
Disable
Receive data enable/disable:
Disable
0000H
0100H
0001H
0101H
C24 processing contents
Processing related to message transmission
Waits to receive the response message( -
2) while checking time-out after data transmission ( -1) is complete.
Notifies normal completion or abnormal completion according to whether or not the response message is received to the CPU module via the buffer memory.
Notifies a simultaneous transmission error to the CPU module via the buffer memory after data transmission( -1).
Does not wait for a response massage ( -2) in reply to data transmission ( -1).
Waits to receive the response message ( -
2) while checking time-out after data transmission ( -1) is complete.
Notifies normal completion or abnormal completion according to whether or not the response message is received to the CPU module via the buffer memory.
Notifies a simultaneous transmission error to the CPU module via the buffer memory after data transmission( -1).
Does not wait for a response massage ( -2) in reply to data transmission ( -1).
Processing related to massage reception
Transmits a response message ( -2) after data reception ( -1) is complete.
Notifies the received data and reception result to the CPU module via the buffer memory.
Transmits a response message ( -2) after data reception ( -1) is completed.
Notifies the received data and reception result to the CPU module via the buffer memory.
Ignores data reception ( -1) and discards the received data. Does not transmit a response message ( -2).
Does not inform the CPU module that data was received.
Ignores data reception ( -1) and discards the received data. Does not transmit a response message ( -2).
Does not inform the CPU module that data was received.
( ● -m) is the number showing the correspondence with the messages in the figures below.
Page 108 Processing of transmitted/received data when simultaneous transmissions occur
4
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.3 Processing when Simultaneous Transmission is Performed during Full-Duplex Communications
107
Processing of transmitted/received data when simultaneous transmissions occur
The following shows the C24 communication data processing based on the settings of 'Send data' and 'Receive data' with
Engineering tool by using the examples.
For details on the time check timer 1 (response monitoring time) shown in the figures, refer to the following section.
Page 263 Response Monitoring Time (timer 1) Setting
Send data: Enable, Receive data: Enable
Target device
Ó
-1
E
N
Q
Arbitrary data
Sum check code
Ò
-2
A
C
K
C24
E
N
Q
Ò
-1
Arbitrary data
Send data: Disable, Receive data: Disable
Ó
-1
Target device
E
N
Q
Arbitrary data
C24
E
N
Q
Ò
-1
Arbitrary data
Send data: Enable, Receive data: Disable
Ó -1
E
N
Q
Arbitrary data
Target device
Sum check code
Sum check code
Sum check code
Sum check code
Time check
(timer 1)
A
C
K
Ó
-2
A
C
K
Ignores the received data of
Ò
-1.
(Simultaneous transmission error occurred.)
Ó
-2
Ò -2
A
C
K
Ignores the received data of
Ó
-1.
C24 E
N
Q
Ò
-1
Arbitrary data
Send data: Disable, Receive data: Disable
Ó -1
E
N
Q
Arbitrary data
Target device
Sum check code
Time check
(timer 1)
Sum check code
C24
E
N
Q
Ò -1
Arbitrary data
Sum check code
Ignores the received data of Ò -1.
Simultaneous transmission error occurred.
Ignores the received data of
Ó
-1.
108
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.3 Processing when Simultaneous Transmission is Performed during Full-Duplex Communications
When the transmission control is performed with "Send data" set to "Enable" and "Receive data" set to
"Enable", C24 performs message transmission and message reception processing as described below.
(
Page 271 Control Contents of DC Code Control)
During message transmission processing, time check by timer 1 (response monitoring time) is performed.
● Message transmission ( -1 in the figure)
• When C24 receives a transmission terminate request (receiving DC3/DR(DSR) signal OFF) from the target device during message transmission, C24 terminates data transmission.
• When the C24 receives a reception available signal (receiving DC1/DR(DSR) signal ON), C24 restarts data transmission.
● Message reception
• If C24 cannot send a response message to the target device in response to message reception because the target device issued a transmission terminate request (receiving DC3/DR(DSR) signal OFF), C24 transmits the response message after it's in the data transmission available state (receiving DC1/DR(DSR) signal
ON).
4
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.3 Processing when Simultaneous Transmission is Performed during Full-Duplex Communications
109
4.4
Considerations for Data Communication
The following describes the considerations for data communications using the bidirectional protocol.
Factor of C24 transmission sequence initialization
The initial status means the status where transmission has stopped and received data has been discarded.
C24 transmission sequence initialization factors are as follows.
• When the power is turned ON, the CPU module is reset, or the mode is switched.
• When a response message (ACK, NAK, etc.) was received in reply to data transmission.
• When a response message (ACK, NAK, etc.) was transmitted in reply to data reception.
Data transmission procedure
As a data transmission procedure, data transmission from the target device or C24 should be performed after a response message for the immediately preceding data transmission has been received.
Units of data length (word/byte) in message to be transmitted/received
Specify the same units of data length (words/bytes) of the messages to be transmitted/received between a target device and the CPU module.
The word/byte units designation can be set with Engineering tool for the CPU module.
Make the length of the data portion in the message to be transmitted and received as long as the size of the send data specification area and the receive data storage area, or less.
NAK code response
■
Response from C24 to target device
After the completion of error detection message reception, it transmits the NAK code to the target device.
■
Response from target device to C24
Transmit the error code (0022H to 005FH) immediately after the NAK response.
• Perform error processing according to the error code received immediately after the NAK message at the device that received NAK as the response message after data transmission.
For more details on error codes that are transmitted from C24, refer to the following section.
(
• If C24 receives an NAK response while transmitting data to a target device, it completes data transmission, then reads the NAK to complete the processing abnormally.
• If C24 detects an error while receiving data, it ignores the received data equivalent to the data length.
If the data length is abnormal, C24 ignores all the data up to the head data for reception message (ENQ, etc.) received thereafter.
Target device time-out check
When checking time-out up to reception of the response message at the target device during data transmission from the target device to C24, set the timeout time to the time shown below, or longer.
• (CPU module maximum scan time 2) + 100 ms
110
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.4 Considerations for Data Communication
Framing error on the target device side
While nothing is being transmitted from C24 to the target device though the RS-422/485 interface, a framing error may be generated in the target device.
Make the target device skip the data up to transmission of the head data (ENQ, NAK, etc.) of the message from C24.
Before communicating data through the RS-422/485 interface, check the interface specifications on the C24 side.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
Data bit settings
When adding a sum check code to a message, set "Data bit" to "8".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
4
4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
4.4 Considerations for Data Communication
111
5
DATA COMMUNICATION USING MODBUS
Data can be sent and received between a master and a slave by using a MODBUS data format.
For sending and receiving data in a redundant system, refer to the following section.
Page 624 Using MODBUS in a Redundant System
5.1
MODBUS Master Function
C24 communicates with MODBUS slave devices as a master station by using the following function.
Function Description
Communication with predefined protocol
Selects MODBUS from the predefined protocol library and executes the protocol with a dedicated instruction.
Simple CPU communication function Issues a request message for reading/writing to a MODBUS slave device automatically.
Reference
Page 30 DATA COMMUNICATION USING
Page 120 Communication with a MODBUS
(1)
Request message
(2)
Response message
(1) C24
(2) MODBUS slave device
5.2
MODBUS Slave Function
C24 supports the MODBUS slave function and can communicate with MODBUS master devices.
(1) (2) Request message
Response message
(1) MODBUS master device
(2) C24
The following functions are available:
Function
Automatic response function
MODBUS device assignment function
Description
Automatically performs processing corresponding to the function code in a request message received from a MODBUS master device, and automatically sends a response message.
Converts access to MODBUS devices into access to devices of a programmable controller CPU.
Reference
Page 113 Automatic response function
Page 114 MODBUS device assignment function
112
5 DATA COMMUNICATION USING MODBUS
5.1 MODBUS Master Function
Automatic response function
The automatic response function enables C24s to automatically perform corresponding processing according to the function code in a request message received from a MODBUS master device, and automatically send a response message to it.
No programs are required for sending response messages on the C24 side.
This function uses the MODBUS device assignment function. For details, refer to the following section.
Page 114 MODBUS device assignment function
CPU module C24
MODBUS master device
Ò
Request message (function code)
Ó
5
Device memory Ô
Õ
A request message is received.
The function code is determined.
The corresponding processing is performed.
A response message is sent.
Response message
5 DATA COMMUNICATION USING MODBUS
5.2 MODBUS Slave Function
113
MODBUS device assignment function
The MODBUS device assignment function automatically converts access to MODBUS devices of a slave into access to devices of a CPU module.
MODBUS devices can be associated with device memories of a CPU module with MODBUS device assignment parameters.
This enables C24s to convert access to MODBUS devices specified in a request message by MODBUS master devices into access to the corresponding devices of a CPU module and access them.
Associating MODBUS devices with device memories of a programmable controller CPU
When a request message such as 'write coil' is received from a master, access to MODBUS devices is automatically converted into access to devices of a CPU module.
CPU module C24 MODBUS master device
Device memory
MODBUS device allocation parameter
Device memory MODBUS device
D300 1234H
D299
D300
D301
400499
400500
400501
(1)
(1) Request message (request to write 1234H to the holding register 400500)
If specifying a device not supported by a CPU module or a device number out of range, an exception code
(04) is returned in a response message and 4031H (device specification error) is stored in the detailed error code of 'error log' (Un\G31998 to 32255) in 'MODBUS operating status.'
Specifying the error status read device
Specify data to be read as an error status by a slave (C24) when the read exception status (FC: 07) is received from a
MODBUS master device.
CPU module MODBUS master device
Device memory
C24
Error status read device specification
Device memory
M100
M107
01H M100 M107 Exception status (1)
(2)
(1) Request message (read exception status (FC: 07))
(2) Response message (exception status 01H)
Values of devices specified in 'error status read device' (Un\G28682 to 28685) are stored in a response message.
114
5 DATA COMMUNICATION USING MODBUS
5.2 MODBUS Slave Function
Specifying an access target
Specify an access target when a C24 is connected to a CC-Link IE Field Network remote head module.
A CC-Link IE Field Network remote head module or CC-Link IE Field Network master station can be selected as an access target.
When selecting a master station, the current master station is accessed.
Precautions
An access target can be specified in a C24 the firmware version of which is '13' or later when the C24 is connected to a CC-
Link IE Field Network remote head module. For a C24 the firmware version of which is '12' or earlier, only a CC-Link IE Field
Network remote head module can be specified as an access target.
Specifying a CPU response monitoring timer
Specify the timer so that a C24 will monitor the processing of an access target CPU.
If an error occurs in an access target CPU module and a response message cannot be sent, a response message (error completion) can be sent after the elapse of a specified time.
This can release the state in which a master waits for a response message.
Setting method
Set MODBUS device assignment in "MODBUS slave setting" of the parameter.
For details, refer to the following section.
Page 465 MODBUS slave settings
5.3
Interlink Function
For using the interlink function in a MODBUS slave, refer to the following chapter.
Page 429 INDEPENDENT/LINKED OPERATION OF INTERFACE
5.4
MODBUS Devices
The following table shows the MODBUS devices supported by a C24.
MODBUS device type
Coil
Input
Input register
Holding register
Extended file register
Unit
Bit
Bit
Word
Word
Word
Read/write
Read/write
Read
Read
Read/write
Read/write
Number of access points
65536 points
65536 points
65536 points
65536 points
MODBUS device No.
1 to 65536
100001 to 165536
300001 to 365536
400001 to 465536
Device number: 600000 to 609999
*1 For the CPU module, read-only memories cannot be set in the file register.
*2 The maximum values of the number of access points and the file number for the extended file register depend on the size of the file register (ZR) set in the CPU module. (
Page 469 MODBUS extended file register assignment)
*3 The number of access points for the extended file register is the maximum size that can be set in the CPU module (when the R120CPU
+ NZ2MC-16MBS are mounted).
5.5
Frame Specifications
Frame specifications comply with the specifications of MODBUS protocol.
Frames in RTU mode and ASCII mode can be used.
A frame mode can be selected in "Communication protocol setting" in the module parameter.
For details on the frames, refer to the following manual.
MELSEC iQ-R MODBUS and MODBUS/TCP Reference Manual
5
5 DATA COMMUNICATION USING MODBUS
5.3 Interlink Function
115
5.6
Function List
11 (0BH)
12 (0CH)
15 (0FH)
16 (10H)
17 (11H)
20 (14H)
21 (15H)
22 (16H)
23 (17H)
The following table shows the MODBUS standard functions that can be executed from a MODBUS master device to a C24.
The numbers in the following table show the following:
• (1) For broadcast
• (2) For accessing modules other than CC-Link IE Field Network remote head modules
• (3) For accessing CC-Link IE Field Network remote head modules
Executable: , Executable (with restrictions): , Not executable:
Function code (FC)
(DEC (HEX))
Sub-function code
(DEC (HEX))
Function name (1) (2) (3)
01 (01H)
02 (02H)
03 (03H)
04 (04H)
05 (05H)
06 (06H)
07 (07H)
08 (08H)
06 (06H)
06 (06H)
Sub code
(SC)
(DEC (HEX))
14 (0EH)
15 (0FH)
16 (10H)
17 (11H)
18 (12H)
19 (13H)
20 (14H)
01 (01H)
02 (02H)
03 (03H)
04 (04H)
10 (0AH)
11 (0BH)
12 (0CH)
13 (0DH)
00 (00H)
Read coils
Read discrete inputs
Read holding registers
Read input registers
Write single coil
Write single register
Read exception status
Return query data
Restart communications option
Return diagnostic register
Change ASCII input delimiter
Force listen only mode
Clear counters and diagnostic register
Return bus message count
Return bus communication error count
Return bus exception error count
Return slave message count
Return slave no response count
Return slave NAK count
Return slave busy count
Return bus character overrun count
Return IOP overrun error count
Clear overrun counter and flag
Get communications event counter
Get communications event log
Write multiple coils
Write multiple registers
Report slave ID
Read file record
Write file record
Mask write register
Read/Write multiple registers
*1 Accessing MODBUS devices assigned to devices not supported by CC-Link IE Field Network remote head modules results in error completion. (Exception code: 04H)
116
5 DATA COMMUNICATION USING MODBUS
5.6 Function List
MODBUS standard function details
For details on the functions, refer to the following manual.
MELSEC iQ-R MODBUS and MODBUS/TCP Reference Manual
■
Buffer memories used for functions
The following table shows the buffer memories used for each function.
Application
Storage location of exception code and error code
Storage location of error information of the read exception status (FC:
07H)
• Data cleared with the restart communications option (FC: 08H (01H))
• Diagnostic register for the return diagnostic register (FC: 08H (02H))
• Diagnostic register for the clear counters and diagnostic register (FC:
08H (0AH))
Storage location of the change ASCII input delimiter (FC: 08H (03H))
Checking the force listen only mode (FC: 08H (04H))
Value returned with the return bus message count (FC: 08H (0BH))
Buffer memory
Error log
Error status read device
CH1/2 side exception code storage area in the buffer memory
CH1/2 side detailed LED status storage area in the buffer memory
2nd byte of end code
Communications mode
Bus message count
Value returned with the return bus communication error count (FC: 08H
(0CH))
Bus communication error count
Value returned with the return bus exception error count (FC: 08H (0DH)) Exception error count
Value returned with the return slave message count (FC: 08H (0EH))
Value returned with the return slave no response count (FC: 08H (0FH))
Value returned with the return slave NAK count (FC: 08H (10H))
Value returned with the return slave busy count (FC: 08H (11H))
• Value returned with the return bus character overrun count (FC: 08H
(12H))
• Value returned with the return IOP overrun error count (FC: 08H (13H))
Value returned with the get communications event counter (FC: 0BH)
Slave message count
Slave no-response count
Slave NAK count
(0000H is always returned.)
Slave busy count
(0000H is always returned.)
Character overrun count
Communications event count
Address
Dec (Hex)
CH1 CH2
32513
(7F01H)
32522
(7F0AH)
32518
(7F06H)
32519
(7F07H)
32520
(7F08H)
32521
(7F09H)
32514
(7F02H)
31998 to 32255
(7CFEH to 7DFFH)
28682 to 28685
(700AH to 700DH)
28674
(7002H)
28676
(7004H)
513
(0201H)
32524
(7F0CH)
32525
(7F0DH)
32512
(7F00H)
514
(0202H)
32588
(7F4CH)
32589
(7F4DH)
32576
(7F40H)
32577
(7F41H)
32586
(7F4AH)
32582
(7F46H)
32583
(7F47H)
32584
(7F48H)
32585
(7F49H)
32578
(7F42H)
Value returned with the get communications event log (FC: 0DH) Communications event log 1 to 64
32523
(7F0BH)
32544 to
32575
(7F20H to
7F3FH)
32587
(7F4BH)
32608 to
32639
(7F60H to
7F7FH)
5
5 DATA COMMUNICATION USING MODBUS
5.6 Function List
117
6
DATA COMMUNICATION IN SIMPLE CPU
COMMUNICATION
Data communications between specified devices can be performed at specified timings by configuring simple parameter settings for a C24 in an engineering tool. Data is sent to/received from a specified communication destination on a 1:1 or 1:n
(multi-drop connection) basis.
When using the simple CPU communication function, check the firmware versions of a C24. (
Communication pattern
Either of the following can be selected.
Item
Read
Write
Description
To read device data in a specified communication destination (transfer source) to a specified device of the host station (transfer destination).
To write specified device data in the host station (transfer source) to a device of a specified communication destination (transfer destination).
Communication setting
Either of the following can be selected.
Item
Fixed Interval
On Request
Description
To send and receive device data at a specified execution interval.
To send and receive device data only on request.
Communication destination
C24 can communicate with the following devices.
• MELSEC-A series CPU module (
Page 119 Communication with a MELSEC-A Series CPU)
• MODBUS slave device (
Page 120 Communication with a MODBUS Slave Device)
118
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.1
Communication with a MELSEC-A Series CPU
RJ71C24, RJ71C24-R2
RS-232
C24 can communicate data with the following MELSEC-A series CPU modules.
Type
An
AnN
AnA
A0J2H
AnS
AnSH
A2C
AnU
A2US
Model
A2CCPU
A1NCPU, A1NCPUP21, A1NCPUP21-S3, A1NCPUR21
A2NCPU, A2NCPU-S1, A2NCPUP21, A2NCPUP21-S1, A2NCPUP21-S3, A2NCPUP21-S4, A2NCPUR21, A2NCPUR21-S1
A3NCPU, A3NCPUP21, A3NCPUP21-S3, A3NCPUR21
A2ACPU, A2ACPU-S1, A2ACPUP21, A2ACPUP21-S1, A2ACPUP21-S3, A2ACPUP21-S4, A2ACPUR21, A2ACPUR21-S1
A3ACPU, A3ACPUP21, A3ACPUP21-S3, A3ACPUR21
A0J2HCPU, A0J2HCPU-DC24V, A0J2HCPUP21, A0J2HCPUR21
A1SCPUC24-R2
A1SHCPU, A1SJHCPU, A2SHCPU
A2CCPUC24, A2CCPUC24-PRF, A2CCPUP21, A2CCPUR21, A2CJCPU-S3
A2UCPU, A2UCPU-S1, A3UCPU, A4UCPU
A2USCPU, A2USHCPU-S1
Wiring
For this data communication, use an RS-232 interface of a C24 to connect to a communication destination.
Connect an RS-232 interface of a C24 and an RS-422 connector of a MELSEC-A series CPU with an RS-232/RS-422 conversion cable.
For connection, use a gender changer for a D-sub 9 pin between the interface and the cable.
Precautions
Only a connector of a MELSEC-A series CPU can be connected.
■
Number of connectable modules
Channel
CH1
CH2
RJ71C24
1
RJ71C24-R2
1
1
When using an RJ71C24-R2, both CH1 and CH2 can be connected.
RJ71C24-R4
Considerations for performing simple CPU communication
A bit device is read and written in one bit units and a word device in one word units. This may cause data inconsistency.
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.1 Communication with a MELSEC-A Series CPU
119
6.2
Communication with a MODBUS Slave Device
(1)
(2) (2)
(2)
(1) C24
(2) MODBUS slave device
C24 can communicate data with the following MODBUS slave devices.
• MODBUS slave (RTU)-compatible device
• MODBUS slave (ASCII)-compatible device
Wiring
Connect a C24 and a MODBUS slave device.
■
Number of connectable modules
Channel
CH1
CH2
RJ71C24
1
32
RJ71C24-R2
1
1
RJ71C24-R4
32
32
Considerations for performing simple CPU communication
• Data inconsistency may occur according to the frame specifications of MODBUS protocol.
• For data communication using RS-485 (2-wire type), set "Echo back enable/prohibit specification" to "Echo back prohibit."
(
Page 436 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT SPECIFICATION)
120
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.2 Communication with a MODBUS Slave Device
6.3
Data Communication Procedure
Data communication with a target device can be performed by the following procedure.
1.
Set a channel for each communication destination in "Basic Settings" in "Module Parameter."
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Basic Settings]
Item
Various control specification
Communication protocol setting
Communication speed setting
Transmission setting
Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Transmission control setting
Transmission control
MELSEC-A/AnS (CPU
COM)
Simple PLC communication
9600 bps
Independent (default)
8 bits
Yes
Odd (default)
1 (default)
DC code control
MODBUS (RTU) MODBUS (ASCII)
Select according to the communication destination.
8 bits 7 bits (default)
Select according to the communication destination.
Select according to the communication destination.
• Parity bit is set to "None": 2
• Parity bit is set to "Yes": 1 (default) or 2
DTR/DSR control (default)
Use the default values for the other settings.
2.
Set "Simple PLC Communication Setting" in "Module Extended Parameter."
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Extended Parameter] [Simple
PLC Communication Setting]
For details of the setting, refer to the following section.
Page 478 Simple CPU communication setting
3.
Write the settings to the CPU module with an engineering tool after the parameter setting is completed.
4.
Reset the CPU module or turn the power OFF and ON, then simple CPU communication starts.
6.4
Devices that can be Specified
A bit device and word device can be set at the same time for each setting number.
A bit device can be specified in units of 16 points and a word device in units of 1 point. Specify '0' or a multiple of 16 for the start device number of a bit device.
Communication destination
Host station
MELSEC-A/AnS (CPU COM)
MODBUS slave device
• MODBUS (RTU)
• MODBUS (ASCII)
Settable device
Bit
X, Y, M, L, B, SB, SM
X, Y, M, B
Coil, Input
Word
D, W, SW, SD, R, ZR, RD, G
D, W
Input Register, Holding Register
6
• The number of points per setting is up to 1024 words (bit: up to 8192 points, word: up to 512 points).
• Set a device of a module within the range specified in the parameter of a CPU module.
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.3 Data Communication Procedure
121
Device range
■
Host station
The following table lists the maximum numbers of points when an NZ2MC-16MBS is attached to an R120CPU. The number of points varies depending on the type of a CPU module to be used, whether to use an extended SRAM cassette, and its type.
Type
Bit device
Word device
Settable device
Symbol Range
SW
SD
R
ZR
SB
SM
D
W
RD
G
X
L
B
Y
M
0H to 2FFFH
0H to 2FFFH
0 to 161882111
0 to 32767
0H to 9A61FFFH
0H to 9A61FFFH
0 to 4095
0 to 10117631
0H to 9A61FFH
0H to 9A61FFFH
0 to 4095
0 to 32767
0 to 10027007
0 to 1048575
53248 to 57343
Remarks
Local devices cannot be specified.
Local devices cannot be specified.
Data is read and written according to the setting for a file register of a CPU module.
Data is read and written according to the setting for a file register of a CPU module.
• Buffer memory of a C24
• A G device is expressed as Un\G. The search for the device requires the search string to be prefixed by Un\G. When searching for a G device if a C24 is not mounted, U0\G is prefixed for the search. (An error for unmounted module is not detected.)
■
Communicating with a MELSEC-A/AnS (CPU COM)
The following table lists the maximum numbers of points of an A4UCPU. The number of points varies depending on the type of a CPU module to be used.
Type
Bit device
Word device
B
D
X
Y
M
Settable device
Symbol
W
Range Remarks
0H to 1FFFH
0H to 1FFFH
0 to 8191, 9000 to 9255
,
• For specifying 9000 to 9255 when "Write" is selected for the communication pattern, refer to the manual of a CPU module used.
• Specify a value obtained by adding a multiple of 16 to 9000 for 9000 to 9255.
0H to 1FFFH
0 to 8191, 9000 to 9255 For specifying 9000 to 9255 when "Write" is selected for the communication pattern, refer to the manual of a CPU module used.
0H to 1FFFH
■
Communicating with a MODBUS slave device
Devices that can be used differ depending on a MODBUS slave device. Refer to the manual of each device.
Set the number of points per setting for "Simple PLC Communication setting" in "Parameter" to be up to 1024 words (bit: up to
8192 points, word: up to 512 points).
Type
Bit
Word
Coil
Input
Input Register
Holding Register
Range
0 to 65535
0 to 65535
0 to 65535
0 to 65535
Remarks
Can be set only when "Communication Pattern" is "Read."
Can be set only when "Communication Pattern" is "Read."
122
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.4 Devices that can be Specified
6.5
Operations When Performing Simple CPU
Communication
This section explains the operations when performing simple CPU communication.
Operations when selecting "Fixed Interval" for the communication setting
Starting communication
Communication starts after a latency time elapses when turning the power OFF and ON or resetting a CPU module.
After resetting the CPU module, preparation processing is performed on the system side such as parameter setting check
(station numbers and the channel of the host station). If an error occurs in the processing, data is not sent and received.
■
Latency time
During a latency time, '1' (preparing) is stored in 'Communication status' for each setting number.
When the latency time elapses, 'Preparation completion for each setting number' (Un\G32768 to Un\G32799) turns from OFF to ON.
■
If an error occurs in preparation processing
'10' (communications impossible) is stored in 'Communication status' for each setting number, and an error is stored in 'Latest error code' for each setting number.
Normal operation
Ex.
The following shows a normal operation for setting No.1.
Data transmission Data transmission
Receive response
Data transmission
Receive response
Data transmission
Receive response
Time
Execution status flag for each setting number
(Un¥G32736.0)
OFF
Preparation completion for each setting number
(Un¥G32768.0)
OFF
ON
ON
Communication status
(Un¥G32876)
Latest error code
(Un¥G32892)
Exception code
(Un¥G32893)
Number of times for normal completion
(Un¥G32886 to Un¥G32887)
Execution interval [ms]
(current value)
(Un¥G32880 to Un¥G32881)
Execution interval Ò
0
0
Execution interval Ó
1
Current value Ò
3
0
0
Execution interval Ô
2
Current value Ó
Execution interval Õ
3
Current value Ô
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
123
• When sending data to a different communication destination during data communications on the same channel, send data after the data communications being executed are completed.
■
Storing an execution interval [ms] (current value)
An execution interval is stored in 'Execution interval [ms] (current value)' for each setting number when an execution interval set in the parameter elapses after the first response is received from a communication destination.
Operation when an error occurs
If there is no response from a communication destination or an error occurs (error response) after sending data to the communication destination, a retry is performed (data is resent) when a communication time-out period elapses.
A retry is performed for a time obtained by adding '1' to the number of retries set in the parameter.
During a retry, '5' (retry being executed) is stored in 'Communication status' for each setting number.
• A value in 'Execution interval [ms] (current value)' for each setting number is not updated during a retry.
• '3' (communicating) remains in 'Communication status' for another setting number for which the same communication destination is set.
If an error response is returned even after a retry, it is determined to be in an abnormal state and an error is stored in 'Latest error code' for each setting number.
Ex.
The following shows an operation when an error occurs in setting No.1 (two retries).
Data transmission Retry
First time
Retry
Second time
Error monitoring
(Data transmission)
Error monitoring
(Data transmission)
Data transmission
Time
Execution time Ó Execution time Ô
Execution time
Õ
Communication time-out period
Communication time-out period
Communication time-out period
Monitoring time at error
Monitoring time at error
Execution status flag for each setting number
(Un¥G32736.0)
ON
OFF
Communication status
(Un¥G32876)
Latest error code
(Un¥G32892)
Exception code
(Un¥G32893)
Number of retries
(Un¥G32890 to Un¥G32891)
Number of times for error completion
(Un¥G32888 to Un¥G32889)
Execution interval [ms]
(current value)
(Un¥G32880 to Un¥G32881)
3
0
0
0
0
1
5
Current value Ó
2
6
Error code
Exception code
1
3
Current value Ò
124
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
■
Operation in an abnormal state
'6' (monitoring at error) is stored in 'Communication status' for each setting number in an abnormal state, and communication is performed at an error monitoring time (low-speed cycle) set in the parameter.
If a response is received from a communication destination during error monitoring, the status returns to normal.
(Communication at an execution interval specified in the parameter)
After returning to the normal state, '3' (communicating) is stored in 'Communication status' for each setting number.
• A value in 'Execution interval [ms] (current value)' for each setting number is not updated in an abnormal state.
• If no response can be received from a communication destination, an error is stored in 'Latest error code' for each setting number.
• When an error response is received from a communication destination, an error is stored in 'Latest error code' for each setting number and the code of an abnormal response is stored in 'Exception code' for each setting number. (An exception code refers to a code returned from a target device (error code and end code).)
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
125
Request to stop and restart communication
When selecting "Fixed Interval" for the communication setting, communication can be stopped and restarted.
■
Stopping communication
To stop communication, turn 'Request to stop communication for each setting number' (Un\G32672 to Un\G32703) from OFF to ON when '3' (communicating), '5' (retry being executed), or '6' (monitoring at error) is stored in 'Communication status' for each setting number.
The communication stops at a communication timing of the next execution interval.
If there is no response from a communication destination while a stop request is accepted, communication stops after a communication time-out period elapses. During a retry, communication stops after the communication time-out period elapses regardless of the number of retries.
■
Restarting communication
To restart communication, turn 'Request to restart communication for each setting number' (Un\G32704 to Un\G32735) from
OFF to ON when '4' (communication stop) is stored in 'Communication status' for each setting number.
After the communication restarts, 'Request to restart communication for each setting number' (Un\G32704 to Un\G32735) turns from ON to OFF.
Ex.
The following shows an operation when stopping and restarting communication for setting No.1.
Stop request Stop communication Restart request Restart communication
Time
Execution interval Ò
Execution interval Ó
ON by the program
System is OFF
Execution interval Ô
Execution interval Õ
Communication stop request of each setting number
(Un¥G32672.0)
ON
OFF
Communication restart request of each setting number
(Un¥G32704.0)
ON
OFF
Execution status flag for each setting number
(Un¥G32736.0)
ON
OFF
Communication status
(Un¥G32876)
Latest error code
(Un¥G32892)
Exception code
(Un¥G32893)
Execution interval [ms]
(current value)
(Un¥G32880 to Un¥G32881)
3
Current value Ò
4
Error code
Exception code
0
ON by the program
System is OFF
3
Current value Ó
Values in 'Latest error code' and 'Exception code' are not cleared even if a request to stop or restart communication is sent. To clear them, turn the buffer memory 'Error clear request' from OFF to ON in a program and others.
126
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
■
Operation when restarting communication
An operation after restarting communication differs depending on a value in 'Communication status' before stopping the communication.
Operation after restarting communication Communication status before stopping communication
• Communicating
• Retry being executed
Monitoring at error
A fixed cycle communication is performed at an execution interval set in the parameter.
The communication restarts at the next execution interval after turning 'Request to restart communication for each setting number' (Un\G32704 to Un\G32735) from OFF to ON.
When restarting the communication, each buffer memory will be in the following states:
• 'Execution status flag for each setting number' (Un\G32736 to Un\G32767): ON
• 'Communication status' for each setting number: 3 (communicating)
• 'Execution interval [ms] (current value)' for each setting number: An execution interval is stored.
A fixed cycle communication is performed at an error monitoring time.
When restarting the communication, each buffer memory will be in the following states:
• 'Execution status flag for each setting number' (Un\G32736 to Un\G32767): ON
• 'Communication status' for each setting number: 6 (monitoring at error)
Precautions
• If a value other than '3' (communicating), '5' (retry being executed), or '6' (monitoring at error) is stored in 'Communication status' for each setting number, a request is ignored even when turning 'Request to stop communication for each setting number' (Un\G32672 to Un\G32703) from OFF to ON. In this case, turn it from ON to OFF.
• If a value other than '4' (communication stop) is stored in 'Communication status' for each setting number, a request is ignored even when turning 'Request to restart communication for each setting number' (Un\G32704 to Un\G32735) from
OFF to ON. In this case, turn it from ON to OFF.
• If the communication setting is not set or "On Request" is selected, a request is ignored even when turning 'Request to restart communication for each setting number' (Un\G32704 to Un\G32735) or 'Request to stop communication for each setting number' (Un\G32672 to Un\G32703) from OFF to ON. Therefore, they are not turned from ON to OFF by the system and remain ON.
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
127
Operations when selecting "On Request" for the communication setting
Starting communication
Communication starts by turning 'Request to start communication at request for each setting number' (Un\G32640 to
Un\G32671) from OFF to ON when a latency time elapses after turning the power OFF and ON or resetting a CPU module.
After resetting the CPU module, preparation processing is performed on the system side such as parameter setting check (station numbers and the channel of the host station). If an error occurs in the processing, data is not sent and received.
■
Latency time
During a latency time, '1' (preparing) is stored in 'Communication status' for each setting number.
When the latency time elapses, 'Preparation completion for each setting number' (Un\G32768 to Un\G32799) turns from OFF to ON.
■
If an error occurs in preparation processing
'10' (communications impossible) is stored in 'Communication status' for each setting number, and an error is stored in 'Latest error code' for each setting number.
Normal operation
Ex.
The following shows a normal operation for setting No.1.
Power ON and OFF,
Reset a CPU module
Start communication Stop communication
Data transmission
Receive response
Time
Initial processing Latency time
ON by the program
Request to start communication at request of each setting number
(Un¥G32640.0)
ON
OFF
Execution status flag for each setting number
(Un¥G32736.0)
ON
OFF
Preparation completion for each setting number
(Un¥G32768.0)
ON
OFF
Communication status
(Un¥G32876)
0 1
System is ON
2
System is ON
3
OFF by the program
System is OFF
2
Start communication Stop communication
Data transmission
Receive response
ON by the program
System is ON
3
System is OFF
OFF by the program
2
Latest error code
(Un¥G32892)
0
Exception code
(Un¥G32893)
0
Number of times for normal completion
(Un¥G32886 to Un¥G32887)
Execution interval [ms]
(current value)
(Un¥G32880 〜 Un¥G32881)
0
0
1 2
During a latency time, a request is ignored even when turning 'Request to start communication at request for each setting number' (Un\G32640 to Un\G32671) from OFF to ON.
When turning it from ON to OFF after data is sent or received, '2' (waiting for the request) is stored in 'Communication status' for each setting number and a single communication is completed.
128
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
• When 'Request to start communication at request for each setting number' (Un\G32640 to Un\G32671) turns from OFF to ON during preparation processing or a latency time on the system side, communication starts when 'Preparation completion for each setting number' turns ON and '2' (waiting for the request) is stored in 'Communication status' for each setting number.
• After it is detected that 'Request to start communication at request for each setting number' (Un\G32640 to
Un\G32671) has turned from OFF to ON, a request is ignored before '4' (communication stop) is stored in
'Execution status' for each setting number even when turning 'Request to start communication at request for each setting number' (Un\G32640 to Un\G32671) from ON to OFF and ON again in a program and others.
(No error occurs.)
Operation when an error occurs
If there is no response from a communication destination or an error occurs (error response) after sending data to the communication destination, a retry is performed (data is resent) when a communication time-out period elapses.
A retry is performed for a time obtained by adding '1' to the number of retries set in the parameter.
During a retry, '5' (retry being executed) is stored in 'Communication status' for each setting number.
If an error response is returned even after a retry, it is determined to be in an abnormal state and an error is stored in 'Latest error code' for each setting number.
Ex.
The following shows an operation when an error occurs in setting No.1 (two retries).
Request to start communication at request for each setting number
(Un¥G32640.0)
Execution status flag for each setting number
(Un¥G32736.0)
ON
OFF
ON
OFF
Communication status
(Un¥G32876)
Latest error code
(Un¥G32892)
Exception code
(Un¥G32893)
Time
Power ON and OFF,
Reset a CPU module
Start communication
Data transmission
Retry
First time
Communication time-out period
ON by the program
Retry
Second time
Communication time-out period
Power ON and OFF,
Reset a CPU module
Stop communication
Communication time-out period
2 3
0
0
5
OFF by the program
2
Power ON and OFF,
Reset a CPU module
Start communication
Data transmission
Error code
Exception code
ON by the program
3
Number of retries
(Un¥G32890 to Un¥G32891)
0 1 2
Number of times for error completion
(Un¥G32888 to Un¥G32889)
Execution interval [ms]
(current value)
(Un¥G32880 to Un¥G32881)
0
0
1
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
129
■
Operation in an abnormal state
In an abnormal state, '4' (communication stop) is stored in 'Execution status' for each setting number. Therefore, when turning
'Request to start communication at request for each setting number' (Un\G32640 to Un\G32671) from ON to OFF in a program and others, '2' (waiting for the request) is stored in 'Communication status' for each setting number.
• In an abnormal state, '2' (waiting for the request) remains in 'Communication status' for another setting number for which the same communication destination is set.
• If no response can be received from a communication destination, an error is stored in 'Latest error code' for each setting number.
• When an error response is received from a communication destination, an error is stored in 'Latest error code' for each setting number and the code of an abnormal response is stored in 'Exception code' for each setting number. (An exception code refers to a code returned from a target device (error code and end code).)
130
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
Broadcast operation
When "Station No." is set to '0' in the "Communication Destination Setting" screen (in the "Simple PLC Communication
Setting" screen of "Module Extended Parameter"), broadcast to MODBUS slave devices can be performed. (
Host station channel number, station number)
When broadcasting to MODBUS slave devices, the communication time-out period set in the parameter operates as the broadcast delay.
After sending data, a normal completion is established by timeout for the broadcast delay (communication time-out period), and the processing is repeated.
Broadcast is sent to all slave stations; therefore, consider each processing time of all slave devices and set the sufficient time for communication time-out period (broadcast delay).
If there is a slave device the communication time-out period of which is set insufficiently, an error may occur for another request to the slave device.
Normal operation
Ex.
The following shows a normal operation for setting No.1.
Data transmission Data transmission Data transmission Data transmission
Time
ON
Broadcast delay
(Communication Time-out Period)
Broadcast delay
(Communication Time-out Period)
Broadcast delay
(Communication Time-out Period)
Execution status flag for each setting number
(Un¥G32736.0)
OFF
Preparation completion for each setting number
(Un¥G32768.0)
OFF
ON
Communication status
(Un¥G32876)
3
Latest error code
(Un¥G32892)
0
Exception code
(Un¥G32893)
Number of times for normal completion
(Un¥G32886 to Un¥G32887)
Execution interval [ms]
(current value)
(Un¥G32880 to Un¥G32881)
1
Current value
Ò
0
2
Current value
Ó
1 3
Current value
Ô
■
Storing an execution interval [ms] (current value)
An execution interval is stored in 'Execution interval [ms] (current value)' for each setting number after normal completion.
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.5 Operations When Performing Simple CPU Communication
131
6.6
Checking Simple CPU Communication Status
The status of simple CPU communication can be checked in the buffer memory.
Values in the buffer memory are all cleared when switching a CPU module from STOP to RUN after changing module extended parameters and writing them to the CPU module.
Item
Request to start communication at request for each setting number
Address
Un\G32640 to Un\G32671
Request to stop communication for each setting number
Request to restart communication for each setting number
Execution status flag for each setting number
Preparation completion for each setting number
Un\G32672 to Un\G32703
Un\G32704 to Un\G32735
Un\G32736 to Un\G32767
Un\G32768 to Un\G32799
Description
For 512 settings (1 bit per setting)
• ON: Requested
• OFF: Not requested
For 512 settings (1 bit per setting)
• ON: Requested
• OFF: Not requested
For 512 settings (1 bit per setting)
• ON: Requested
• OFF: Not requested
For 512 settings (1 bit per setting)
• ON: Communicating
• OFF: Communication stop
For 512 settings (1 bit per setting)
• ON: Ready
• OFF: Not ready
132
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.6 Checking Simple CPU Communication Status
Item
Simple CPU communication diagnostic information
Setting status of each setting number
Number of settings
Error clear request
Setting No.1 diagnostic
Setting No.
Communication pattern
Communication setting
Communication destination
Communication status
Station number
Address
Un\G32832 to Un\G32863
Un\G32864
Un\G32865
Un\G32872
Un\G32873
Un\G32874
Un\G32875
Un\G32876
Un\G32877
Host station CH number Un\G32878
Description
For 512 settings (1 bit per setting)
• ON: Set
• OFF: Not set
• 0: No diagnostic information
• 1 to 512: Number of diagnostic information settings
• 0: Not requested
• 1: Requested
1 to 512: Each setting No.
• 0: Read
• 1: Write
• 0: On request
• 1: Fixed interval
10H: MELSEC-A/AnS (CPU COM)
11H: MODBUS (RTU)
12H: MODBUS (ASCII)
• 0: Not set
• 1: Preparing
• 2: Waiting for the request
• 3: Communicating
• 5: Retry being executed
• 6: Monitoring at error
• 10: Communications impossible
FFFH: Not specified
Communicating with a MODBUS (RTU) or a MODBUS (ASCII)
• 0: Broadcast
• 1 to 247: Station number
• 0: CH1
• 1: CH2
Target PLC number Un\G32879 • 0: Not specified
• 1 to n: CPU No.1 to CPU No.n
0 to 4294967295 Execution interval [ms]
(current value)
Execution interval [ms]
(maximum value)
Execution interval [ms]
(minimum value)
Un\G32880 to Un\G32881
Un\G32882 to Un\G32883
Un\G32884 to Un\G32885
Number of times for normal completion
Number of times for abnormal completion
Number of retries
Latest error code
Un\G32886 to Un\G32887
Un\G32888 to Un\G32889
Un\G32890 to Un\G32891
Un\G32892
• 0H: No error codes
• 1H to 7FFFH: Error code
Un\G32893
Un\G32894 to Un\G32895
Un\G32896 to Un\G45159
0H to FFFFH: Response code of a communication destination
System area
Setting No.2 to No.512 diagnostic information *1
Same as setting No.1 diagnostic information
*1 Enabled when the corresponding setting number in 'Setting status of each setting number' (Un\G32832 to Un\G32863) is ON.
*2 Stored only when selecting "On Request" for the communication setting.
*3 Stored only when selecting "Fixed Interval" for the communication setting.
*4 A selectable CPU number differs depending on the communication destination.
*5 When the maximum value is exceeded, counting continues from 1.
*6 When 'Error clear request' (Un\G32865) turns ON, values stored in 'Latest error code' (Un\G32892) and 'Exception code' (Un\G32893) are cleared. Then, 'Error clear request' (Un\G32865) turns OFF.
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.6 Checking Simple CPU Communication Status
133
Exception codes
The following table lists the exception codes returned from a communication destination when communication fails.
Communicating with a MELSEC-A/AnS (CPU COM)
Description Exception code
1H
Item
Busy Processing failed because the CPU module was busy.
4H
5H
6H
1BH
Cancellation of processing
Sum check error
Busy
Busy
Corrective action
New processing was requested during processing.
The received sum value and the calculated one did not match.
Processing failed because the CPU module was busy.
Processing failed because the CPU module was busy.
• Restart data communications.
• Increase the execution interval.
• If an error occurs in a MELSEC-A series CPU, take the corrective actions.
• Increase the communication time-out period.
• If an error occurs in a MELSEC-A series CPU, take the corrective actions.
• Review the cable connection and wiring.
• Take measures against noise.
• Restart data communications.
• Increase the execution interval.
• If an error occurs in a MELSEC-A series CPU, take the corrective actions.
• Restart data communications.
• Increase the execution interval.
• If an error occurs in a MELSEC-A series CPU, take the corrective actions.
Communicating with a MODBUS slave device
For exception codes from a MODBUS slave device, refer to the following section.
Page 543 MODBUS Exception Code List
134
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.6 Checking Simple CPU Communication Status
6.7
Communication Example
This section shows an example of transferring B0 to B1FFF and W0 to W1FF of the host station to M0 to M8191 and D0 to
D511 of a communication destination respectively by using the simple CPU communication function.
System configuration
(1) (2)
RS-232
(1) Host station (transfer source)
(2) Communication destination (transfer destination)
Device assignment
The following shows assignment of devices sent and received in simple CPU communication.
(1) (2)
R04CPU RJ71C24
B0
A/AnS CPU
M0
B1FFF
W0
W1FF
M8191
D0
D511
6
(1) Host station (transfer source)
(2) Communication destination (transfer destination)
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.7 Communication Example
135
Parameter setting
The following shows the procedure for connecting an engineering tool to a CPU module and setting parameters.
■
Setting for the host station (transfer source)
Operating procedure
1.
Set the CPU module as follows:
[Project] [New]
2.
Click the [Setting Change] button to set to use module labels.
3.
Click the [OK] button to add module labels of the CPU module.
4.
Set the RJ71C24 as follows:
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
5.
Click the [OK] button to add module labels of the RJ71C24.
136
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.7 Communication Example
6.
Set the items in "Basic Settings" as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Basic Settings]
[Various control specification] [Communication protocol setting]
7.
Set the items in "Module Extended Parameter" as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Extended Parameter] [Simple
PLC Communication Setting]
6
A setting screen appears by double-clicking any one of the following in the "Simple PLC Communication Setting" screen.
• "Latency Time"
• "Simple PLC Communication Setting No.1" to "Simple PLC Communication Setting No.512"
8.
Set the items in "Simple PLC Communication Setting" as follows:
9.
Write the set parameters to the CPU module, and reset the CPU module or turn the power OFF and ON.
[Online] [Write to PLC]
The default settings are used for parameters other than the above in a program example. For the parameters, refer to the following chapter. (
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.7 Communication Example
137
Program examples
The following shows examples of programs written to a transfer source CPU module.
■
Communication on request
The following shows an example of storing ABCDH and 5555H in a bit device and word device respectively and transferring them, when selecting "On Request" for the communication setting.
Category
Module label
Label name
C24_1.bnSts_Start_Request_SimplePLC_D[1]
C24_1.bnSts_Status_Flag_SimplePLC_D[1]
C24_1.bnReady_SimplePLC_D[1]
C24_1.stnSimplePLC_Diag[1].wStatus_D
C24_1.stnSimplePLC_Diag[1].uErrorCode_D
Description
Request to start communication at request for simple
CPU communication setting No.1
Execution status flag for simple CPU communication setting No.1
Preparation completion flag for simple CPU communication setting No.1
Communication status storage location of simple CPU communication setting No.1
Error code storage location of simple CPU communication setting No.1
Device
Un\G32640.0
Un\G32736.0
Un\G32768.0
Un\G32876
Un\G32892
Label to be defined Define the global label as shown below.
138
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.7 Communication Example
■
Stopping and restarting communication
The following shows an example of stopping and restarting communication, when selecting "Fixed Interval" for the communication setting.
Category
Module label
Label name
C24_1.bnSts_Stop_Request_SimplePLC_D[1]
C24_1.bnSts_Restart_Request_SimplePLC_D[1]
C24_1.bnSts_Status_Flag_SimplePLC_D[1]
C24_1.stnSimplePLC_Diag [1].wStatus_D
Description
Request to stop communication for simple CPU communication setting No.1
Request to restart communication for simple CPU communication setting No.1
Execution status flag for simple CPU communication setting No.1
Communication status storage location of simple CPU communication setting No.1
Device
Un\G32672.0
Un\G32704.0
Un\G32736.0
Un\G32876
Label to be defined Define the global label as shown below.
• To stop communication
6
• To restart communication
■
Clearing errors
The latest error code in the buffer memory can be cleared.
Category
Module label
Label name
C24_1.wErrorClear_SimplePLC_Diag_D
C24_1.stnSimplePLC_Diag[1].uErrorCode_D
Description
Error clear request for simple CPU communication setting
Error code storage location of simple CPU communication setting No.1
Label to be defined Define the global label as shown below.
Device
Un\G32865
Un\G32892
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.7 Communication Example
139
6.8
Considerations
This section shows the considerations for using this data communication.
Setting an execution interval
The execution interval of the simple CPU communication function and the time to complete communication vary depending on the load rate of the line, scan time of a communication destination, and system configuration; therefore, a set interval and time may be extended.
■
Causes of a long execution interval of the simple CPU communication function
• The scan time of the control CPU module of a C24 with the simple CPU communication function set is long.
• The load on the line is high.
• There are many settings in "Simple PLC Communication Setting."
• A response from a communication destination is slow.
• Multiple C24s with the simple CPU communication function set are mounted on a base unit (main base unit and extension base unit).
Set a sufficient execution interval to perform communication at the set execution interval. Check an execution interval in the buffer memory by actually performing communication if necessary.
Devices of a communication destination
Check the types and ranges of read/write devices of a communication destination.
When selecting "Write" for "Communication Pattern," control data of a communication destination may be rewritten, which may cause a malfunction.
Security
If a remote password is set for a communication destination, simple CPU communication cannot be performed.
Remove the remote password.
Using devices of the host station
When using devices of the host station, be sure to assign devices within the setting range.
Otherwise, data in another device is read or written.
Corrective action if an error occurs during communication
If an error occurs during communication, data may not be written normally.
Check the error and take a corrective action, then perform the communication again.
Data inconsistency
Data in a setting is divided to send and receive depending on the communication destination.
This may cause data inconsistency.
Clearing an error
A value in 'Latest error code' for each setting number is not cleared even after the communication status returns to normal.
To clear an error, turn 'Error clear request' (Un\G32865) from OFF to ON.
140
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.8 Considerations
Writing data to the buffer memory
Do not write data to 'RS and DTR signal status designation' when performing simple CPU communication.
Otherwise, communication may fail and an error such as a timeout may occur.
Reconnection
When disconnecting and reconnecting the cable, note the following:
• If "Fixed Interval" is selected for the communication setting, connect the cable when '4' (communication stop) or '6'
(monitoring at error) is stored in 'Communication status' for each setting number.
• If "On Request" is selected for the communication setting, connect the cable when '2' (waiting for the request) is stored in
'Communication status' for each setting number.
6
6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
6.8 Considerations
141
7
DEBUG SUPPORT FUNCTION
The debug support function is designed to support the debugging of communication processing between C24 and target device. The following functions are available to ease system startup work.
• Circuit trace
• Protocol execution log storage function (for predefined protocol only)
7.1
Circuit Trace
The communication data and communication control signal between C24 and target device are traced.
Send/receive packet data and communication control signal states
Stored in the buffer memory.
C24 buffer memory
Data are stored.
Data are read from the buffer memory.
Trace data are displayed.
Receive
Data
Data
Send
Procedure for the circuit trace
The following shows the procedure for the circuit trace.
Operating procedure
1.
Start circuit trace from Engineering tool.
2.
Perform communications with the target device.
3.
Stop circuit trace in Engineering tool.
4.
Circuit trace results are displayed.
5.
Confirm the send/receive packet data and communication control signal.
Engineering tool
142
7 DEBUG SUPPORT FUNCTION
7.1 Circuit Trace
Performing circuit trace
The trace data is stored in the monitor buffer to trace the communication data and communication control signal status.
Operating procedure
1.
Select [Tool] [Circuit Trace] in Engineering tool.
2.
Click the [Module Selection] button to select the module to be traced in the "Module Selection (Circuit Trace)" screen.
3.
Select the channel to be traced from "Channel Selection", and click the [Start Trace] button.
4.
When the monitor buffer is full, or the [Stop Trace] button is clicked, the trace data are displayed.
5.
Confirm the send/receive packets and communication control signals from the displayed trace result.
Window
7
7 DEBUG SUPPORT FUNCTION
7.1 Circuit Trace
143
Displayed items
Item
Trace Result Currently Displayed Data
[Open Trace File] button
[Save Trace File] button
[Close] button
[Find] button
Send/Receive Packet
Communication control signals
Display/setting content
Displays the model name, measurement time, and extraction date/time of the module on which the circuit trace is executed.
Searches the trace data.
Select the display format of the send/receive packets.
The hexadecimal or ASCII code can be selected.
The RS(RTS), ER(DTR), DR(DSR), CS(CTS), and CD(DCD) signal status and reception error are displayed as described below.
■ RS, ER, DSR, CS, and CD signals
All signals are displayed with blue lines .
When signal is ON:
When signal is OFF:
When the obtained data does not have signal information, the signal is displayed as an OFF status.
■ Reception Error
Three different errors of overrun error, parity error, and framing error are displayed.
Overrun error: (Green)
Parity error : (Light Blue)
Framing error: (Purple)
Reads and displays the trace data saved in a personal computer.
Saves the trace data obtained by the circuit trace to a personal computer.
Closes the Circuit Trace screen.
Circuit trace option setting
In the circuit trace option setting, the following two items can be set.
• Setting a start address and size of buffer area of C24 in which circuit trace data is stored (hereinafter, 'monitor buffer area')
• Setting whether the circuit trace is stopped or continued when the timer 0 error occurs
Operating procedure
1.
Select [Tool] [Circuit Trace] in Engineering tool.
2.
Click the [Options] button.
144
7 DEBUG SUPPORT FUNCTION
7.1 Circuit Trace
3.
On the "Circuit Trace Option" screen, set "Start Address", "Size", and "Stop Setting" of the buffer memory of C24, and click the [OK] button.
Displayed items
Item
Circuit Trade Data
Storage Area
Setting
Start Address
Size
Display/Setting content
Set the start address of the C24 buffer memory.
Input the setting in hexadecimal.
■ Input range
CH1/CH2: 2600H to 3FFDH (C00H to 1AFDH for the user setting area)
Set the size of the C24 buffer memory.
Input the setting in hexadecimal.
■ Input range
CH1/CH2: 3 to 1A00 words (3 to F00 words for the user setting area)
Set the maximum address
*1 for the trace data storage area to be in the range between 2602H to
3FFFH (C02H to 1AFFH for the user setting area). Note that the range of this value is checked at start of the circuit trace when using the user setting area.
Set whether or not the circuit trace is stopped when the timer 0 timeout error occurs.
Stop Setting Stop by occurrence of timer 0 timeout error
*1 The maximum address for the trace data storage area is calculated by the following formula.
Maximum address for the trace data storage area = "Start Address" + "Size" – 1
7
7 DEBUG SUPPORT FUNCTION
7.1 Circuit Trace
145
7.2
Protocol Execution Log Storage Function (for
Predefined Protocol only)
This function checks the detailed predefined protocol execution status and results for each channel. Up to 32 protocol execution logs can be checked.
If the number of the stored logs exceeds 32, the oldest log will be overwritten.
The protocol execution log can be checked in the following method.
• Checking with Engineering tool
• Checking with the buffer memory
Protocol execution log is stored in the buffer memory.
Data are read from the buffer memory.
Check in "Protocol execution log" of
Engineering tool
Protocol execution logs are displayed.
Predefined protocol communication is performed with a target device.
C24 buffer memory
Protocol execution log
Engineering tool
Receive
Data
Data
Send
Precautions
Do not perform the above two methods at the same time.
The latest execution logs are not stored in the buffer memory while they are being updated with the predefined protocol support function of Engineering tool.
146
7 DEBUG SUPPORT FUNCTION
7.2 Protocol Execution Log Storage Function (for Predefined Protocol only)
Checking with Engineering tool
Check the protocol execution logs and protocol execution results in the "Protocol Execution Log" screen of Engineering tool.
Operating procedure
1.
Select a module to be debugged.
• Display the "Protocol Setting" screen. (
Page 31 Data Communication Procedure)
• Select "Protocol Setting" [Debugging Support Function] [Module Selection].
• Select the I/O address and channel of the module to be debugged, and click the [Set] button.
• As the [OK] button is clicked, the module information is set.
2.
Execute the CPRTCL instruction.
3.
Select "Protocol Setting" [Debugging Support Function] [Protocol Execution Log].
Window
7
The logs displayed in the "Protocol Execution Log" screen can be selected from the following two items, according to the log registration condition.
• Displaying only protocol that completed abnormally.
• Displaying all protocol execution status and execution logs.
The log registration condition can be set in "Execution log options" in the "Various control specification" screen of Engineering tool.
7 DEBUG SUPPORT FUNCTION
7.2 Protocol Execution Log Storage Function (for Predefined Protocol only)
147
Checking with the buffer memory
Check the protocol execution logs in the execution log storage area.
Operating procedure
1.
The log registration condition can be set by the 'Execution log options' in the buffer memory (Un\G16610/16626) .
Buffer memory address Un\G16610/16626 b15
0 b0
1/0
Log registration condition
0(OFF) : Register failed protocols only.
1(ON) : Register all protocol execution states and results.
2.
Execute the CPRTCL instruction.
3.
Check the protocol execution logs stored in the execution log storage area (Un\G16643 to 18177/18435 to 19969).
For details, refer to the following section.
148
7 DEBUG SUPPORT FUNCTION
7.2 Protocol Execution Log Storage Function (for Predefined Protocol only)
PART 2 ADDITIONAL
FUNCTIONS
This part explains the additional functions of C24.
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
9 COMMUNICATIONS BY THE MODEM FUNCTION
10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
11 CHANGING DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTE UNITS SETTING)
12 CHANGING DATA COMMUNICATION MONITORING TIME
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
17 DATA COMMUNICATIONS USING USER FRAMES
18 TRANSPARENT CODES AND ADDITIONAL CODES
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
21 SWITCHING THE MODE AFTER STARTING
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
23 INDEPENDENT/LINKED OPERATION OF INTERFACE
24 PARAMETER REGISTRATION TO CPU MODULE
25 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT SPECIFICATION
149
150
26 ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION FUNCTION
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
8
USING THE PROGRAMMABLE CONTROLLER
CPU MONITORING FUNCTION
This chapter explains the programmable controller CPU monitoring function with which the C24 monitors the programmable controller CPU based on the monitoring information reregistered by the user.
8.1
Overview
This section explains an overview of the programmable controller CPU monitoring function.
Transmitting data without a program
• The programmable controller CPU monitoring function enables C24 to monitor the CPU module on the host station at time intervals set by the user by reregistering data to be used for the programmable controller CPU monitoring function. Data transmission to the target device communicating with the MC or nonprocedural protocol is possible without a program.
• The following monitoring information selected by the user can be sent to the target device as the CPU module monitoring results.
Transmiss ion method
Data transmission
Monitoring result
Devices on the host station CPU module
(information of the device to be monitored)
Numeric value stored in a word device
ON/OFF status of a bit device
Without the modem function
Combined use of the modem function (modem communication)
Status of module of the host station CPU module
• There are two timings for transmitting the programmable controller CPU monitoring results to the target device; fixed cycle send and condition match send.
The fixed cycle send transmits the programmable controller CPU monitoring results each time when CPU module is monitored.
The condition match send transmits when the information read from the CPU module satisfies the defined conditions and when an error is detected in the CPU module.
Simplifying device monitoring procedure
When device monitoring is performed by communication using the MC protocol, the target device must repeatedly perform monitor request transmission and monitor data reception processing after it executes monitor registration.
By designating the fixed cycle send for the programmable controller CPU monitoring function, the device data can be monitored without performing the monitor request reception processing.
Notifying programmable controller CPU error
In the condition match send, error information can be transmitted to the target device whenever CPU module error occurs without any programming.
Target device
8
CPU error information Monitoring device information
Abnormal detection
Error occurred
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.1 Overview
151
8.2
Programmable Controller CPU Monitoring
Function
This section explains the programmable controller CPU monitoring function.
Data registration for using the programmable controller CPU monitoring function
The following explains the data registration by the user to use the programmable controller CPU monitoring function.
Registration procedure for the Programmable Controller CPU monitoring function
Programmable controller CPU monitor registration for C24 that is required to use the programmable controller CPU monitoring function is described in the following sections. The registration can be performed using one of the following methods:
• Registration with an Engineering tool
• Registration using the programmable controller CPU monitoring registration command (0630) for communication with the
MC protocol ( MELSEC Communication Protocol Reference Manual)
• Registration using the programmable controller CPU "CSET" instruction ( MELSEC iQ-R Programming Manual (Module
Dedicated Instructions))
Combination with modem function
Before transmitting the CPU module monitoring result when used in conjunction with the modem function, register the data for connection of the modem function.
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "Modem function setting"
Starting programmable controller CPU monitoring function
By registering the data for using the programmable controller CPU monitoring function, C24 begins monitoring the programmable controller CPU.
152
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
CPU module monitoring information
The following explains the monitoring target information used to perform the programmable controller CPU monitoring function.
Target of programmable controller CPU monitoring function
The following information can be registered as the target of the programmable controller CPU monitoring function.
• Device monitoring for the host station CPU module
Monitoring of the numeric values stored in the word device
Monitoring of bit devices ON/OFF status
• Monitoring status of the host station CPU module
Registering word devices and bit devices
For monitoring word and bit devices, up to 960 device points (up to 15360 bits for only bit devices) in total, which is equivalent to 10 blocks in total when any continuous device range comprised one block, can be registered.
Since monitoring of the CPU module status on the host station will be also registered as one block, up to 11 blocks can be registered.
• 11 (Number of registered word device blocks + Number of registered bit device blocks) + CPU status monitoring (1 block)
• 960 points (Total number of all word device block points (1 point = 1 word) + Total number of all bit device block points (1 point = 16 bits))
To register the device memory to monitor, designate the word device blocks for the registered word blocks, then designate the bit device blocks for the registered bit blocks.
8
Example for registering word devices and bit devices
The start device of each block is the monitoring target for device monitoring of the blocks for which the word and bit devices are registered.
Ex.
For a block in which 10 points of word devices from D100 to D109 are registered
Monitoring target: Numeric value to be stored in D100
Data transmission: Numeric values to be stored in D100 to D109
Ex.
For a block in which two points of bit devices from M100 to M131 are registered
Monitoring target: ON/OFF status of M100
Data transmission: ON/OFF status of M100 to M131
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
153
List of device code
The word and bit devices that can be designated as the monitoring targets and the device codes that are used to register the monitoring devices are listed in the table below.
Register the devices using the device ranges existing in the CPU module.
Category Device Device range (Default)
Internal system
Internal user
Register
Special relay
Special register
Input
Output
Internal relay
Latch relay
Annunciator
Edge relay
Link relay
Data register
Link register
Timer
Retentive timer
Counter
Link special relay
Link special register
Direct input
Direct output
Index register
File register
Contact
Coil
Current value
Contact
Coil
Current value
Contact
Coil
Current value
Device type
Bit
Word
CS
CC
CN
SS
SC
SN
DY
Z*
R*
ZR
SB
SW
DX
Device code
ASCII Binary
TS
TC
TN
V*
B*
D*
W*
Y*
M*
L*
F*
SM
SD
X*
94H
A0H
A8H
B4H
C1H
C0H
C2H
91H
A9H
9CH
9DH
90H
92H
93H
C7H
C6H
C8H
C4H
C3H
C5H
A1H
B5H
A2H
A3H
CCH
AFH
B0H
0 to 4096
0 to 2FFFH
0 to 12287
0 to 8191
0 to 2047
0 to 1FFFH
0 to 18431
0 to 1FFH
0 to 1023
0
0 to 511
0 to 7FFH
0 to 2FFFH
0 to 20
0 to 32767
• Designating a non-existent device code will result in an error.
• When the device range in the parameter setting has been changed, the new device range can be set as the programmable controller CPU monitoring target.
154
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
Monitoring timing of CPU module
The following explains the timing for programmable controller CPU monitoring when the programmable controller CPU monitoring function is performed.
To monitor the CPU module, C24 reads the monitoring information (device information and CPU module status information) from the CPU module at the set interval.
Cycle time
1 to 65535 (unit: 100 ms/s/min) can be registered.
Use the following formula as a reference when registering the cycle time.
■
When transmitting device data or the programmable controller CPU status
• Cycle time designation > K + SST + PT + DTT
■
When transmitting data in conjunction with the modem function
• Cycle time designation > K + SST + PT + DTT + DTTm + MCDT + CDWT
When modem initialization has not been performed, the modem initialization time will be added. (Performing modem initialization in advance is recommended.)
The items in the formula above is as follows:
• K: 60 ms constant (C24 internal processing time)
• SST (Sequence scan time): Time required for one scan
• PT (Processing time): Processing time for the "Multiple block batch read word unit command 0406"
For 1 point : 10.2 ms
For 480 points: 21.1 ms
For 960 points: 32.6 ms
• DTT (data transmission time) = 1 Transmission rate Number of bit for one byte during transmission Number of byte for send data
Number of bit for one byte portion during transmission = 1 + Data bit count + Parity bit + Stop bit count (parity bit: Yes = 1,
None = 0)
• DTTm (Data transmission delay time by the modem): Depends on the modem specification, line specification, and line status.
• MCDT (modem connection and disconnection time): Depends on the modem specifications, line specifications, and line status.
• CDWT (Line disconnection wait time): Wait time for disconnecting line
• Modem initialization time: Depends on the modem specifications.
8
Since C24 reads the monitoring information (device data, programmable controller CPU status) at the time of the next END process of the CPU module after the cycle time elapses, make the cycle time as long as possible.
The following phenomenon may be occurred if the cycle time is short.
• The number of scan of which CPU module scan time gets longer will be increased.
• The processing time for other data communication functions will be increased due to the increase of the
C24 programmable controller CPU monitoring function processing time.
• The load on the target device will be increased.
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
155
Timings of transmitting monitoring results to the target device
The following explains the timings for the transmission of CPU module monitoring results.
There are two transmission methods for transmitting the monitoring results of the CPU module on the host station to the target device; fixed cycle send and condition match send. One of these methods must be selected by the user during programmable controller CPU monitoring registration.
Fixed cycle send
The monitoring results are transmitted each time the monitoring information is read from the CPU module.
(Timing to transmit data)
Constant cycle transmission
Monitoring information
One-block portion
One-block portion
Target device
Cycle time
Program
END END END END
156
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
Condition match send
■
Transmission of monitoring results
For device monitoring, the monitoring conditions registered by the user (conditions for sending monitoring results), the monitoring condition values and the monitoring information read from the CPU module are compared. The monitoring results are transmitted when there is a block where the monitoring conditions match.
For programmable controller CPU status monitoring, the monitoring results are transmitted only once when an error is detected for the first time from the status information read from the CPU module. (This corresponds to the edge triggered transmission described below.)
■
Edge triggered/level triggered transmission
Two transmission methods of the monitoring results are available for the condition match send for device monitoring: edge triggered transmission and level triggered transmission.
• Edge triggered transmission
The monitoring conditions registered by the user (conditions for transmitting monitoring results), the monitoring condition values and the monitoring information read from the CPU module are compared. Then, the monitoring results are transmitted only once when a satisfaction of the monitoring conditions is detected for the first time.
After that, when the monitoring information read from the CPU module does not match the monitoring conditions and then it matches the monitoring conditions once again, the monitoring results are transmitted.
• Level triggered transmission
The monitoring conditions registered by the user (conditions for transmitting monitoring results), the monitoring condition values and the monitoring information read from the CPU module are compared. While the monitoring conditions are satisfied, the monitoring results are transmitted at each cycle time.
(Timing to transmit data)
Condition agreement transmission
Monitoring information
One-block portion
One-block portion
8
Target device
Cycle time
Program
(conditions matched/not matched)
Matched
END
Not matched
END
Matched
END
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
157
■
Monitoring condition
In the condition match send for device monitoring, the start device for each block is the monitoring target for condition monitoring of each block device.
For the condition match send, the monitoring conditions that can be designated for the device to be registered by the user and the registration values when designating the monitoring condition are listed in the table below.
Register the monitoring conditions for the start device of each block using the following table.
Monitoring condition Registration value Valid designated device
Bit Word
Device value or status = device monitoring condition value or status
Device value or status device monitoring condition value or status
Unsigned
Signed
Monitoring device monitoring condition value
Monitoring device < monitoring condition value
Monitoring device monitoring condition value
Monitoring device > monitoring condition value
Monitoring device monitoring condition value
Monitoring device < monitoring condition value
Monitoring device monitoring condition value
Monitoring device > monitoring condition value
For edge triggered transmissions
0001H
0002H
0003H
0004H
0005H
0006H
0007H
0008H
0009H
000AH
For level triggered transmissions
0101H
0102H
0103H
0104H
0105H
0106H
0107H
0108H
0109H
010AH
■
Monitoring condition value, status
In device monitoring, register the monitoring condition value or status for C24 to judge that the numeric value/status of the monitoring device for condition match send (start device of each block) satisfy the condition with numeric values listed below.
Type of monitoring device
Bit device
Word device
Monitoring condition value or status
OFF
ON
Numerical value
Registration value
0000H
0001H
0000H to FFFFH
Ex.
Condition satisfies when M0 = ON
Registration value for the monitoring condition: 0001H
Registration value for the monitoring condition value or status: 0001H
Ex.
Condition satisfies when D0 > 100 (signed)
Registration value for the monitoring condition: 000AH
Registration value for the monitoring condition value or status: 100 (64H)
In status monitoring for the CPU module, the monitoring conditions and condition values for condition match send are not registered.
Instead, it is registered whether or not the status monitoring of CPU module will be performed.
Monitoring results in the condition match send are transmitted only once when an error is detected by the status information read from the CPU module for the first time.
158
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
Transmission methods of monitoring results and data transmitted to the target device
This section explains the transmission method of the CPU module monitoring results and the data to be transmitted to the target device.
Data transmission to target device communicating with MC protocol
Data is transmitted in the same format as that for a message transmitted with the on-demand function with the on-demand data portion replaced with the device information and programmable controller CPU status information, as explained in "When sending the monitoring results as data during fixed cycle send" or "When sending the monitoring results as data during condition match send" below. ( MELSEC Communication Protocol Reference Manual)
■
When the interface that uses the modem function is set to the MC protocol
The connection processing and disconnection processing to the modem are performed when the programmable controller
CPU monitoring results are transmitted.
Ex.
Data transmission by MC protocol with modem function (condition match send)
Dial
Registration information for programmable controller CPU monitoring
Disconnection
Cycle time Target device
Program
(conditions matched/not match)
END
Matched
END
Not matched
END
Matched
■
When the transmission of on-demand data using user frames is designated
Data is transmitted in the transmission format for on-demand data using a user frame with the on-demand data portion replaced with the device information and programmable controller CPU status information, as explained in "When sending the monitoring results as data during fixed cycle send" and "When sending the monitoring results as data during condition match send" below.
See the following explanation for data reception for the target device side.
• Device information, programmable controller CPU status information arrangement ( MELSEC Communication Protocol
Reference Manual)
• Arrangement of data in the user frame portion to be transmitted (
Page 299 ON-DEMAND DATA COMMUNICATIONS
■
When transmitting the monitoring results as data during fixed cycle send
Data equivalent to the entire blocks of the monitoring target device information and programmable controller CPU status information is transmitted in batch.
■
When transmitting the monitoring results as data during condition match send
The device information for a block which the monitoring conditions are matched and the programmable controller CPU status information at an occurrence of an error are transmitted with the head data (header) and last data (footer) for the on-demand function added for each block.
Transmission is performed in the order of the programmable controller CPU status information, the device information registered in the word block, and then the device information registered in the bit block.
When data is communicated using the MC protocol format 1 to 4, all of the device monitoring start device number is converted to hexadecimal ASCII data and transmitted. (The same conversion is performed during either fixed cycle send or condition match send.)
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
159
Data transmission to target device communicating with nonprocedural protocol
The device information and CPU information are transmitted by the word/byte unit designation.
■
When ASCII-BIN conversion for communication data is designated
Data is converted to ASCII code data and transmitted. (The transmission example is shown in the "Device information and programmable controller CPU status information".)
• When the word/byte units designation is set to word
The device information and CPU information is transmitted by 1-word in the order of (H) and (L).
• When the word/byte units designation is set to byte
The device information and CPU information is transmitted by 1-word in the order of (L) and (H).
■
When the interface that uses the modem function is set to the nonprocedural protocol
The connection processing and disconnection processing to the modem are performed when the programmable controller
CPU monitoring results are transmitted.
Ex.
Data transmission by nonprocedural protocol with modem function (condition match send)
Dial
One-block portion
Monitoring information
One-block portion
Disconnection
Cycle time
Target device
Program
(conditions matched/not matched)
END END END
Matched Not matched Matched
■
When transmitting monitoring results as data during fixed cycle send
The device information of one or more user frame numbers and programmable controller CPU status information that have been currently designated for the fixed cycle send in C24 is transmitted in batch.
■
When transmitting the monitoring results as data during condition match send
The device information of one or more user frame numbers and programmable controller CPU status information that have been currently designated for the condition match send of the block where the monitoring conditions satisfied in C24 is transmitted in batch.
When the monitoring conditions of two or more blocks match, the device information and programmable controller CPU status information are transmitted for each block.
When the ASCII-BIN conversion for the communication data using the nonprocedural protocol is performed, all of the device monitoring start device number is converted to hexadecimal ASCII data and transmitted. (The same conversion is performed during either fixed cycle send or condition match send.)
■
The user frame numbers that can be designated for data transmission of programmable controller CPU monitoring results
• 1H to 3E7H (Default registration frame numbers)
• 3E8H to 4AFH (Frame numbers registered by the user in the flash ROM)
• 8001H to 801FH (Frame numbers registered by the user in the buffer memory)
• B001H to B01FH (Dedicated frame numbers for this function) (
For details on how to designate user frame numbers, refer to the following section.
Page 308 DATA COMMUNICATIONS USING USER FRAMES
160
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
■
Transmission instruction of device information and programmable controller CPU status information when transmitting the monitoring results
Use the following dedicated user frame numbers.
Frame No.
Information to be transmitted Valid function
Fixed cycle send
Condition match send
B001H
B002H
B003H
B004H
B005H
B006H
B007H
B008H
B009H
B00AH
B061H
B080H
B081H
B082H
Device information for the block registered in number n
Number 1
Number 2
Number 3
Number 4
Number 5
Number 6
Number 7
Number 8
Number 9
Number 10
Programmable controller CPU status information (CPU error monitoring data)
Number of blocks to be sent
Monitoring result information for all blocks
Monitoring result information for blocks satisfying the conditions
■
Device information and programmable controller CPU status information
It is transmitted in the order of data shown below.
Page 162 Data arrangement of device information and programmable controller CPU status information
For ASCII-BIN conversion, set "ASCII-BIN conversion designation" to "ON".
When user frame is designated with the number, of which bit 14 for the numeric value indicating the user frame number is ON,
ASCII-BIN conversion of the corresponding send data is not performed. It will be transmitted as binary data. (
ASCII-BIN Conversion for Data Communicated with Nonprocedural Protocol)
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
161
Data arrangement of device information and programmable controller CPU status information
When user frame numbers B001H to B00AH are designated (example for one block)
■
When word device data (W100 to W103, (4 points)) is transmitted
When the word/byte units designation is set to word unit, the device data will be transmitted in the order of (H) (L).
The number of registered points is the number of points in word units.
• (When ASCII-BIN conversion is not performed)
The total number of bytes for the device data portion is the number of device points 2.
When the word/byte units designation is byte When the word/byte units designation is word
L H
(W)
L H L H L H L H L H L H
(W)
L H H L H L H L H L
00 H 01 H 00 H B4 H 04 H 00 H 00 H 00 H 01 H 00 H 02 H 00 H 03 H 00 H 00 H 01 H 00 H B4 H 04 H 00 H 00 H 00 H 00 H 01 H 00 H 02 H 00 H 03 H
W100 W101 W102 W103 W100
• (When ASCII-BIN conversion is performed)
The total number of bytes for the device data portion is the number of device points 4.
When the word/byte units designation is byte
W101 W102 W103
H
W
L
*
H
0 0 0 1
L
0 0
H
0 0
L
0 4
L
0 0 0
H
0
L
0
H
1 0 0
L
0 2 0
H
0
L
0 3 0
H
0
57 H 2A H 30 H 30 H 30 H 31 H 30 H 30 H 30 H 30 H 30 H 34 H 30 H 30 H 30 H 30 H 30 H 31 H 30 H 30 H 30 H 32 H 30 H 30 H 30 H 33 H 30 H 30 H
W101 W102 W103 W100
When the word/byte units designation is word
H
W
L
*
H
0 0 0 1
L
0 0
H
0 0
L
0 4
H
0 0 0
L
0
H
0
L
0 0 1
H
0 0 0
L
2
H
0 0 0
L
3
57
H
2A
H
30
H
30
H
30
H
31
H
30
H
30
H
30
H
30
H
30
H
34
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
31
H
30
H
30
H
30
H
32
H
30
H
30
H
30
H
33
H
W100 W101 W102 W103
162
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
■
When data for bit device (M16 to M175, (10 point)) is transmitted
When the word/device units designation is set to word unit, the device data will be sent in the order of (H) (L).
The number of registered points is the number of points in word units.
• (When ASCII-BIN conversion is not performed)
The total number of bytes for the device data portion is the number of device points 2.
When the word/byte units designation is byte When the word/byte units designation is word
L H L H L H
(M)
10 H 00 H 00 H 90 H 0A H 00 H 30 H 11 H
L H
L H L H H L
(M)
10
H
00
H
00
H
90
H
0A
H
00
H
11
H
30
H
H L
12 H 34 H 34
H
12
H
3 0 1 1
0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1
M M
2
3
2
2
M M
2
1
2
0
M M M
1
9
1
8
1
7
M M
1
6
3
1
M M
3
0
2
9
M
2
8
M M M
2
7
2
6
2
5
M
2
4
1 1 3 0
0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0
M
3
1
M
3
0
M
2
9
M
2
8
M
2
7
M
2
6
M
2
5
M
2
4
M
2
3
M
2
2
M
2
1
M
2
0
M
1
9
M
1
8
M
1
7
M
1
6
• (When ASCII-BIN conversion is performed)
The total number of bytes for the device data portion is the number of device points 4.
When the word/byte units designation is byte
H
M
L
*
H
0 0 0 0 1
L H
0 0 0 0
L L
A 3 0 1
H
1
4D
H
2A
H
30
H
30
H
30
H
30
H
31
H
30
H
30
H
30
H
30
H
41
H
33
H
30
H
31
H
31
H
3 0 1 1
0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1
M
2
3
M
2
2
M
2
1
M
2
0
M
1
9
M
1
8
M
1
7
M
1
6
M
3
1
M
3
0
M
2
9
M
2
8
M
2
7
M
2
6
M
2
5
M
2
4
When the word/byte units designation is word
L
1 2 3
H
4
31
H
32
H
33
H
34
H
H
M
L
*
H
0 0 0 0 1
L
0
H
0 0 0
L
A
H
1 1 3
L
0
4D H 2A H 30 H 30 H 30 H 30 H 31 H 30 H 30 H 30 H 30 H 41 H 31 H 31 H 33 H 30 H
1 1 3 0
0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0
M
3
1
M
3
0
M
2
9
M
2
8
M
2
7
M
2
6
M
2
5
M
2
4
M
2
3
M
2
2
M
2
1
M
2
0
M
1
9
M
1
8
M
1
7
M
1
6
H
3 4 1
L
2
33 H 34 H 31 H 32 H
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
163
When user frame No. B061H is designated
Programmable controller CPU status information (for one block) is transmitted as the following data:
Item
Device code
Number of registered points
Monitoring start device
Device data During normal operation
Module warning occurring
Module error/module system error occurring
Communicating with
ASCII code
'01'
'0001'
'000000'
'0000'
'0001'
'0002'
Communicating with binary code
01H
0001H
000000H
0000H
0001H
0002H
• (When ASCII-BIN conversion is not performed)
The total number of bytes for the device data portion is the number of device points 2.
When the word/byte units designation is byte When the word/byte units designation is word
Remarks
All fixed value
L H L H L H L H L H H L
01 H 00 H 00 H 00 H
01
H
00
H
01
H
00
H 01 H 00 H 00 H 00 H
01
H
00
H
00
H
01
H
• (When ASCII-BIN conversion is performed)
The total number of bytes for the device data portion is the number of device points 4.
When the word/byte units designation is byte When the word/byte units designation is word
H
0
L
1
H
0 0 0 0 0
L
0
H
0 0 0
L
1
L
0 1 0
H
0
30
H
31
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
31
H
30
H
31
H
30
H
30
H
H
0
L
1
H
0 0 0 0
L
0
H
0 0 0
L
1
H
0 0 0
L
1
30H 31H 30H 30H 30H 30H 30H 30H 30H 30H 30H 31H 30H 30H 30H 31H
When user frame No. B080H is designated
The transmission block is transmitted as follows.
Ex.
Number of registered word blocks: 2 (D0 to D3 (4 points), W100 to W107 (8 points))
Number of registered bit blocks : 1 (M0 to M31 (2 points))
(When ASCII-BIN conversion is not performed) (When ASCII-BIN conversion is performed)
02H 01H 00H
H
0
L
2
H
0
L
1
H
0
L
0
30H 32H 30H 31H 30H 30H
164
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
When user frame No. B081H is designated
The information on monitoring results for all blocks are sent as shown below.
Results are transmitted in the order of the device information registered in the word block, the device information registered in the bit block, and the programmable controller CPU status information.
Ex.
Number of registered word blocks: 1 (W100 to W103 (4 points))
Number of registered bit blocks : 1 (M0 to M15 (1 point))
Perform CPU status monitoring : 1 (1 point)
• (When ASCII-BIN conversion is not performed)
The total number of bytes for the device data portion is the number of device points 2.
When the word/byte units designation is byte
L H
(W)
L H L H L H L H L H L H
(M)
L H L H L H L H L H
00H 01H 00H B4H 04H 00H 00H 00H 01H 00H 02H 00H 03H 00H 00H 00H 00H 90H 01H 00H 30H 11H 00H 00H 00H 01H 01H 00H 00H 00H
W100 W101 W102 W103
3 0 1 1
0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1
M
0
7
M
0
6
M
0
5
M
0
4
M
0
3
M
0
2
M
0
1
M
0
0
M
1
5
M
1
4
M
1
3
M
1
2
M
1
1
M
1
0
M
0
9
M
0
8
When the word/byte units designation is word
L H
(W)
L H H L H L H L H L L H
(M)
L H H L L H L H H L
00H 01H 00H B4H 04H 00H 00H 00H 00H 01H 00H 02H 00H 03H 00H 00H 00H 90H 01H 00H 11H 30H 00H 00H 00H 01H 01H 00H 00H 00H
W100 W101 W102 W103
1 1 3 0
0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0
M
1
5
M
1
4
M
1
3
M
1
2
M
1
1
M
1
0
M
0
9
M
0
8
M
0
7
M
0
6
M
0
5
M
0
4
M
0
3
M
0
2
M
0
1
M
0
0
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
165
• (When ASCII-BIN conversion is performed)
The total number of bytes for the device data portion is the number of device points 4.
When the word/byte units designation is byte
When the word/byte units designation is word
166
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
When user frame No. B082H is designated
Information on the monitoring results for the condition matched blocks are transmitted for each block.
Results are transmitted in the order of the programmable controller CPU status information, the device information registered in the word block and then the device information registered in the bit block.
Ex.
Number of registered word blocks: 2 (D0 to D3 (4 points), W100 to W103 (4 points))
Number of registered bit blocks : 1 (M0 to M15 (1 point))
When the condition satisfied monitoring device is W100 = 0 and M0 ON
• (When ASCII-BIN conversion is not performed)
The total number of bytes for the device data portion is the number of device points 2.
When the word/byte units designation is byte
For W100 to W103 block data For M0 to M15 block data
L H
(W)
L H L H L H L H L H
00H 01H 00H B4H 04H 00H 00H 00H 01H 00H 02H 00H 03H 00H
W100 W101 W102 W103
When the word/byte units designation is word
For W100 to W103 block data
L H
(M)
L H L H
00H 00H 00H 90H 01H 00H 30H 11H
3 0 1 1
0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1
M
0
7
M
0
6
M
0
5
M
0
4
M M
0
3
0
2
M
0
1
M
0
0
M
1
5
M M
1
4
1
3
M
1
2
M
1
1
M M
1
0
0
9
M
0
8
For M0 to M15 block data
L H
(W)
L H H L H L H L H L
00H 01H 00H B4H 04H 00H 00H 00H 00H 01H 00H 02H 00H 03H
W100 W101 W102 W103
L H
(M)
L H H L
00
H
00
H
00
H
90
H
01
H
00
H
11
H
30
H
1 1 3 0
0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0
M M
1
5
1
4
M
1
3
M
1
2
M
1
1
M M
1
0
0
9
M
0
8
M
0
7
M M
0
6
0
5
M
0
4
M
0
3
M
0
2
M M
0
1
0
0
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
167
• (When ASCII-BIN conversion is performed)
The total number of bytes for the device data portion is the number of device points 4.
When the word/byte units designation is byte
For W100 to W103 block data For M0 to M15 block data
H
W
L
*
H
0 0 0 1 0
L
0
H
0 0 0
L
4
L
0 0 0
H
0
L
0 1 0
H
0
L
0 2 0
H
0
L
0 3 0
H
0
H
M
L
*
H
0 0 0 0 0
L
0
H
0 0 0
L
1
L
3 0 1
H
1
57
H
2A
H
30
H
30
H
30
H
31
H
30
H
30
H
30
H
30
H
30
H
34
H
30
H
30
H
30
H
30
H
30
H
31
H
30
H
30
H
30
H
32
H
30
H
30
H
30
H
33
H
30
H
30
H
W100 W101 W102 W103
4D
H
2A
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
31
H
33
H
30
H
31
H
31
H
3 0 1 1
0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1
M
0
7
M M
0
6
0
5
M
0
4
M
0
3
M M
0
2
0
1
M
0
0
M M
1
5
1
4
M
1
3
M
1
2
M M
1
1
1
0
M
0
9
M
0
8
When the word/byte units designation is word
For W100 to W103 block data For M0 to M15 block data
H L
W *
H
0 0 0 1 0
L
0
H
0 0 0
L
4
H
0 0 0
L
0
H
0 0 0
L
1
H
0 0 0
L
2
H
0 0 0
L
3
H
M
L H
* 0 0 0 0 0
L
0
H
0 0 0
L
1
H
1 1 3
L
0
57
H
2A
H
30
H
30
H
30
H
31
H
30
H
30
H
30
H
30
H
30
H
34
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
31
H
30
H
30
H
30
H
32
H
30
H
30
H
30
H
33
H
W100 W101 W102 W103
4D
H
2A
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
30
H
31
H
31
H
31
H
33
H
30
H
1 1 3 0
0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0
M
1
5
M
1
4
M
1
3
M
1
2
M
1
1
M
1
0
M
0
9
M
0
8
M
0
7
M
0
6
M
0
5
M
0
4
M
0
3
M
0
2
M
0
1
M
0
0
168
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
Execution order for using the programmable controller CPU monitoring function
This section explains the execution order to use the programmable controller CPU monitoring function.
• When transmitting the monitoring results with the modem function, configure the following settings in order to use the modem function.
Setting item
Initial setting using the Engineering tool
Registration of data number for initialization and data number for connection
Initialization of C24 modem/TA
Reference
Page 206 Initial settings of Serial communication module
Page 209 Register/read/delete data for initialization
Page 213 Register/read/delete data for connection
Page 217 Initialization of modem/TA (terminal adapter)
• Register programmable controller CPU monitoring for C24 using one of the methods shown below.
Registration with Engineering tool
Registration using the programmable controller CPU monitoring registration command (0630) for communication with the
MC protocol ( MELSEC Communication Protocol Reference Manual)
Registration by the dedicated instruction for the CPU module (CSET) ( MELSEC iQ-R Programming Manual (Module
Dedicated Instructions))
• By registering programmable controller CPU monitoring, C24 monitors the CPU module on the host station regardless of the RUN/STOP status and sends the monitoring information to the target device.
• When reregistering programmable controller CPU monitoring in order to change the registration data for the programmable controller CPU monitoring, reregister after canceling the programmable controller CPU monitoring.
When registering with communication using the MC protocol ( MELSEC Communication Protocol Reference Manual)
When registering by "CSET" instruction for the CPU module ( MELSEC iQ-R Programming Manual (Module Dedicated
Instructions))
To cancel by using Engineering tool, set the CPU module in the STOP status first to configure the settings again, and then restart the CPU module.
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.2 Programmable Controller CPU Monitoring Function
169
8.3
Settings for Using the Programmable Controller
CPU Monitoring Function
This section describes system settings required for fixed cycle send and condition match send.
Parameter setting items for the programmable controller CPU monitoring function
The following explains parameter setting items for the programmable controller CPU monitoring function.
Configure the parameter settings.
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "Programmable Controller CPU monitoring function setting"
• Register send user frames by Engineering tool, after checking the specifications and setting methods explained in the following sections. (
Page 282 CONTENTS AND REGISTRATION OF USER FRAMES
FOR DATA COMMUNICATION, Page 308 DATA COMMUNICATIONS USING USER FRAMES)
• Register connection data for the modem function by Engineering tool, after checking the specifications in the following section. (
Page 214 Method to register/read/delete data for connection)
Setting items and requirement for communication using the MC protocol
: Setting required, : Setting not required
Setting item Reference
Programmable controller CPU monitoring function designation
Fixed cycle send
Condition match send
Cycle time units designation
Cycle time designation (Programmable controller CPU monitoring interval time)
Send pointer designation
Output quantity designation
Block monitoring device Registered word block quantity designation
Registered bit block quantity designation
Page 171 Programmable controller
CPU monitoring function designation
Page 171 Cycle time units designation
Page 171 Cycle time designation
(Programmable controller CPU monitoring interval time)
Page 173 Setting items for transmitting monitoring results
CPU error monitoring designation n-th block monitoring device
Page 172 Registered word block quantity designation, Registered bit block quantity designation
Page 172 CPU error monitoring designation
CPU error monitoring designation
Monitoring device designation
Start device No. specification
Number of read points specification
Monitoring condition value designation (judgment condition designation)
Monitoring condition specification
Send pointer designation
Output quantity designation
Send pointer designation
Output quantity designation
Page 172 Monitoring condition specification (Judgment condition specification)
Page 172 Monitoring condition value designation
Page 173 Setting items for transmitting monitoring results
Page 173 Setting items for transmitting monitoring results
*1 n=1 to 10
170
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
Setting items and requirement for communication using the nonprocedural protocol
: Setting required, : Setting not required
Setting item Reference
Programmable controller CPU monitoring function designation
Fixed cycle send
Condition match send
Cycle time units designation
Cycle time designation (programmable controller CPU monitoring interval time)
Send pointer designation
Output quantity designation
Block monitoring device Registered word block quantity designation
Registered bit block quantity designation
Page 171 Programmable controller
CPU monitoring function designation
Page 171 Cycle time units designation
Page 171 Cycle time designation
(Programmable controller CPU monitoring interval time)
Page 173 Setting items for transmitting monitoring results
CPU error monitoring designation n-th block monitoring device
Page 172 Registered word block quantity designation, Registered bit block quantity designation
Page 172 CPU error monitoring designation
CPU error monitoring designation
Monitoring device designation
Start device No. specification
Number of read points specification
Monitoring condition value designation (judgment condition designation)
Monitoring condition specification
Send pointer designation
Output quantity designation
Send pointer designation
Output quantity designation
Page 172 Monitoring condition specification (Judgment condition specification)
Page 172 Monitoring condition value designation
Page 173 Setting items for transmitting monitoring results
Page 173 Setting items for transmitting monitoring results
*1 n=1 to 10
Contents of setting items
The following shows the data setting items with Engineering tool and the setting contents to use the programmable controller
CPU monitoring function.
■
Programmable controller CPU monitoring function designation
Designate the timing (fixed cycle send or condition match send) when transmitting information on the programmable controller
CPU monitoring results (device information/CPU status information) to the target device.
• The conditions for condition match send are designated using data items in "Monitoring condition specification (Judgment condition specification)" and "Monitoring condition value designation".
■
Cycle time units designation
• Designate the unit for cycle time for reading information from the CPU module using the programmable controller CPU monitoring function.
• The time designated by "Cycle time units designation" and "Cycle time designation (programmable controller CPU monitoring interval time)" is also used as the transmission time interval for fixed cycle send.
■
Cycle time designation (Programmable controller CPU monitoring interval time)
Designate the time for one cycle when reading information from the CPU module in order to perform programmable controller
CPU monitoring function.
• The time designated for "Cycle time designation (Programmable controller CPU monitoring interval time)" is also used as the transmission time interval for fixed cycle send.
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
171
■
Registered word block quantity designation, Registered bit block quantity designation
Designate the number of word device blocks (number of registered word blocks) and the number of bit device blocks (number of registered bit blocks) registered in C24 as the target when performing device data monitoring or transmission.
■
CPU error monitoring designation
Designate whether or not C24 monitors abnormality of the CPU module on the host station (status monitoring) in the programmable controller CPU monitoring.
■
Monitoring device designation, start device number designation, number of read points designation
When performing device data monitoring or transmission, designate the device range for each block for the number of blocks designated by "Registered word block quantity designation" and "Registered bit block quantity designation".
The target of device data monitoring for condition match send is the start device for each block.
Word device designated block: Head word device (for one word)
Bit device designated block : Head bit device (for one bit)
• The monitored device is the item that indicates the target device of the corresponding block and designated with the codes below. (
Page 154 List of device code)
• The start device is the data that designates the head of the target device range for the corresponding block.
• The number of read points (number of registered point) is the item that indicates the target device range for the corresponding block which designate points from the start device number.
The bit device designates points in word units (1 point = 16 bits).
• The methods for designating these data are the same as the designation methods used when reading from or writing to the device memory, which are described in the following manual.
( MELSEC Communication Protocol Reference Manual)
When the user performs the programmable controller CPU monitoring registration, the device No. will designated in either a decimal or hexadecimal depending on devices. The number of read points (number of registered points) are designated in hexadecimal.
However, for data communication using either MC protocol (format 1 to 4) or nonprocedural protocol, when
ASCII-BIN conversion of the communication data has been designated, the start device number for all devices to be transmitted to target devices as the monitoring results will be converted to hexadecimal ASCII data and transmitted.
■
Monitoring condition specification (Judgment condition specification)
When the condition match send is designated by the "Programmable controller CPU monitoring function designation", designate the conditions for transmitting information for the "Monitoring condition value designation".
■
Monitoring condition value designation
When the condition match send is designated by the "Programmable controller CPU monitoring function designation", this data designates the status/numeric value for "Monitoring condition specification (Judgment condition specification)".
• When the monitoring device is a word device: Designate the monitoring condition value with a numeric value
• When the monitoring device is a bit device : Designate the monitoring condition with a numeric value (1/0) corresponding to
ON/OFF.
172
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
Setting items for transmitting monitoring results
The following shows an example of setting items and data transmission when sending the monitored results of the programmable controller CPU monitoring function to the target device using the nonprocedural protocol.
Ex.
This example shows when the D0 to D3 device information and user frame data are transmitted by the edge triggered transmission method with a condition of D0 = 0.
The setting is configured in the parameters of Engineering tool.
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "Programmable Controller CPU monitoring function setting"
Setting item
Programmable controller CPU monitoring function designation
Cycle time units designation
Cycle time designation (Programmable controller CPU monitoring interval time)
Block monitoring device Registered word block quantity designation
Registered bit block quantity designation
CPU error monitoring designation
1st block monitoring device
Monitoring device designation
Start device number designation
Number of read points specification
Monitoring condition specification
(Judgment condition specification)
Monitoring condition value designation
Send pointer designation
Output quantity designation
Setting content Remarks
Condition match send
1
0 min
3
0
4
Do not monitor
D
Settings other than those listed at left are not required
=(Edge)
0
49
3
• Setting the send user frames
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "User frame specification"
Transmission frame No. designation 46th
Transmission frame No. designation 47th
Transmission frame No. designation 48th
Transmission frame No. designation 49th
Transmission frame No. designation 50th
Transmission frame No. designation 51th
Transmission frame No. designation 52th
Transmission frame No. designation 53th
Transmission frame No. designation 54th
Transmission frame No. designation 55th
Transmission frame No. designation 56th
Transmission frame No. designation 57th
User frame number
User frame number
User frame number
User frame number (02H)
User frame number (B001H)
User frame number (03H)
User frame number
User frame number
User frame number
User frame number
User frame number
User frame number
Set the user frame data (STX)
Set the first block (from D0 to D3)
Set the user frame data (ETX)
Data sent when the condition D0 = 0 is satisfied
ETX
Device data
(D3)
Device data
(D2)
Device data
(D1)
Device data
(D0)
STX
Target device
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
173
8
How to register and cancel the programmable controller CPU monitoring function
The following shows the method to register/cancel the programmable controller CPU monitoring function from the CPU module.
• For details on the method for registering or canceling the programmable controller CPU monitoring with a command of MC protocol, refer to the following manual.
( MELSEC Communication Protocol Reference Manual)
When registering or canceling from the CPU module
For details on the CSET command, refer to the following section.
Page 580 Dedicated Instructions
Registering programmable controller
CPU monitoring
Create control code data from D0
M0 M1
M1
ZP.CSET
"Un" K1 D0 D200 M0
Processing for normal completion
Processing for abnormal completion
Program
CSET instruction
Completion device
Scan
END processing
Scan
Instruction execution
END processing
Scan
END processing
Completion device +1
At abnormal completion
CPU module Setting processing
• Store the data for programmable controller CPU monitoring registration in the device that designates the control data for the
CSET instruction.
• Execute the CSET instruction.
At the end of the scan in which the CSET instruction was completed, the completion device (M0) designated by (D2) turns
ON and then turns OFF at the next END processing.
• When an error occurs, (D2) + 1 turns ON and the error code is stored in the completion status (S2) + 1.
174
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
■
Program example for performing programmable controller CPU monitoring registration
This example shows a program that registers programmable controller CPU monitoring for the CH1 side interface.
This registration is for transmitting the contents of M0 to M15 and D100 to D109 to the target device using the fixed cycle send
(cycle time is 3 min).
Category Setting content
Label to be defined Define the global label as shown below.
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
175
(0)
(3)
(43)
(54)
Convert the registration command into pulse.
Set the execution type.
Set the execution type (Programmable controller monitoring registration).
Set the unit of the cycle time to 'Minute'.
Set the cycle time to three minutes.
Set the monitoring function to fixed cycle send.
Set the transmission measure to data transmission.
Set the output start pointer.
Set the number of the user frame to be transmitted.
Set the number of registered word blocks designation to '1'.
Set the number of registered bit blocks designation to '1'.
Register the device of D100 to D109 as the first block.
Register the device of M0 to M15 as the second block.
Execute the programmable controller CPU monitoring registration.
Processing for normal completion or abnormal completion
176
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
■
Program example for performing programmable controller CPU monitoring cancellation
This example shows a program that cancels programmable controller CPU monitoring for the CH1 side interface
Category Setting content
Label to be defined Define the global label as shown below.
(0)
(3)
(19)
Set the command pulse.
Execute the programmable controller CPU monitoring registration.
Processing for normal completion or abnormal completion
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.3 Settings for Using the Programmable Controller CPU Monitoring Function
177
8.4
Considerations for Using the Programmable
Controller CPU Monitoring Function
Influence on the cycle time
The cycle time will be affected by the following factors.
Keep these in mind when setting the cycle time.
• When the programmable controller CPU is accessed by a module other than C24.
• When a data communication function other than the programmable controller CPU monitoring function is used.
• When transmission interruption occurs by DTR/DSR control.
Mixing of fixed cycle send and condition match send
Both of the fixed cycle send and the condition match send cannot be designated together for the same interface.
Target CPU module
Only the CPU module on the host station can be the target for the programmable controller CPU monitoring function.
Registration during operation
A new programmable controller CPU monitoring registration cannot be performed while the programmable controller CPU monitoring function is in operation.
• Perform the new programmable controller CPU monitoring registration after canceling the programmable controller CPU monitoring.
• If the programmable controller CPU monitoring registration is performed without canceling the monitoring, an error will occurs.
Before performing the programmable controller CPU monitoring registration with Engineering tool, set the CPU module in the STOP state, and then restart the CPU module.
Error during operation
While the programmable controller CPU monitoring function is in operation, even if an error occurs in transmission of the CPU module monitoring results or reading of data from the CPU module, the programmable controller CPU monitoring function operation will not stop.
System configuration
The programmable controller CPU monitoring function can be used when the system configuration is in a 1:1 basis.
178
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.4 Considerations for Using the Programmable Controller CPU Monitoring Function
Operation when information cannot be transmitted to target device
The following describes how C24 operates when the information of the programmable controller CPU monitoring results cannot be sent to the target device due to line disconnection or other reasons.
Even if an error occurs while the programmable controller CPU monitoring function is in operation, the ERR LED does not turn
ON. (This is the same as when using the on-demand function of the MC protocol.)
■
When the setting for the send monitoring time designation (timer 2) is 'Unlimited wait' (0H)
• Reading of monitoring data from the CPU module stops until the transmission of the monitoring data is completed.
• When transmission resumes, reading of monitoring data from the CPU module resumes and monitoring data and information are transmitted.
■
When the setting for the send monitoring time designation (timer 2) is other than 'Unlimited wait' (0H)
• A transmission timeout error occurs. Reading of monitoring information from the CPU module and transmission of the information resumes.
• The error code is stored in the 'programmable controller CPU monitoring function execution result (current)' (Un\G8709/
8965).
When CPU module error occurs
When device data for the programmable controller CPU cannot be read because of a CPU module error (hardware failure, etc.), the error code is stored in the programmable controller CPU monitoring function error code storage area and C24 performs the monitoring processing based on previously read data.
Modem connection error
When the monitoring information is transmitted with the modem function, a modem connection error will occur if a modem connection request is issued for the following reason.
• Connection request by the 'connection request' (Y11)
If possible, provide a dedicated C24 for using the programmable controller CPU monitoring function.
When using both the programmable controller CPU monitoring function and data communication function with a single C24 and one of the above modem connection errors occurs, re-execute a connection request in consideration of the transmission timing set by the user for the programmable controller CPU monitoring function.
8
8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
8.4 Considerations for Using the Programmable Controller CPU Monitoring Function
179
9
COMMUNICATIONS BY THE MODEM
FUNCTION
This chapter explains the overview and how to use the modem function, which can be used for data communication with remote target devices.
For the transmission specification on C24 side, connectable modems/TA's (terminal adapter) for the usage of the modem function, refer to the following manual.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
9.1
Overview
The modem function easily performs data transmission/reception to remote devices via public lines/office telephone systems/ digital lines (ISDN) by connecting a modem or TA (terminal adapter) to RS-232 interface of C24.
Initialization of the modem or TA, line connection (dialing), and modem disconnection are performed by CPU module.
Once the line is connected, data communication with the target device via public line/office telephone system/digital line can be performed.
C24
Modem/TA
(*1)
Modem/TA
(*1)
Target device
RS-232
*1 TA indicates the abbreviation for the terminal adapter.
The modem function does not support dedicated lines.
When transmitting/receiving data via a dedicated line, prepare a modem having an automatic connection function and supporting dedicated lines.
This chapter can be skipped because data can be transmitted/received without using the modem function when transmitting/receiving data via a modem having an automatic connection function and supporting dedicated lines.
Automatic connection function: Indicates a function for connecting to the modem of the target device automatically. (The function name varies depending on the manufacturer of the modem.)
180
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.1 Overview
Features
The following explains the features of the modem function.
Interface that can use the modem function
• The modem function can be used with an RS-232 interface of C24.
• For the RJ71C24-R2, the modem function can be used for only one of the two RS-232 interfaces.
With the other interface of C24, direct data communication with a target device can be performed using MC protocol, nonprocedural protocol, or bidirectional protocol (independent operation).
9
Communication using the modem function
Communication without using the modem function
Initialization/connection/disconnection of modem or TA
• The following setting value for line connection can be used by registering in the module extended parameter or flash ROM of C24 in multiple sets.
Data for Modem/TA initialization (AT command)
User setting: 30 sets (78 bytes/set), default value: 13 sets
Data for connection
User setting: 30 sets (80 bytes/set) (display message to telephone number of the connection destination, line type, etc.)
• By registering the above data to C24 in advance, the modem/TA (terminal adapter) initialization, line connection (dialing), and line disconnection can be performed easily.
• When the no-communication interval time (1 min to 120 min) is set, C24 disconnects the line when a no-communication condition continues for the set period of time following the line connection.
Communication between remote device and CPU module
• Data communication can be performed via full-duplex communication.
• From the target device to the CPU module, communication using the MC protocol, nonprocedural protocol, or bidirectional protocol can be performed.
• From the CPU module to the target device, communication using the MC protocol (transmission by the on-demand function only), the nonprocedural protocol, or bidirectional protocol can be performed.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.1 Overview
181
Remote password check
If the remote password check has been set for C24, the C24 performs a remote password check when accessing to the programmable controller from a target device using the C24 modem function.
The following is an overview of the CPU module remote password function.
Page 187 Applicability of remote password function
■
Remote password function
The remote password function allows/prohibits access to the CPU module from a target device via the following modules.
• C24
• Ethernet module
• Built-in Ethernet port CPU
In the case of the Ethernet module, the remote password function can be used for data communications connections with a target device. For details, refer to following manual.
MELSEC iQ-R Ethernet User's Manual (Application)
■
Station to which the remote password and remote password check are set
• When a programmable controller system with one CPU module station
Parameter setting with Engineering tool
Remote password
Module subject to the remote password check RCPU
Target device access source
Remote password
C24
Remote password check
Modem
Public line
Modem
Communication executing the remote password check
Communication using MC protocol
• When a programmable controller system consisted of multiple CPU module stations
Set to the CPU module station (the CPU module on the host station in the figure below) which is the entrance of the programmable controller system as viewed from the target device.
Set in the host station to allow/prohibit access to the network system 1 from the target device.
(Host station)
Remote password
RCPU
Ethernet module
Remote password check
C24
Modem
Public line
Modem
Target device access source
(Relay station) RCPU
Ethernet module
Ethernet module
RCPU
Ethernet module
(Access station)
Ethernet
Not set in the relay station or access station.
Network System 1
When set to a station other than the CPU module which is the entrance of the programmable controller system (relay station or access station in the above figure), access to other stations beyond the set station is prohibited.
182
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.1 Overview
Function list
The modem function overviews are as follows:
Function
Modem/TA initialization
Line connection (dialing)
Data communication
Modem disconnection
Flash ROM reading, writing
(registration), and deletion
Remote password check
Overview
Initializes the modem/TA using the user-designated initialization data (AT command). (Auto initialization of the modem/TA is possible.)
Dials the target telephone number according to the user-designated data for connection and enables data communication after establishing the line connection.
When the modem/TA is not initialized, performs the initialization.
Performs communication with a target device using the MC protocol, nonprocedural protocol, or bidirectional protocol.
Performs communication with the target C24-installed station by modem/TA connection using nonprocedural protocol or bidirectional protocol. (Station-to-station communication)
Communication method: fullduplex communication
Synchronization method:
Asynchronous communication
(asynchronous)
Disconnects forcefully the line to the connected target device.
Reads, writes (registers) and deletes the initialization data (AT command) and data for connection from/to the flash ROM in
C24 according to the request from CPU module.
Allows C24 to execute the check of the remote password set in the CPU module when communication from a target device to C24 is performed using the MC protocol.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.1 Overview
183
9.2
System Configuration
This section explains the system configurations when the modem function is used to perform data communication with a target device via public lines.
System configuration when performing data communication with target device
The following shows the system configuration examples used for data communications between a target device and CPU module using the MC protocol/nonprocedural protocol/bidirectional protocol of C24.
Connection example to a target device
Target device
Public line
Modem
RS-232 cable
Modem
RS-232 cable
Connection example to C24
Public line
RS-232 cable
Modem
Modem
RS-232 cable
• The public lines indicated above are compatible with the office telephone system as well.
• For connection to a target device or C24, the digital line (ISDN) can be replaced by the public line.
When connecting via a digital line, a TA (terminal adapter) and a DSU (digital service module) are used instead of a modem.
184
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.2 System Configuration
Considerations for system configurations
The following shows considerations for the system configurations to perform data communication with a target device via public line, an office telephone system or digital line (ISDN) using the modem function.
Usable C24 interface
• The modem function can be used for the RS-232 interface only.
• For the RJ71C24-R2, the modem function can be used for only either one of the two RS-232 interfaces.
• Interactive data communication via two interface of C24 (interlink operation) is not available.
Connectable modem/TA
Only the modems/TA shown below can be used for the C24 RS-232 interface to use the modem function.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
Number of connectable modems/TAs
Only one modem/TA can be connected to the C24 RS-232 interface to use the modem function.
Modem/TA connection cables
• Perform the wiring connection as designated on the modem/TA side for connection between C24 and modem/TA.
• For the RS-232 interface of C24, a D-sub 9-pin connector (female) is used.
For the connection cable of C24 side, refer to the following manual.
( MELSEC iQ-R Serial Communication Module User's Manual(Startup))
Modem/TA installation
• Install the modem/TA according to the modem/TA manual.
Installing it in an area where a lot of noises are generated may cause malfunctions.
• In order to prevent the effects of noise and power surges, do not connect near or tie the cable together with a main circuit line, high-voltage line or load line other than for the programmable controller with the modem/TA connection cable.
Connectable lines
• The connections with the following lines, which are equivalent to NTT communication protocol are available.
Perform connection tests beforehand and confirm that connection is possible.
Public line or office telephone system of analog two-line method
Digital line (ISDN)
• It is not possible to connect to call-waiting lines, in order to avoid data errors or automatic line disconnection due to the callwaiting interrupt tone.
• Avoid connections with party-line telephones to avoid interrupted calls during communication.
• If an alert sound is sent at fixed intervals from the communication machine to prevent long-term calls, data corruption may occur.
Transmitting a response for normal/abnormal data reception between devices, and performing transmission retry processing when any abnormality is detected is recommended.
• Refer to the manuals for a modem/TA for connection from a modem to public line/office telephone system, or for connection from a TA to a digital line.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.2 System Configuration
185
Communication method
Communication via the modem function is performed using full-duplex communication.
Connections to devices designed for half-duplex communication is not available.
Data communication to target devices
• Data communication with target devices is performed using the public line or electric wave transmitted from the electric wave transmission base.
In some conditions, normal data communication may not be carried out due to the system installation environment, electric-wave transmission status, error in the target device, or other reasons.
Perform a connection test beforehand, and confirm that connection is possible.
186
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.2 System Configuration
9.3
Specifications of Modem Function
This section explains the applicability to the remote password function, input/output signals and buffer memory related to the modem function.
Applicability of remote password function
The following explains C24 data communication for the remote password function of the CPU module.
For an overview of the C24 check function for the CPU module remote password, refer to the following section.
Page 182 Remote password check
Precautions
The remote password function cannot prevent improper access completely.
Incorporate the user's own safeguards when it is necessary to protect the security of the programmable controller system from improper access from an external device.
Mitsubishi Electric Corporation cannot be held responsible for any system problems that may occur from unauthorized access.
■
Countermeasures for preventing unauthorized access
• Install a firewall.
• Install a personal computer as a relay station and control the relay station of the transmission/receive data using application programs.
• Install an external device whose access authority can be controlled.
For the external devices whose access authority can be controlled, contact the network provider or distributor of devices.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
187
Data communication when remote password is set
This section explains how to use and set the CPU module remote password function, and data communication between the target device and the CPU module when a remote password has been set.
■
Permitting/prohibiting access from target device to programmable controller
Access permission processing (unlock processing)
• To access to the specified CPU module, the target device performs the remote password unlock processing to the C24
*1
on the directly connected station (host station) after line connection for the modem function.
• If the unlock processing has not been performed, accessing to the specified station is prohibited by the remote password check performed by C24
*1
, which received the communication request.
(
Page 190 Remote password check processing performed by C24)
• All received data before the unlock processing is performed will be processed as an error.
*1 It indicates the C24 on the CPU module station to which a remote password is set.
Access processing
• Normal completion of the remote password unlock processing allows the access to the specified station.
• Perform communication using the MC protocol.
Access prohibition processing (lock processing)
• To complete the access to the specified station, perform the line disconnection processing for the modem function in order to disable further access.
• When the modem disconnection is completed, the remote password lock processing is performed automatically.
(When accessing the host station RCPU) (When accessing other station RCPU)
A station
(*1)
A station
(*1)
Ò Unlock processing Ò Unlock processing
Modem Modem Modem Modem
Ó Access
Ô Lock processing(*2) Ô Lock processing(*2)
Remote password
CPU module
Remote password check
C24
(Host station)
Remote password
CPU module
Remote password check
C24
(*3)
Ethernet module
(Host station)
Ethernet
CPU module
Ethernet module
Ethernet module
(Relay station)
Ethernet
Ó Access
CPU module
Ethernet module
(Access station)
*1 Unlock and lock processing of the remote password for the host station is possible.
Remote password unlock and lock processing for the relay station and access station cannot be performed.
*2 Lock processing is performed when a line for the modem function is disconnected.
*3 For an Ethernet module which transmits a communication request to other Ethernet, the unlock and lock processing is not necessary even it is set as the subject of remote password check.
188
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
The remote password unlock and lock processing can be performed to the C24 on the host station directly connected to the target device.
The remote password unlock and lock processing cannot be performed for the Ethernet module of the other stations (relay station and access station).
9
• The remote password unlock processing from a target device is performed using dedicated commands for
MC protocol communication.
• For corrective actions for abnormal completion of the remote password unlock processing, refer to the following section.
(
Page 198 Considerations for using the modem function)
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
189
Remote password check processing performed by C24
■
Communication in which a remote password check is performed
When the following parameters are set for the C24 mounted on the host station CPU module, the C24 performs a remote password check for communication requests listed below.
• When a remote password is set in the CPU module.
• When C24 that is communicating data with the target device has been set as a module subject to the remote password check.
C24 performs a remote password check with respect to a communication request to the host station/other station received from the target device.
C24 does not perform a remote password check for the following communication requests.
• Transmission request from the CPU module on the host station (such as transmission using nonprocedural protocol)
• Communication request from the target device (including Engineering tool connected to the CPU module on the host station) transmitted to other station upon request from the CPU module.
Modem
CPU module C24
Remote password
(Host station)
(Other station)
Remote password check Ò
Ó
Ethernet module
Ô
Modem
Path for items subject to remote password check
Path for items not subject to remote password check
Engineering tool
Ô
CPU module
Remote password
Remote password check
(*1)
Ethernet module
*1 In the above figure, a communication request from the target device cannot be received since the remote password check setting has been configured.
If the remote password check setting has not been configured, a communication request can be received and data communication from the target device is possible.
■
Selecting modules to which remote password check is performed
C24 to which the remote password check is performed can be selected by the user, and it will be set by the parameters of the
CPU module.
(This is set on the "Remote Password Setting" screen of Engineering tool.)
190
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
■
Stations that can be accessed when the remote password check is performed
• The remote password unlock processing to the C24 on the directly connected station (host station) after line connection for the modem function enables the target device to access to the CPU module on the host station.
• When accessing the programmable controller on other stations via the Ethernet module on a relay station or access station, the access is allowed/prohibited by the settings below.
To prohibit access to other station from a target device using the IP packet transfer function of the Ethernet module, select the checkbox for "MELSOFT Transmission Port (UDP/IP)" on the "Remote Password Detail Setting" screen for the relay station or access station.
For the stations that can be accessed when accessing to the CPU module on the other stations via Ethernet module, refer to the following manual.
(Refer to it by substituting the station connected to a target device with C24.)
( MELSEC iQ-R Ethernet User's Manual (Application))
Data communication procedure
The following shows the procedure when a target device performs data communication via C24 to which the remote password check is performed.
1.
Initialization of the modem on the C24 side and target device side is performed at each device sides.
2.
The line is connected from the target device.
3.
The target device performs the remote password unlock (release) processing for the CPU module on the station where
C24 is mounted using dedicated commands for MC protocol communication.
(The unlock processing cannot be performed for the CPU module of other station.)
For what to do when the remote password unlock processing is completed abnormally, refer to the following section.
(
Page 182 Remote password check)
4.
Data communication is performed from the target device using MC protocol.
5.
When data communication using MC protocol is completed, a line for the modem is disconnected from the target device.
When line disconnection is completed, the remote password lock processing is performed automatically.
■
Remarks
• For more details on the unlock processing command to the remote password, refer to the following manual.
( MELSEC Communication Protocol Reference Manual)
How to set the remote password
For the remote password setting method, refer to the following manual.
GX Works3 Operating Manual
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
191
List of input/output signals for the modem function
The input/output signals to/from the CPU module for the modem function are shown below.
For information on the input/output signals not related to the modem function, refer to the following section.
Page 545 Input/Output Signal List
Ex.
The start I/O number of C24 is '0030'. ('n' indicates start I/O number of C24.)
Xn0 to X(n+1)F X30 to X4F, Yn0 to Y(n+1)F Y30 to Y4F
Function and description of input/output signal
I/O signal
X10
X11
X12
X13
X14
Y10
Y11
Y12
Signal name Function/description
Modem initialization completion
Dialing
Indicates the normal completion of the initialization for the modem/
TA connected to the host station side by C24 according to the initialization data designated.
Indicates that C24 is dialing (performing connection processing) the target device side according to the data for connection designated.
Connection
Initialization/connection abnormal completion
Modem disconnection completion
Modem initialization request
(standby request)
• Indicates normal completion of the line connection processing from or to the target side.
• When this signal is ON, data communication with the target device is possible.
• Indicates abnormal completion of the modem/TA initialization or line connection processing (dialing) to the target device.
• Check the cause of the abnormal completion in the modem-error code storage area (address: 221H) and take corrective actions.
Indicates that the line for data communication with the target device has been disconnected.
• Indicates the initialization request to the modem connected to the
C24 on the host station.
• Turn ON the initialization request signal after designating the data for initialization to the buffer memory when it is not set with
Engineering tool.
Connection request • Indicates the connection request (dialing) to enable data communication with the target device.
• Turn ON the connection request signal after designating the data for connection to the buffer memory when it is not set with
Engineering tool.
• If the modem/TA connected to the host station is not initialized, the C24 side modem is initialized as well prior to dialing, according to the designated data for initialization.
Modem disconnection request Indicates a line disconnection request to the target device upon completion of data communication.
Description
Page 217 Initialization of modem/TA
Page 217 Initialization of modem/TA
Page 217 Initialization of modem/TA
The descriptions hereafter show an example in which I/O numbers of the C24 are assigned to X/Y00 to X/Y1F.
192
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
Buffer memory
The buffer memory to be used for the modem function is shown below.
For the buffer memory that are not related to the modem function, refer to the following section.
Read/write the setting values from/to the buffer memory using Engineering tool.
This section provides supplementary explanations on setting values used to perform settings and monitoring with an Engineering tool.
Precautions
Do not write data in the system area of the buffer memory.
If data is written in the system area, the programmable controller system may operate abnormally.
The system area exists in the user area partially. Therefore, take caution when reading from/writing to the buffer memory.
Details of the buffer memory (for modern function)
■
Modem connection CH specification (Un\G46)
Designate the interface on the C24 side to which a modem/TA is connected.
■
Connection retry count designation (Un\G48)
• Designate the number of retries for the connection request when the connection could not be made to the target device by the connection request.
• Using the default value for the connection re-try count is recommended.
■
Connection retry interval designation (Un\G49)
• Designate the interval time of the retry processing for the connection request when the connection could not be made to the target device by the connection request.
• The default value is recommended to use for the connection retry interval.
■
Initialization/connection timeout designation (Un\G50)
• Designate the following wait time:
Wait time until the modem/TA initialization is complete
Wait time per wait when the connection could not be made to the destination by the connection request
• The default value is recommended to use for the initialization/connection retry timeout.
■
Number of initialization retries designation (Un\G51)
Designate the number of retries when the initialization by the initialization request to the modem on the C24 side has failed.
■
Data No. for initialization designation (Un\G52)
• Designate the registration number of data for initialization which is transmitted by the initialization request to the modem on the C24 side.
The registration number is the number registered in C24.
• For details on the designation by program, refer to the following section.
(
Page 217 Initialization of modem/TA (terminal adapter))
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
193
■
Data No. for connection designation (Un\G53)
• Designate the registration number of the data for connection used by C24 for the connection processing to the target device in order to perform data communication.
The registration number is the number registered in C24.
• For details on the designation by program, refer to the following section.
(
■
No-communication interval time designation (Un\G55)
• Designate the wait time until the line is closed when the data communication has ceased with the target device after the line connection.
• C24 automatically performs the line disconnection processing when no data communication is performed with the target device for a designated time.
The 'Connection' (X12) and the 'Modem initialization completion' (X10) are turned OFF and the 'Modem disconnection completion' (X14) is turned ON when the line disconnection processing is performed.
■
RS/CS control enable/disable designation (Un\G56)
• Designate whether or not the control to notify the data reception capability on the host station to the target side with the RS/
CS signal during data communication between C24 and modem/TA.
• This setting is for the interface designated for the modem connection channel indicated in the 'Modem connection CH specification' (Un\G46).
The control of the other interface that does not use the modem function is performed by the settings in the 'DTR/DSR (ER/
DR), DC control designation' (Un\G147/307).
The overview of the RS/CS control is shown below.
● When transmitting data
• C24 detects the modem/TA data reception capability by ON/OFF of the CS (CTS) signal.
• When the CS (CTS) signal is ON, data transmission from C24 starts or continues.
When the CS (CTS) signal is OFF, data transmission from C24 is interrupted.
● When receiving data
• The C24 side reception capability is notified to the modem/TA by ON/OFF of the RS (RTS) signal.
• When the RS (RTS) signal is ON, C24 can receive data. Start/continue data transmission from the modem/
TA to C24.
When the RS (RTS) signal is OFF, C24 cannot receive data. Cancel data transmission from the modem/TA to C24.
• C24 turns ON/OFF the RS (RTS) signal in the following conditions:
ON OFF control of the RS (RTS) signal
C24 turns OFF the RS (RTS) signal when the free OS area for receive data storage becomes 64 bytes
(default) or less.
OFF ON control of the RS (RTS) signal
C24 turns ON the RS (RTS) signal when the free OS area for receive data storage becomes 263 bytes
(default) or more.
■
Modem function error code (Un\G545)
• Error code for an error occurred while the modem function is used or when abnormal signal ('Initialization/connection abnormal completion' (X13)) turns ON is stored.
• For information on error codes, refer to the following section.
(
194
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
■
Modem function sequence status (Un\G546)
• The current status while the modem function is used is stored as a number.
• For information on the storage value of the modem function sequence status when using the modem function, refer to the following section.
(
Page 204 Startup procedure of the modem function)
■
Number of data registration for connection (Un\G547)
• The number of registered data for connection, which has been registered in the flash ROM, used by C24 for connection processing with the target device to perform data communication is stored.
The number of registration is the number of data for connection registered in the flash ROM by the user.
• For details on registration of data for connection, refer to the following section.
(
Page 213 Register/read/delete data for connection)
■
Data registration status for connection (for confirmation of registration No.) (Un\G548 to 549)
• The registration status of data for connection, which has been registered in flash ROM, used by C24 for the connection processing with the target device to perform data communication is stored.
• The registration status of each data for connection with registration numbers, No.BB8H to BD5H (3000 to 3029), is indicated in the corresponding bit in the range shown in the figure below.
Registration status of data for connection number BB8H (3000)
Registration status of data for connection
number BC7H (3015)
Buffer memory address b15 b14 b13 b12
Un\G548
Un\G549 0 0
Registration status of data for connection
number BD5H (3029)
Registration status of data for connection
number BC8H (3016) to b2 b1 b0
0 (OFF) : No registration
1 (ON) : Registration exists
■
Number of data registration for initialization (Un\G550)
The number of registered data for initialization, which has been registered in the flash ROM, transmitted to the modem connected to the C24 side for initialization request.
The number of registrations is the number of data for initialization registered in the Flash ROM by the user.
■
Data registration status for initialization (for confirmation of registration No.) (Un\G551 to 552)
• The registration status of data for initialization, which has been registered in flash ROM, transmitted to the modem connected to the C24 side for initialization request.
• The registration status of each data for initialization with registration numbers, No.9C4H to 9E1H (2500 to 2529), is indicated in the corresponding bit in the range shown in the figure below.
• For details on registration of data for initialization, refer to the following section.
(
Page 209 Register/read/delete data for initialization)
Registration status of the data for initialization number 9C4H (2500)
Registration status of the data for initialization
number 9D3H (2515)
Buffer memory address b15 b14 b13 b12
Un\G551
Un\G552 0 0
Registration status of the data for initialization
number 9E1H (2529)
Registration status of the data for connection
number 9D4H (2516) to to to b2 b1 b0
0 (OFF) : No registration
1 (ON) : Registration exists
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
195
9
■
For user frame registration: Registration data byte count designation area (Un\G6912, 6953
)
• The initialization data or data for connection can be registered in the buffer memory as well as the flash ROM of C24.
Data type Registration destination
Initialization data Flash ROM
Registration number (Decimal
(Hex.))
2000 to 2013 (7D0H to 7DDH)
Data for connection
Buffer memory
Flash ROM
Buffer memory
Data registered by the operating system
User-registered data
(All registered by user)
(All registered by user)
(All registered by user)
2500 to 2529 (9C4H to 9E1H)
-32767 to -32737 (8001H to 801FH)
3000 to 3029 (BB8H to BD5H)
-32767 to -32737 (8001H to 801FH)
A registration number to register data for initialization or data for connection to the buffer memory is in the range of -32767 to
-32737 (8001H to 801FH) respectively, which is determined by the area to be used.
• In this area, the number of bytes for the data for initialization or data for connection (for 1 data) to be registered in the buffer memory is designated.
• For more information on how to register data for initialization or data for connection in the buffer memory, refer to the following sections.
(
Page 209 Register/read/delete data for initialization,
Page 213 Register/read/delete data for connection)
Buffer memory address Un\G6912 b15 to
0 to 78/80 b0
Un\G8142 0 to 78/80 (Number of bytes)
0: No registration data
1 to 78: Registration data exists (for initialization)
80: Registration data exists (for connection)
■
For user frame registration: User frame specification area (Un\G6913 to 6952, 6954 to 6993
)
• Designate the applicable data (for 1 data) for the above registration data byte count when registering the data for initialization or data for connection in the buffer memory.
• For more information on how to register data for initialization or data for connection in the buffer memory, refer to the following sections.
(
Page 209 Register/read/delete data for initialization,
Page 213 Register/read/delete data for connection)
Buffer memory address Un\G6913 to
Un\G6952 b15 to
Data for initialization or data for connection
(Area for registration number 8001H) b0
Un\G8143 to
Un\G8182
Data for initialization or data for connection
(Area for registration number 801FH)
■
Auto modem initialization designation (Un\G8199)
• Designate whether the modem on the C24 side is initialized automatically or not.
• Registration in this area is performed with Engineering tool.
The modem is initialized automatically when C24 starts up after the CPU module restarts.
■
Modem initialization DR (DSR) signal enable/disable designation (Un\G8200)
Set "DR signal enabled" for this setting.
This setting is used to designate how the DR (DSR) signal is treated only when modem initialization is performed. Following the completion of modem initialization, data is sent according to the status of the DR (DSR) signal.
■
Complete signal handling for modem function designation (Un\G8201)
Set "Turn ON/OFF X13, X14" (default value) for this setting.
196
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
■
Line disconnection wait time (for PLC CPU monitor) (Un\G8206)
• When transmitting data using the programmable controller CPU monitoring function, designate the time between data transmission from C24 and completion of data transmission from the modem on the host station side to the target device side (wait time to disconnect the line).
• Specify the line disconnection wait time in accordance with the specifications of the modem to be used.
Details of buffer memory (for the remote password function)
Each of the areas described below is valid when C24 performs the remote password check.
■
Remote password mismatch notification count designation (Un\G8204)
• Designate the count that will be the timing to notify the CPU module that a remote password mismatch occurred during the unlock processing by the user/target device after the modem line has been connected with 0 to FFFFH.
• Confirming the accumulated number of times of occurred remote password mismatch up to the present time after the line connection is not available.
■
Remote password mismatch notification accumulated count designation (Un\G8205)
• Designate the accumulated count that will be the timing to notify the CPU module that a remote password mismatch occurred during the unlock processing by the user/target device after C24 has been started up with 0 to FFFFH.
• The accumulated number of times remote password mismatch occurred up to the present time from C24 startup
(accumulated count value by C24) can be checked in the 'Accumulated count of unlock process abnormal completion'
(Un\G8956).
■
Accumulated count of unlock process normal completion (Un\G8955)
The accumulated number of times the remote password unlock process has been completed normally is stored.
■
Accumulated count of unlock process abnormal completion (Un\G8956)
The accumulated number of times the remote password unlock process has been completed abnormally is stored.
■
Accumulated count of lock process by line disconnection (Un\G8959)
The accumulated number of times C24 has automatically performed the lock processing due to a modem line disconnection is stored.
9
The supplemental information for each of the accumulated count stored in Un\G8955, 8956, and 8959 is shown below:
• The value can be cleared by writing "0" to the corresponding area of the buffer memory.
• The accumulated count will be stored as 0H 1H 2H FFFFH 0H 1H .
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
197
Considerations for using the modem function
Considerations for using the modem function to perform data communication with a target device via public line are shown below.
Modem connection and disconnection
When performing data communication with a target device, it must be predetermined which station is to perform the line connection (dialing) and disconnection processing with the target device as well as the timings.
Reception data before connection completion
Until the connection processing to the modem is completed, the received data other than modem commands is ignored (read and discarded) at the interface that uses the modem function.
(Example) C24 will ignore the data even when an MC protocol command message is received.
Transmission control
Delays may occur in transmission controls to notify the data reception capability at the host station to the target device.
The amount of transmitted/received data and the interval must be determined beforehand in order to prevent any conditions in which the target device cannot receive transmitted data.
When transmitting/receiving data in the nonprocedural protocol, the procedure must also be predetermined.
Priority of data communication
The data transmission/reception processing with the target device after line connection has been established is performed in the order of the processing request occurrence.
At the same time, when the line disconnection processing or data transmission/reception (including data transmission processing, reception processing and flash ROM access processing) occurs, the line disconnection processing has the priority.
Data communication time
The data transmission/reception time after line connection has been established with the target device is the total time of the transmission time between C24 and modem/TA, between modem and TA, and between modem/TA and target device.
When communicating via the MC protocol, the transmission time (such as T0 and T3) must include the transmission time between the modem/TA on the C24 side and the target device.
For details, refer to the following manual.
MELSEC Communication Protocol Reference Manual
Initial Settings
The data for connection, which is used for the modem function, can be registered as follows depending on how to set.
Set the telephone number and message within the allowable number of registration characters for modem/TA.
■
Registering using Engineering tool
• Up to 254 bytes can be set for comments. (Not used for control.)
• Up to 62 bytes can be set for telephone number.
■
Registering by the CPU module (program)
• Comments cannot be set.
• Up to 18 bytes can be set for telephone number.
Programmable controller CPU monitoring function
For considerations for transmitting monitored results with the modem function, refer to the following section.
Page 179 Modem connection error
198
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
Remote password check
■
How to unlock the remote password
• When C24 has been set as a subject to the remote password check with the CPU module parameter, a remote password unlock processing must be performed from the target device after line connection before starting data communication.
• The unlock processing for the CPU module remote password is performed as follows:
When communicating using MC protocol: Perform the unlock processing from the target device using dedicated commands.
■
When the remote password unlock processing is completed abnormally
• Repeat the unlock processing after checking the remote password set in the CPU module.
• Start with the line connect processing again if C24 'Connection' (X12) turns OFF due to the unlock processing abnormal completion.
• Perform the line connect processing again after clearing the accumulated count stored in the following buffer memory when the 'CH Error occurrence' (XE/XF) of C24 turns ON and the ERR LED lights up due to the unlock processing abnormal completion.
(Target buffer memory)
'Accumulated count of unlock process abnormal completion' (Un\G8956)
(How to clear)
Write "0" to the relevant area of the buffer memory.
■
When the number of times remote password mismatch occurs is large
• When the number of times notification of a remote password mismatch is received exceeds the 'Remote password mismatch notification count designation' (Un\G8204) , C24 disconnects the line automatically. (The 'Connection' (X12) turns
OFF.)
After confirming the remote password registered in the CPU module and the remote password specified in the target device, restart form the line connection.
• When the count exceeds the 'Remote password mismatch notification accumulated count designation'(Un\G8205), C24 performs the following processing every time the mismatch occurs (The line to the modem is not disconnected.)
An error code (7FE8H) is stored in the 'MC protocol send error code' (Un\G602/618) on the buffer memory.
The 'CH Error occurrence' (XE/XF) turns ON and the ERR LED turns ON.
• The accumulated number of times remote password mismatch occurred up to the present time (accumulated count value by C24) can be checked in the 'Accumulated count of unlock process abnormal completion' (Un\G8956).
• The accumulated number of times up to the present time should be cleared by writing "0" to the 'Accumulated count of unlock process abnormal completion' on the buffer memory (Un\G8956).
9
• If the 'CH Error occurrence' (XE/XF) for C24 turns ON and the ERR LED turns ON, this may indicate improper access from the target device. Refer to "CPU module side countermeasures against improper access from a target device".
(
Page 200 CPU module side countermeasures against unauthorized access from a target device)
• For details on how to turn OFF the ERR LED of C24, refer to the following manual.
(
Page 492 Turning OFF the ERR LED and initializing the error codes)
• 'CH Error occurrence' (XE/XF) turns OFF when the data transmission/reception processing is performed normally.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
199
CPU module side countermeasures against unauthorized access from a target device
The following is an example of performing, on the programmable controller CPU side, the line disconnect processing against the target device and prohibiting receive via a modem when the number of "remote password mismatch" detected by the C24 remote password check function exceeds the number set by the user.
• Determine at the user side the count and accumulated count for notification when a remote password mismatch occurs in the unlock processing from external devices with respect to the remote password set in the CPU module.
(
Page 197 Details of buffer memory (for the remote password function))
• Set the above counts to the items below for the module parameters in order for C24 to operate, and register them in C24.
Set in "Remote password mismatch notification count."
Set in "Remote password mismatch notification accumulated count."
• In addition to initialization commands used in normal modem initialization, specify "No automatic receive" and additionally register the modem initialization command for this step to C24. (No automatic receive: This is the setting to prohibit line connection from the target device.)
• Constantly monitor the rise (OFF ON) of the 'CH Error occurrence' (XE/ XF) when connecting the line to the target device using the modem function after the system begins operating.
• Monitor the following buffer memory when the error occurred signal turns ON.
'MC protocol send error code' (Un\G602)
• Perform the line disconnect processing to the target device when the error code stored in the above buffer memory is
7FE8H.
(Use the 'Modem disconnection request' (Y12).)
• After the above line disconnection processing is completed, specify the modem initialization command for which "No automatic receive" has been specified and perform modem initialization only. (
Page 231 Data communication)
• Describe the above occurrence to the system manager and take necessary measures.
■
Program example
When the number of times a remote password mismatch occurred exceeds the notification accumulated count setting value during the remote password unlock processing in communication using MC protocol with the C24 CH1 side interface used.
Category
Module label
Label name
C24_1.stnCH1.bSts_Error
C24_1.bSts_ModemInitializationCompletion
C24_1.bSts_ConnectionProcessing
C24_1.bSts_Initialization_Connection_AbnormalCompletion
C24_1.bSts_DisconnectionCompletion
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.bSet_Req_ModemInitialization
C24_1.bSet_Req_Disconnection
C24_1.uSet_DataNum_Initialization_ModemFunction1_D
C24_1.uErrorCode_ModemFunction_D
C24_1.stnCH1.uErrorCode_MC_ProtocolTransmissionErrCode_
D
C24_1.wnForUserRegistrationNo8005H_D[0]
C24_1.uCount_RemotePasswordAccumulatedUnlockProcNormal
_D
Label to be defined Define the global label as shown below.
Description
CH1 Error occurrence
Modem initialization completion
Connection
Initialization/connection abnormal completion
Modem disconnection completion
Module READY
Watchdog timer error
Modem initialization request
Modem disconnection request
Data No. for initialization designation
Modern function error code
Protocol transmission error code
User registration number 8005H
Accumulated count of unlock process normal completion
Device
X0E
X10
X12
X13
X14
X1E
X1F
Y10
Y12
U0\G52
U0\G545
U0\G602
U0\G7076
U0\G8955
200
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
201
9
202
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
Number of modules for which the remote password check can be set
Up to eight modules can be registered as the remote password applicable module in the CPU module.
*1
For the settings of the remote password applicable module, use the "Remote Password Setting" screen of Engineering tool.
*1 The remote password applicable modules are as follows:
C24
Ethernet module
Built-in Ethernet port CPU module
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.3 Specifications of Modem Function
203
9.4
Startup of the Modem Function
This section explains the startup procedures, processing methods and programming when the modem function of C24 is used.
Startup procedure of the modem function
The following shows the procedure to start the modem function and start data communications.
Procedure up to initialization of C24 modem/TA
Initialize the modem/TA connected to C24 in order to use the modem function. Initialization of the modem/TA enables respective communications.
Start
Determine the system configuration.*1
Verify the C24 specifications.*2
Installation to the base unit
Supplying power to the station with C24
Individual station test of C24 After the individual station test, turn off the power supply to the station with C24.
Connecting C24 and modem/TA After setting the modem/TA switch, connect it with the included RS-232 cable or any designated cables.
Supplying power to the modem/TA
Supplying power to the station with C24
Supply power from the modem/TA side.
Setting and registration with Engineering tool
Parameter setting of C24 Parameter setting of the C24 to
CPU module
Transmission setting (Other than operation setting (OFF) should be set according to the modem/TA.) Communication protocol setting (set accordingly) Station number setting (0 to 31)
Registration in CPU module (Writing to programmable controller)
Initial setting of C24*4,*5
Initial setting of C24
(Setting with
Engineering tool)
Registration of the data for initialization*6
Registration of data for connection*7
Initialization of the modem/TA(modem function system setting)*8
Data communication *9
*1
*2 MELSEC iQ-R Serial Communication Module User's Manual(Startup)
*3
Page 492 Individual station test
*4
Page 206 Initial settings of Serial communication module
*5
*6
Page 209 Register/read/delete data for initialization
*7
Page 213 Register/read/delete data for connection
*8
Page 217 Initialization of modem/TA (terminal adapter)
*9
Page 205 Procedure for data communication
204
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Procedure for data communication
Line Connection Waiting side
C24
Perform the processing up to
the modem/TA initialization.
0
1
Modem initialization
Line connection wait state Modem initialization completion signal (X10 = ON)
2
Line connection completed
Connection signal (X12)=ON
Execute data communications.
Modem disconnection completed
Connection signal (X12)=OFF
3
5
Line connection wait stateModem initialization completion signal(X10)=ON 3
Modem Modem
Line Connection*1
Remote password unlock processing indicates processing performed by the user.
Line Connection Side
C24 or target device
Perform the processing up to the modem/TA initialization.
Modem initialization
Modem initialization completion signal (X10)=ON
Execute line connection.
Connection request signal (Y11)=ON
Line connection completed
Connection signal (X12)=ON
Execute data communications.
* If MC protocol communications are carried out with the target device, when a remote password is set in the RCPU, unlock the remote password.
Data communication*2
Line disconnection*3
Remote password lock processing
The line is disconnected after data communications are completed.
Modem disconnection request signal (Y12)=ON
Modem disconnection completed
Modem disconnection signal (X14)=ON
Connection signal (X12)=OFF
Modem initialization completion signal (X10)=OFF
* By completing the line disconnection, lock processing of the remote password is executed automatically.
If data communications is to be executed again, carry out communications after line connection from the target device.
*1
*2
*3
* Shows the value stored for the modem function sequence status (Address 546 (221H)).
If data communications are to be executed again, start the procedure from the modem initialization.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
205
Initial settings of Serial communication module
This section explains the initial settings of C24 for data communication with a target device by using the modem function.
Communication protocol setting, Communication speed setting, Transmission setting
Setting item
Test mode setting
Communication protocol setting
Data communication
No specification
• MC protocol (Formats 1 to 5)
• Nonprocedural protocol
• Bidirectional protocol
(Set according to modem/TA on the host station)
Independent
(Set according to modem/TA on the host station)
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
(Set according to system specification)
0 to 31
206
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Initial settings with Engineering tool
■
Initial settings for the side of interface that uses the modem function
Perform initial settings on the side of interface that uses the modem function.
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "Modem function setting"
● : Required item : Configurable : Setting not required
Setting item Data communication
(MC, Nonprocedural ,Bidirectional)
Modem function specification 1
Modem function specification 2
Modem function specification 3
For remote password function
Modem connection CH specification
Connection re-try count designation
Connection retry interval designation
Initialization/connection timeout designation
Number of initialization retries designation
Data No. for initialization designation *1
Data No. for connection designation
No-communication interval time designation
RS/CS control enable/disable designation
Auto modem initialization designation
Modem initialization DR (DSR) signal enable/disable designation
Line disconnection wait time (for PLC CPU monitor)
Remote password mismatch notification count designation
Remote password mismatch notification accumulated count designation
●
●
●
*1 For details on how to register the data No. for initialization, refer to the following section.
Page 209 Register/read/delete data for initialization
For details on how to register the data No. for connection, refer to the following section.
Page 213 Register/read/delete data for connection
*2 Even if the CPU module on the station with C24 (host station) becomes STOP status under the following circumstances, the line
(telephone) with the target devices will be left connected.
To prevent the line from being left connected when the line is not in use, be sure to make the appropriate settings.
When the CPU module is stopped when the 'Connection' (X12) is in the ON status. (This occurs because the program write after remote stop is enabled.)
When the CPU module stops abnormally during self-diagnosis, etc.
*3 The "Modem initialization DR (DSR) signal enable/disable designation" designates whether the status of the DR (DSR) signal output is valid or invalid at the startup of C24 .
When the DR (DSR) signal = ON is output from the modem, register "valid" for this item.
When the DR (DSR) signal = ON is not output from the modem, register "invalid" for this item.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
207
Precautions
• When setting the no-communication interval time to 'Infinite wait' (setting value = 0), be sure to perform line disconnection processing after the data has been communicated.
• Leaving the line connected for long periods of time without performing line disconnection after data communication has been completed not only will run up a large telephone bill but also may violate electronic communication business laws.
■
Transmissions using the modem function
All communications using the modem function are performed in full-duplex communications. Leave the following initial settings for the interface side that uses the modem function as default.
• CD terminal check : Do not check
• Communication method: Full-duplex communications
■
Processing that corresponds to output signals
The processing to the following output signals cannot be aborted.
Output signal
Y10
Y11
Y12
Request processing name
Initialization request (standby request)
Connection request
Modem disconnection request
Using the following initial settings for the modem function as default is recommended. (When any error occurred, it will end due to the time-out.)
• Connection re-try count: 3 times
• Connection retry intervals : 180 s
• Initialization/connection timeout : 60 s
Also configure the settings for a remote password check when the remote password check is executed to the remote password set in the module CPU. (
Page 197 Details of buffer memory (for the remote password function))
208
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Register/read/delete data for initialization
The section explains the registration/reading/deletion of the data for initialization such as initialization commands for the modem/TA connected to the C24 side for data communication with the target device using the modem function.
Details of the data for initialization
The following shows the registration destination and type of the data for initialization, registration number, and registration count.
Up to 78 bytes of initialization commands can be registered as one data for initialization. (For 78 characters)
Registration destination of data for initialization
CPU module Built-in memory
Types of data for initialization that is registered
Arbitrary data for initialization registered by the user
Registration number of data for initialization
2500 to 2529 (9C4H to 9E1H)
Number of registrations
30
Remarks
C24
SD memory card Arbitrary data for initialization registered by the user
2500 to 2529 (9C4H to 9E1H)
Flash ROM
30
13
• Register the data for initialization after the debug process has been completed.
• By registering data in this area, replacing C24 can be performed easily.
• Register the data for initialization after the debug process has been completed.
• By registering data in this area, replacing C24 can be performed easily.
•
Page 210 Registration contents before shipment
Buffer memory
Data for initialization that is registered before shipment
Arbitrary data for initialization registered by the user
Arbitrary data for initialization registered by the user
2000 to 2013 (7D0H to 7DDH)
2500 to 2529 (9C4H to 9E1H)
-32767 to -32737 (8001H to
801FH)
30
31
• Register the data for initialization after the debug process has been completed.
• Register the data for initialization before the debug process has been completed.
*1 For the priority of the registered data, refer to the following section.
Page 434 PARAMETER REGISTRATION TO CPU MODULE
Considerations for registration of data for initialization
• Do not include CR/LF (data code : 0DH/0AH) in the data for initialization to be registered to C24.
The CR/LF is output at the end of the AT command by C24 at the time of the initialization processing (automatically added).
• The registration status of the data for initialization stored in the flash ROM may be checked in the buffer memory (Un\G550 to 552).
For initial registration, register by designating an unregistered number.
When designating a registration number that has already been registered, first delete the registration data for the designated number prior to registration.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
209
Registration contents before shipment
• The data for initialization registered in the flash ROM of C24 are listed below:
Initialization command Devices Registration number
Hexadec imal
Decimal
7D0H
7D1H
7D2H
7D3H
7D4H
7D5H
2000
2001
2002
2003
2004
2005
7D6H 2006
ATQ0V1E1X1\J0\Q2\V2\N3S0=1
ATQ0V1E1X1\Q2\V2\N3S0=1
ATQ0V1E1X1&K3\N3S0=1
ATQ0V1E1X1&H1&R2&A3&D2S0=1
ATQ0V1E1X1\J0\Q2\N3S0=1
ATE1Q0V1&C1&D2&H1&I0&R2&S0S0
=1
ATE1Q0V1&C1&D2&K3&S0S0=1
Manufacturer
Iwa Corporation
Micro Research Institute, Inc.
Microcom Technologies, Inc.
OMRON Corporation
Sun Electronics Int., Inc.
OMRON Corporation
7D7H
7D8H
7D9H
7DAH
7DCH
7DDH
2007
2008
2009
2010
2012
2013
ATE1Q0V1&C1&D2&K3&S1S0=1
ATE1Q0V1&C1&D2&K3&S0S0=1
ATE1Q0V1&C1&D1\Q2&S0S0=1
ATE1Q0V1&C1&D2\Q3&S0S0=1
AT&S0S0=1
ATX1&S0S0=1
Model
PV-AF2881WW, PV-BF288M2
MC288XE, MC288X1
DESKPORTE22.8S, DESKPORTE33.6S
ME3314B
MS336AF
ME5614B
Sun Electronics Int., Inc.
MS56KAF
Micro Research Institute, Inc.
Matsushita Electric Industrial Company,
Ltd.
OMRON Corporation
MRV56XL
VS-2621A
VC-173
MT128B -D
Sun Electronics Int., Inc.
Sharp Electronics Corporation.
TS128JX
DN-TA1
General devices
• Use the general devices for checking the operation.
• If the modem/TA does not work, create an initialization command appropriate for the modem specification.
• If initialization commands other than listed above are needed, register the data for initialization in the flash ROM or the buffer memory of the C24 and use it.
■
Remarks
• Perform the following setting to the modem/TA connected to the C24 side.
For settings other than listed below, configure the setting in accordance with the modem/TA specifications.
Refer to the instruction manual for the model to be used for details.
Setting content
Display the result code (or, return the result code).
Set the result code to a word.
Perform character echo.
Dial tone and busy tone detection + X1
Set register 0 to 2.
The modem and the serial speed are not equal.
Control RTS/CTS.
Control DSR.
Control DTR.
Enable extension result code (display MNP class).
MNP mode/normal mode auto selection
Setting command example
&Sn
&Dn
\Vn
\N3
AT
Qn
Vn
En
Xn
Sr=n
\Jn
\Qn
210
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Method to register/read/delete data for initialization
The applicable registration area is shown below.
Applicable area
Flash ROM in C24
Method
Register/read/delete operations are executed with Engineering tool.
Remarks
The data for initialization, which is stored in the flash ROM of C24 before shipment, cannot be deleted.
Designated with "\\" to a field to register "\" when Engineering tool is used to register the modem initialization data.
(Example) To register the data of \Q2: \\Q2
CPU module built-in memory Register/read/delete data with
Engineering tool.
SD memory card for the CPU module Register/read/delete data with
Engineering tool.
Buffer memory of C24 Designate the applicable area corresponding to the registration No.
8001H to 801FH, and write (register)/ read the data for initialization.
• For the buffer memory address for user frames and data for initialization, refer to the following section. (
Page 550 Buffer memory list)
■
Setting with Engineering tool
Set with the module extended parameters of C24.
Navigation window [Parameter] [Module Information] Module Name [Module Extended Parameter] [Modem initialization data]
■
For the buffer memory of the C24
• Designate the applicable area corresponding to the registration No., 8001H to 801FH in respect to the area for user frame registration (Un\G6912 to 8128), and write (register)/read the data for initialization.
When deleting the data for initialization, write "0" to the registration data byte count designation area of the applicable number.
• The following shows the overview of buffer memory that are used for writing/reading/deleting processing for data initialization and the setting value of each area.
For more details, refer to the following section. (Refer to it by substituting the user frame to data for initialization.)
(
Page 282 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION)
Address
Decimal
Name Designated/stored value Designation required ( )/ not required ( )
Write Read Delete Hexade cimal
1B00H 6912
1B01H 6913
Registratio n No.
8001H
Registration data byte count designation
0: When deleting
1 to 78: Number of registered data bytes
(Only for the initialization command section)
User control data Any data used by the user to control data to be registered (manufacturer code, control number, etc.)
Initialization command Data code for the initialization command for registration
(Read processin g not required)
1B02H to
1B28H
1B29H
6914 to
6952
6953
1B2AH
1B2BH to
1B51H
1FCEH
6954
6955 to
6993
8142
Registratio n No.
8002H
Registration data byte count designation
0: When deleting
1 to 78: Number of registered data bytes
(Only for the initialization command section)
User control data Any data used by the user to manage the registration data (manufacturer code, control number, etc.)
Initialization command Data code for the initialization command for registration
(Read processin g not required)
1FCFH
1FD0H to
1FF6H
8143
8144 to
8182
Registratio n No.
801FH
Registration data byte count designation
0: When deleting
1 to 80: Number of registered data bytes
(Only for the initialization command section)
User control data Any data used by the user to manage the registration data (manufacturer code, control number, etc.)
Initialization command Data code for the initialization command for registration
(Read processin g not required)
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
211
■
Program example
The following shows an example of a program used to write (register) data for initialization.
Writing data for initialization to the area of which registration number 8001H
Category Label name
Module label C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.wnForUserRegistrationNo8001H_D[0]
Label to be defined Define the global label as shown below.
Description
Module READY
Watchdog timer error
For user registration number 8001H
Device
X1E
X1F
U0\G6912
(0)
(3)
(6)
Turn the READY flag ON.
Designate initialization data registration.
Set the registration data byte count.
Set the user control data (control number).
Set the AT command for initialization to buffer memory.
Set the initialization flag.
(Item name) Data register
Number of registered data bytes
User control data
Initialization command
D0
D1
D2 to
D13
30
1
Initialization command
(Address)
Un\G6912
Un\G6913
Un\G6914 to
Un\G6925 to
Un\G6952
Buffer memory
Area for registration
No. 8001H
30
1
Initialization command
Data for initialization
212
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Register/read/delete data for connection
This section explains the registration/reading/deletion of data for connection such as the telephone number of the target device that are used for communicating data with target devices using the modem function.
Details of the data for connection
The following shows the registration destination and type of the data for connection, registration number, and registration count.
The maximum number of bytes for data that can be registered as one data for connection is 80 bytes. (Connection data portion: 44 bytes, free: 36 bytes)
Registration destination of data for connection
CPU module Built-in memory
Types of data for connection that is registered
Data registered by the user *1
Registration number of data for connection
3000 to 3029 (BB8H to BD5H)
Number of registrations
30
Remarks
C24
SD memory card
Flash ROM
Buffer memory
Data registered by the user
3000 to 3029 (BB8H to BD5H)
3000 to 3029 (BB8H to BD5H)
-32767 to -32737 (8001H to
801FH)
30
30
31
• Register the data for connection after the debug process has been completed.
• Registration in this area enables easy replacement of
C24.
• Register the data for connection after the debug process has been completed.
• Registration in this area enables easy replacement of
C24.
• Register the data for connection after the debug process has been completed.
• Register the data for connection after the debug process has been completed.
*1 For the priority of the registered data, refer to the following section.
Page 434 PARAMETER REGISTRATION TO CPU MODULE
Considerations for registration of data for connection
• The registration status of the data for connection stored in the flash ROM can be checked in the buffer memory (Un\547 to
549).
For initial registration, register by designating an unregistered number.
When designating a registration number that has already been registered, first delete the registration data for the designated number prior to registration.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
213
Method to register/read/delete data for connection
■
Setting with Engineering tool
Set the data using the C24 module extended parameter.
Navigation window [Parameter] [Module Information] Module Name [Module Extended Parameter] [Modem connection data]
● : Required item : Configurable : Setting not required
Setting item Data communication
(MC, nonprocedural, bidirectional)
Modem connection data 1 to 30 Telephone number
External line outgoing number
Line type
Wait time for message transmission (unit: s)
Message
Comment
●
■
For the buffer memory of C24
• Designate the applicable area corresponding to the registration No., 8001H to 801FH in respect to the area for user frame registration (Un\G6912 to 8128), and write (register)/read the data for connection.
When deleting the data for connection, write "0" to the registration data byte count designation area of the applicable number.
• The following shows the overview of buffer memory that are used for writing/reading/deleting processing for data connection and the setting value of each area.
For more details, refer to the following section. (Refer to it by substituting the user frame to data for connection.)
(
Page 282 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION)
Address
Decimal
Name Designated/stored value Designation required ( )/not required ( )
Write Read Delete Hexade cimal
1B00H
1B01H to
1B28H
1B29H
1B2AH to
1B51H
6912
6913 to
6952
6953
6954 to
6993
Registration No.
8001H
Registration No.
8002H
Registration data byte count designation
Data for connection
Registration data byte count designation
Data for connection
0: When deleting
80: Number of registered data bytes
Data for connection that is registered
0: When deleting
80: Number of registered data bytes
Data for connection that is registered
(Read processin g not required)
(Read processin g not required)
1FCEH
1FCFH to
1FF6H
8142
8143 to
8182
Registration No.
801FH
Registration data byte count designation
Data for connection
0: When deleting
80: Number of registered data bytes
Data for connection that is registered
(Read processin g not required)
214
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
• The following shows the data arrangement of the area for data for connection (area corresponding to registration numbers
8001H to 801FH) in the buffer memory that is used to register, read and delete data for connection, as well as the designated values and stored values.
Data for connection
(H) (L)
(Open) (36 bytes)
(Open) (36)
Connection data area (44 bytes)
(Open) (2)
Telephone number (18)
External line dialing (2)
Line types (2)
(Open) (20)
(Data name (number of bytes))
● Connection data portion (44 bytes)
Data name
(Open)
Telephone number
External line outgoing number
Line type
(Open)
(Open)
Designated/stored value and contents
Designate "0".
• Designate the telephone number of the target device side to establish the line connection to the target device side with which data are communicated.
• When the phone number is less than 18 characters, a space (code:20H) must be entered for the remainder.
Designate the external line outgoing number on the C24 side to establish the line connection to the target device with which data is communicated.
■ External line outgoing number on the C24 side
• 0 to 9
• 10(*)
• 11(#)
■ No external line outgoing number required on the C24 side
• 255
Designate the line type used to perform data communication with the target device.
• 0: Pulse
• 1 : Tone
• 2: ISDN
Designate "0".
Designate "0".
2
2
20
36
Number of bytes
2
18
Data type
Binary
ASCII
Binary
Binary
Binary
Binary
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
215
■
Program example
An example of a program used for writing data for connection is shown below.
Example of writing data for connection to the registration number 8002H area
Category Label name
Module label C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.wnForUserRegistrationNo8002H_D[0]
Label to be defined Define the global label as shown below.
Description
Module READY
Watchdog timer error
For user registration number 8002H
Device
X1E
X1F
U0\G6953
(0)
(3)
(6)
Turn the READY flag ON.
Issue the registration command of data for connection.
Set the number of registered data bytes.
Clear the storage device of data for connection.
Set the connection target telephone number.
Set the external line outgoing number (send 0).
Set the line type to 'Tone'.
Write the data for connection to buffer memory.
Turn the data for connection registration completion flag ON.
(Item name) Data register
Number of registration data bytes
Data for connection
D0
D1 to
D22
D23 to
D40
80
(Connection data)
(Open)
(Address)
Un\G6953
Un\G6954 to
Buffer memory
Area for registration No. 8002H
80
(Connection data)
Un\G6975
Un\G6976 to
Un\G6993
(Open)
216
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Initialization of modem/TA (terminal adapter)
This section explains the initialization of the modem/TA connected to C24, used for communicating data with the target device with the modem function.
Requirements for initialization
Complete the following settings and registration in advance.
• C24 initial settings (
Page 206 Initial settings of Serial communication module)
• Registration of data for initialization when initializing with the data for initialization set by the user (
Page 209 Register/ read/delete data for initialization)
Initialization and connection can be performed at the same time by performing the connection processing by designating data for initialization and connection. (
Registering data for initialization using Engineering tool
Registration of the number of data for initialization to initialize the modem connected to the C24 side is performed with
Engineering tool.
The following explains the number designated by the "Initialization data number" item and the related buffer memory when "0" is designated as the number of data for initialization.
Used buffer memory
Name
The number of data for initialization used and buffer memory designated value
Address (CH1/CH2)
Hexadeci mal
Decimal
34H 52
When number of data used = 1
Data No. for initialization designation
Sending user frame number B6H/156H 182/342
7D0H to 801FH :Registration number of data
(Not used)
When number of data used = 2 or more
0H
B7H/157H
B8H/158H
183/343
184/344
(During initialization, the registration number of data currently being transmitted is stored.)
0 (default value)
CR/LF output designation
Output start pointer
Output quantity designation
Send frame number designation
1st
2nd to
100th
B9H/159H
BAH/15AH
BBH/15BH
185/345
186/346
187/347 to to
11DH/1BDH 285/445
7D0H to 801FH :Registration number of data
*1 'Output start pointer designation' (Un\G184/344)
The head position (nth) in the send frame number designation area to write the registration number of data for initialization to be transmitted is designated.
1 (transmitting from the 1th) to 100 (transmitting from the 100th)
*2 'Output quantity designation' (Un\G185/345)
How many data for initialization is transmitted form the designated position in the output start pointer designation area is designated.
1 (transmitting 1) to 100 (transmitting 100)
*3 The registration number of data for initialization to be used is designated.
7D0H to 7DDH (2000 to 2013) : Data registered by the operating system
9C4H to 9E1H (2500 to 2529) : Data registered in the flash ROM by the user
8001H to 801FH (–32767 to –32737): Data registered in the buffer memory by the user
Considerations for modem/TA initialization
If the DSR signal from the modem/ TA turns OFF when modem/TA initialization is completed (X10 turns ON), C24 executes initialization processing automatically in accordance with the following.
• When the auto modem initialization is specified
Modem/TA initialization processing is executed in the initialization/connection timeout time interval while the DSR signal is
OFF regardless of the ON/OFF status of the 'Modem initialization request' (Y10).
• When the auto modem initialization is not specified
The modem/TA initialization processing is executed when the DSR signal restarts regardless of the ON/OFF status of the
'Modem initialization request' (Y10).
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
217
9
Automatic modem/TA initialization (Setting with Engineering tool)
By configuring the settings for automatic modem initialization with Engineering tool, modem initialization is executed automatically when C24 starts up.
The 'Modem initialization completion' (X10) turns ON.
■
Settings for auto initialization of the modem / TA
Select "Automatically initialize" for the auto modem initialization designation of Engineering tool.
■
Considerations for initializing the modem / TA automatically
● If the modem's initialization processing is completed abnormally, C24 executes the following processing.
• C24 does not turn ON the 'Initialization/connection abnormal completion' (X13).
• C24 stores an error code in the 'Modem function error code' (Un\G545).
• C24 retries the modem initialization automatically by using the initialization/connection timeout time stored in the
'Initialization/connection timeout designation' (Un\G50), and repeats it until the initialization is completed normally.
When modem initialization is not completed normally, perform the following, and restart the station where C24 is installed.
Check the set initialization data number.
Check the registered contents of the initialization data corresponding to the set initialization data number. (If any abnormal, correct them and register them again.) Check if the power of the modem is turned ON.
● When the 'Modem disconnection request' (Y12) is used from the C24 side, the 'Modem initialization completion' (X10) turns
OFF together with the 'Connection' (X12).
When connecting to the line again, start from the modem initialization.
When the line to C24 is disconnected from the target device side, the C24's 'Modem initialization completion'
(X10) does not turn OFF.
When desiring to disable reception by the C24 side's modem, execute line disconnect by the 'Modem disconnection request' (Y12).
218
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Modem/TA initialization with a program
■
I/O signals used for initialization
The 'Modem initialization request' (Y10), 'Modem initialization completion' (X10) and 'Initialization/connection abnormal completion' (X13) are used.
Ex.
When initializing the modem connected to CH1 of C24 using two set of data for initialization (registration numbers 8001H and
8002H) that are registered in the buffer memory
Address Buffer memory
Un\G182 Frame number being transmitted
Un\G183 CR/LF output designation
(Designated value)
0
0
Un\G184 Output head pointer designation
Un\G185 Number of outputs
Un\G186 1st unit
3
2
9C4H
Un\G187
Un\G188
Un\G189
Transmission frame number
Un\G190
Un\G191
2nd unit
3rd unit
4th unit
5th unit
6th unit
9C5H
8001H
8002H
9D0H
9D1H
Out of the transmission frame numbers, from which one the transmission will be initiated is designated.
Out of the transmission frame numbers, the number of units to be transmitted is designated.
Data for initialization registration number is designated.
* The C24 will transmit the data for initialization in the designated order.
Must be designated prior to the modem initialization request.
Initialization request Y10
Modem initialization completion
Initialization/connection abnormal completion
X10
X13
(Normal completion)
(Abnormal completion)
After the designated number of initialization retries have been executed
Initialization data Registration No.8002H
C24
Initialization data Registration No.8001H
9
Modem
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
219
■
Program example
An example of the modem/TA initialization program on the C24 side by the CPU module is shown below.
(When the data for initialization has been registered with Engineering tool or from the CPU module)
Category
Module label
Label name
C24_1.bSts_ModemInitializationCompletion
C24_1.bSts_ConnectionProcessing
C24_1.bSts_Initialization_Connection_AbnormalCompletion
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.bSet_Req_ModemInitialization
C24_1.uErrorCode_ModemFunction_D
Label to be defined Define the global label as shown below.
Description
Modem initialization completion
Connection
Initialization/connection abnormal completion
Module READY
Watchdog timer error
Modem initialization request
Modern function error code
Device
X10
X12
X13
X1E
X1F
Y10
U0\G545
220
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
(0)
(3)
(11)
(14)
(18)
(34)
Turn the READY flag ON.
Turn the modem initialization applicable flag ON.
Issue the modem initialization command.
Set the initialization request signal.
Set the initialization request flag.
Set the initialization completion flag.
Read the error code at initialization abnormal completion.
Reset the flag with the clear command.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
221
9
Line connection
The following explains the connection (dialing) with target devices for data communication with target devices using the modem function.
Requirements for connection
Complete the following settings and registration in advance.
• The initial settings for C24 (
Page 206 Initial settings of Serial communication module)
• The registration of the data for initialization (
Page 209 Register/read/delete data for initialization)
• The registration of data for connection (
Page 213 Register/read/delete data for connection)
• The initialization of the modem/TA connected to C24 side (
Page 217 Initialization of modem/TA (terminal adapter))
In addition, both the initialization and line connection can be conducted simultaneously by designating the data for initialization and data for connection to perform connection processing.
For setting of data for initialization to perform initialization and line connection simultaneously, refer to the following sections. It is not explained in this section.
Page 206 Initial settings of Serial communication module
Page 217 Initialization of modem/TA (terminal adapter)
Registering the data for connection using Engineering tool
The number for the data for connection that is used for line connection in order to perform data communication with the target device is registered with Engineering tool.
■
When line connecting from the C24 side
Designate the registration number of the data for connection to be used for "Data No. for connection designation".
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "Modem function setting"
• BB8H to BD5H (3000 to 3029) : Data registered in the flash ROM by the user
• 8001H to 801FH (–32767 to –32737): Data registered in the buffer memory by the user
■
When line connecting from the target device
Since the line connection processing is not necessary on the C24 side, registration of data for connection to connect the line and number setting of data for connection are not required.
222
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Input/output signals used for line connection
'Connection request' (Y11), 'Dialing' (X11), 'Connection' (X12) and 'Initialization/connection abnormal completion' (X13) are used.
Ex.
When performing the line connection only from the C24 side after the completion of initialization
Buffer memory for connection
(Un\G53)
0 3000
Normal completion
Connection request
Y11
Modem initialization completion
Y10
Dialing X11
Connecting X12
(ON)
9
RS-232 CD terminal
Dial
Result code receive *
* Set "Display a result code using the AT command" in the host station side modem.
Abnormal completion
Connection request
Y11
Modem initialization completion
Y10
Dialing X11
(ON)
(OFF) Connecting X12
Initialization/connection abnormal completion X13
RS-232 CD terminal (OFF)
Dial Dial Dial Dial (Dialing)
Retry (In case of three times)
* Connection channel and retry operation are performed using the buffer memory setting.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
223
Ex.
When performing the initialization and the line connection from the C24 side simultaneously
*1 Buffer memory for initialization
(Un\G52)
Buffer memory for connection
(Un\G53)
0 3000
Normal completion
Connection request Y11
Modem initialization completion
X10
Dialing X11
Connecting X12
RS-232 CD terminal
Abnormal completion
* Set "Display a result code using the AT command" in the host station side modem.
Connection request
Dialing
Y11
Modem initialization completion
X10
X11
Connecting X12
Initialization/connection abnormal completion
X13
(OFF)
RS-232 CD terminal (OFF)
Modem initialization
*1
Dial
Result code receive *
Modem initialization
Dialing
Dial Dial Dial Dial
Retry (In case of three times)
* Connection channel and retry operation are performed using the buffer memory setting.
*1
Page 217 Initialization of modem/TA (terminal adapter)
224
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Ex.
When performing the line connection from the target device after the completion of initialization
Buffer memory for connection
(Un\G53)
0
Connection request
Y11
Modem initialization completion
X10
Dialing X11
Connecting X12
(OFF)
(ON)
(OFF)
(Normal connection)
(Normal connection)
RS-232 CD terminal
* Set "Display a result code using the AT command" in the Host station side modem.
Reception
Result code receive *
Unlock processing for the remote password
Remote password
Response
Communication using MC protocol
• The connection channel on the C24 side is set in the module parameter.
• Abnormal processing when the target device initiate the line connection is left entirely to the target device.
There is no method on the C24 side to check a line connection error occurrence at the target device.
• When a remote password check is performed for the CPU module, normal completion of the unlock processing enables data communication thereafter.
Considerations during the line connection
• Prior to data communication with target devices, determine when and which station will perform the line connection (dialing) and line disconnection processing to the target device.
• Use the following method to perform the unlock processing for the CPU module remote password from the target device.
During communication using MC protocol, transmit the dedicated command to the C24 side.
For countermeasures against abnormal completion of the unlock processing, refer to the following section.
(
Page 199 When the remote password unlock processing is completed abnormally)
• When reconnecting the line after disconnection, allow several seconds for the modem before turning ON the 'Connection request' (Y11).
If it (Y11) is turned ON immediately after line disconnection, the modem may not accept the first connection request, resulting in connection failure, and may require to wait the retry time.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
225
Line connection program
An example of a line connection program is shown below.
■
Program example (When establishing the line connection from the C24 side following the completion of initialization)
When the data for connection has been registered with Engineering tool or from the CPU module
Category
Module label
Label name
C24_1.bSts_ModemInitializationCompletion
C24_1.bSts_ConnectionProcessing
C24_1.bSts_Initialization_Connection_AbnormalCompletion
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.bSet_Req_ModemInitialization
C24_1.bSet_Req_Connection
C24_1.uErrorCode_ModemFunction_D
Label to be defined Define the global label as shown below.
Description
Modem initialization completion
Connection
Initialization/connection abnormal completion
Module READY
Watchdog timer error
Modem initialization request
Connection request
Modern function error code
Device
X10
X12
X13
X1E
X1F
Y10
Y11
U0\G545
226
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Registration of data for initialization
Registration of data for connection
Modem/TA initialization
(0)
(3)
(11) to
(14)
Turn the READY flag ON.
Turn the line connection available flag ON.
Register data for initialization.
(41) to
(44)
(75) to
(90)
Register data for connection.
Modem/TA initialization
(106) Issue the line connection command.
(109) Set the connection request signal.
(113) Set the connection completion flag when the connection signal is turned ON (normal completion).
Read the error code at connection error.
(129) Reset the flag with the clear command.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
227
9
■
Program example (When performing the initialization and the line connection from the C24 side simultaneously)
When the data for initialization and connection have been registered with Engineering tool or from the CPU module
Category
Module label
Label name
C24_1.bSts_ModemInitializationCompletion
C24_1.bSts_ConnectionProcessing
C24_1.bSts_Initialization_Connection_AbnormalCompletion
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.bSet_Req_ModemInitialization
C24_1.bSet_Req_Connection
C24_1.uErrorCode_ModemFunction_D
Label to be defined Define the global label as shown below.
Description
Modem initialization completion
Connection
Initialization/connection abnormal completion
Module READY
Watchdog timer error
Modem initialization request
Connection request
Modern function error code
Device
X10
X12
X13
X1E
X1F
Y10
Y11
U0\G545
228
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Registration of data for initialization
Registration of data for connection
(0)
(3)
(12) to
(15)
(42) to
(45)
(76)
Turn the READY flag ON.
Turn the line connection available flag ON.
Register data for initialization.
Register data for connection.
Issue the line connection command.
(79)
(83)
Set the connection request signal.
Set the connection completion flag when the connection signal is turned ON (normal completion).
Read the error code at connection error.
(100) Reset the flag with the clear command.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
229
9
When the line connection is initiated from the target device, any of the registration, setting or connection processing related to the line connection is not necessary.
Data communication is available when the 'Connection' (X12) turns ON after the completion of the C24 modem/TA initialization.
Page 223 Input/output signals used for line connection
For program example of the modem/TA for initialization, refer to the following section.
Page 219 Modem/TA initialization with a program
230
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Data communication
The following explains the considerations for data communication with target devices using the modem function.
Requirements for data communication
■
When communicating data with target devices
Perform the appropriate processing up to line connection or modem/TA initialization, depending on whether or not the line connection is initiated from the C24 side.
After line connection, data communication can be performed using an MC protocol/nonprocedural protocol/bidirectional protocol in full-duplex communication.
• When line connecting from the C24 side, complete the processing up to line connection beforehand. (
• When line connecting from the target device, complete the processing up to the initialization of the modem/TA beforehand.
(
Page 217 Initialization of modem/TA (terminal adapter))
Buffer memory and input/output signals to be used
■
When communicating data with target devices
Only buffer memory and input/output signals used for data communication (MC protocol/nonprocedural protocol/bidirectional protocol) is used.
Communicate data using the ON of 'Connection' (X12) as the interlock signal.
X12
Program for data communication
There is no input/output signal or buffer memory for modem functions used in data communication.
Initialization request
Y10
Modem initialization completion
X10
Connection request
Connecting
Y11
X12
(ON)
(ON)
9
(ON) RS-232 CD terminal
* Set "Display a result code using the AT command" in the host station side modem.
Initialization Dial
Result code receive *
Data communication is possible
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
231
General procedure
This section explains the general procedure for nonprocedural protocol/bidirectional protocol (executed in full-duplex communication) data communication using the modem function between the CPU modules with C24 installed.
■
System configuration
Station A Station B
Public line
RS-232 cable
Modem
Modem
RS-232 cable
■
General procedure
1.
Perform initial setting for C24 at both station A and station B.
2.
Perform modem/TA initialization on station B.
3.
Perform modem/TA initialization and line connection on station A.
4.
Communicate data using the nonprocedural protocol/bidirectional protocol.
5.
In order to end the communication, disconnect line from station A that initiated the line connection.
■
Processing flow
Station A
(connection request side)
Connection Communication Disconnection
Connection request
Y11
Modem initialization completion
X10
Connecting X12
Disconnection request
Disconnection completion
RS-232 CD terminal
Y12
X14
Station B
(connection reception side)
Modem initialization completion
X10
Connecting X12
Disconnection request
Disconnection completion
RS-232 CD terminal
Y12
X14
(ON)
(OFF)
(OFF)
* It is possible to disconnect line from Station B, as well.
232
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Considerations for performing data communication
■
When communicating data with the target device
• When setting the no-communication interval time to 'Infinite wait' (setting value = 0) in the initial setting of C24, be sure to perform line disconnection after the completion of data communication.
• Only the nonprocedural protocol/bidirectional protocol data communication can be performed with the CPU module with
C24 installed.
• C24 automatically performs line disconnection processing if no data communication is performed during the nocommunication interval time.
The 'Connection' (X12) and the 'Modem initialization completion' (X10) turn OFF and the 'Modem disconnection completion'
(X14) turns ON when the line disconnection processing is performed.
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
233
Line disconnection
The following explains the line disconnection upon communication completion when communicating data with the target device using the modem functions.
Input/output signals to be used
Use the 'Modem disconnection request' (Y12) and 'Modem disconnection completion' (X14).
Communication Disconnection
Host station
Modem initialization completion
X10
Connecting X12
Modem disconnection request
Y12
Modem disconnection completion
X14
RS-232 CD terminal
Target station
(C24)
Modem initialization completion
X10
Connecting X12
Modem disconnection request
Y12
Modem disconnection completion
X14
RS-232 CD terminal
(ON)
(OFF)
(OFF)
This is the procedure to take in order to turn off the initialization completion signal (X10).
* In the case of C24, when the line is disconnected from the target device, the initialization completion signal (X10) at the host station is not turned OFF.
• There is no buffer memory for line disconnection processing.
• Line disconnection processing can be conducted from either device as long as the connection is in progress.
• The line disconnection processing disconnects the line connection with the target device as well as the connection with the modem on the C24 side.
• Even when an error occurs during the line disconnection, the disconnection processing will be forced.
• When resuming data communication after line disconnection, start form either one of the following processing depending on the 'Modem initialization completion' (X10).
'Modem initialization completion' is OFF: Start from the initialization of the modem/TA.
'Modem initialization completion' is ON: Start from the line connection with the target device.
234
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
Considerations during the line disconnection
• Prior to data communication with target devices, determine when and which station will perform the line connection (dialing) and line disconnection processing to the target device.
• If the line is disconnected during data transmission, transmission processing will be performed depending on the signal status of the C24 RS-232 interface.
• If the line is disconnected during data reception, data reception will be disabled.
This may cause an error occurrence such as a reception time out.
• When data communication is not performed for the period equivalent to the no-communication interval time designation,
C24 will automatically disconnect the line.
When the line is disconnected, the 'Connection' (X12) and the 'Modem initialization completion' (X10) turn OFF, and the
'Modem disconnection completion' (X14) turns ON.
To turn OFF the 'Modem disconnection completion' (X14), turn ON the 'Modem disconnection request' (Y12) for a second after the 'Modem disconnection completion' (X14) turned ON.
Program for line disconnection
A program example for line disconnection is shown below.
■
Program example
Category
Module label
Label name
C24_1.stnCH1.bSts_TransmissionNormalCompletion
C24_1.stnCH1.bSts_TransmissionAbnormalEnd
C24_1.bSts_ModemInitializationCompletion
C24_1.bSts_DialProcessing
C24_1.bSts_ConnectionProcessing
C24_1.bSts_Initialization_Connection_AbnormalCompletion
C24_1.bSts_DisconnectionCompletion
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.bSet_Req_Transmission
C24_1.stnCH1.bSet_Req_ReceptionReadCompletion
C24_1.bSet_Req_ModemInitialization
C24_1.bSet_Req_Connection
C24_1.bSet_Req_Disconnection
C24_1.uErrorCode_ModemFunction_D
C24_1.wnForUserRegistrationNo8001H_D[0]
C24_1.wnForUserRegistrationNo8002H_D[0]
Label to be defined Define the global label as shown below.
Description
CH1 Transmission normal completion
CH1 Transmission abnormal completion
Modem initialization completion
Dialing
Connection
Initialization/connection abnormal completion
Modem disconnection completion
Module READY
Watchdog timer error
CH1 Reception data read request
CH1 Reception abnormal detection
CH1 Transmission request
CH1 Reception data read completion
Modem initialization request
Connection request
Modem disconnection request
Modern function error code
For user registration number 8001H
For user registration number 8002H
Device
X0
X1
X10
X11
X12
X13
X4
Y0
Y1
X14
X1E
X1F
X3
Y10
Y11
Y12
U0\G545
U0\G6912
U0\G6953
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
235
Registration of data for initialization
Registration of data for connection
Modem/TA initialization
Line connection
236
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
(0)
(11) to
(14)
(41) to
(44)
Turn the READY flag ON.
Register data for initialization
Register data for connection
(76) to
(91)
(107) to
(130)
Modem/TA initialization
Line connection
(133) Turn the data update available flag ON.
(137) Turn the line disconnection available flag ON.
(146) Issue the line disconnection command.
(149) Set the modem disconnection request signal.
(154) Read the error code when modem disconnection completion signal is turned ON.
Set the modem disconnection completion flag after the normal completion.
(172) Reset the modem disconnection request signal.
(181) Line disconnection processing (line disconnection from the target device)
(184) Reset the request signals.
Set the modem disconnection request signal when either of completion signal or connection signal is turned ON.
(193) To turn the 'Modem disconnection completion' (X14) OFF, wait for one second after the 'Modem disconnection request' (Y12) is turned ON.
(201) Reset the request signal when the modem disconnection completion signal is turned ON.
Reset the request signal when the modem disconnection completion signal is turned OFF.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.4 Startup of the Modem Function
237
9
9.5
Sample program
Program for data communication
The following shows sample programs to test the connection between C24s.
Each program contains a minimum set of processing necessary for performing a communication test.
Modify the data for initialization and data for connection in accordance with the system. When adding error-handling procedures, add them separately by referring to the following explanations.
System configuration
The system configuration used in this program is shown below.
Ò Line connection
Ó
Communications by
the non-procedure protocol
Ô
Line disconnection
Modem
Modem
RJ71C24-R2 Ó RJ71C24-R2 Ò
Connection request station side (RJ71C24-R2
) program example
Perform the initialization of the modem connected to the CH1 side interface, line connection, data communication using the nonprocedural protocol, and line disconnection by the command from the user.
■
Parameter list
The following shows the parameters of this sample program.
• Module parameter
Category
Basic settings
Application settings
Setting item
Communication protocol setting
Communication speed setting
Transmission setting Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Modem function setting
Modem function specification 1
Modem connection CH specification
Data No. for initialization designation
Data No. for connection designation
Setting content
Nonprocedural protocol
19200 bps
8
None
Odd
1
Yes
Enable
Enable
0
1CH
07D5H
0BB8H
• Module extended parameter
Category
Modem connection data
Setting item
Modem connection data No.3000
Telephone number
Setting contents
0123456789
238
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
■
Program example
Category
Module label
Label name/FB name
C24_1
C24_1.stnCH1.bSts_TransmissionNormalCompletion
C24_1.stnCH1.bSts_TransmissionAbnormalEnd
C24_1.bSts_ModemInitializationCompletion
C24_1.bSts_DialProcessing
C24_1.bSts_ConnectionProcessing
C24_1.bSts_Initialization_Connection_AbnormalCompletion
C24_1.bSts_DisconnectionCompletion
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.bSet_Req_Transmission
C24_1.stnCH1.bSet_Req_ReceptionReadCompletion
C24_1.bSet_Req_ModemInitialization
C24_1.bSet_Req_Connection
C24_1.bSet_Req_Disconnection
C24_1.uErrorCode_ModemFunction_D
C24_1.wnForUserRegistrationNo8001H_D[0]
C24_1.wnForUserRegistrationNo8002H_D[0]
Description
Target module
CH1 Transmission normal completion
CH1 Transmission abnormal completion
Modem initialization completion
Dialing
Connection
Initialization/connection abnormal completion
Modem disconnection completion
Module READY
Watchdog timer error
CH1 Reception data read request
CH1 Reception abnormal detection
CH1 Transmission request
CH1 Reception data read completion
Modem initialization request
Connection request
Modem disconnection request
Modem function error code
For user registration number 8001H
For user registration number 8002H
Device
X0
X1
X10
X11
X12
X13
X4
Y0
Y1
Y10
X14
X1E
X1F
X3
Y11
Y12
U0\G545
U0\G6912
U0\G6953
9
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
239
Category Label name/FB name
Label to be defined Define the global label as shown below.
Description Device
FB M+RJ71C24_Output
M+RJ71C24_Input
Sends data for specified data points.
Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
240
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
241
9
242
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
243
9
244
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
(0)
(3)
(15)
Accessible
Modem initialization
Data communication available
Data transmission available
Modem disconnection available
Convert the modem initialization and line connection command into pulse.
Jump to the subroutine of the modem initialization and line connection processing.
(26)
(32)
(36)
(41)
(45)
(49)
(53)
(56)
(63)
(69)
Convert the data communication (transmission) command into pulse.
Jump to the subroutine of the data reception processing.
Jump to the subroutine of the receive data.
Jump to the subroutine of the data reception processing.
Convert the line disconnection command into pulse.
Convert the connection signal OFF into pulse.
Jump to the subroutine of the line disconnection processing.
Set the initialization request signal.
(91)
(93)
Set the connection request signal.
Reset the request signal when the initialization completion signal and connection signal are turned ON.
Read the error code when initialization/connection abnormal completion signal is turned ON, and reset the request signal.
(108) Set the transmission channel to CH1.
Set the send data quantity.
Set the send data.
(177) Transmission normal completion
(180) Transmission abnormal completion
(188) Set the data reception channel CH1.
(243) Received data read normal completion
(246) Received data read abnormal completion
(253) Set the modem disconnection request signal.
(255) Read the error code when modem disconnection completion signal is turned ON.
Set the modem disconnection completion flag when normal completion signal is turned ON.
(264) Reset the modem disconnection request signal.
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
245
9
Connection receiving station side (RJ71C24-R2
) program example
Perform data communication using the nonprocedural protocol by the command from the user after the 'Connection' (X12) turns ON.
■
Parameter list
Category Setting item
Basic settings
Application settings
Communication protocol setting
Communication speed setting
Transmission setting Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Modem function setting
Modem function specification 1
Modem connection CH specification
Data No. for initialization designation
Modem function specification 2
Auto modem initialization designation
■
Program example
Category
Module label
Label name/FB name
C24_1
C24_1.stnCH1.bSts_TransmissionNormalCompletion
C24_1.stnCH1.bSts_TransmissionAbnormalEnd
C24_1.bSts_ModemInitializationCompletion
C24_1.bSts_DialProcessing
C24_1.bSts_ConnectionProcessing
C24_1.bSts_Initialization_Connection_AbnormalCompletion
C24_1.bSts_DisconnectionCompletion
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.bSet_Req_Transmission
C24_1.stnCH1.bSet_Req_ReceptionReadCompletion
C24_1.bSet_Req_ModemInitialization
C24_1.bSet_Req_Connection
C24_1.bSet_Req_Disconnection
Description
Target module
CH1 Transmission normal completion
CH1 Transmission abnormal completion
Modem initialization completion
Dialing
Connection
Initialization/connection abnormal completion
Modem disconnection completion
Module READY
Watchdog timer error
CH1 Reception data read request
CH1 Reception abnormal detection
CH1 Transmission request
CH1 Reception data read completion
Modem initialization request
Connection request
Modem disconnection request
Device
X0
X1
X10
X11
X12
X13
X3
X4
Y0
Y1
X14
X1E
X1F
Y10
Y11
Y12
Setting content
Nonprocedural protocol
19200 bps
8
None
Odd
1
Yes
Enable
Enable
0
1CH
07D5H
Automatically initialize
246
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
Category Label name/FB name
Label to be defined Define the global label as shown below.
Description Device
9
FB M+RJ71C24_Output
M+RJ71C24_Input
Sends data for specified data points.
Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
247
248
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
249
9
(0) Accessible
(3)
(31)
Initialize the modem.
Set the transmission channel.
Set the send data quantity.
Set the send data.
Issue the transmission execution direction.
(100) Normal completion
(103) Abnormal completion
(109) Set the reception channel to CH1.
Issue the reception execution direction.
(173) Normal completion
(177) Abnormal completion
250
9 COMMUNICATIONS BY THE MODEM FUNCTION
9.5 Sample program
10
RECEIVING DATA WITH AN INTERRUPT
PROGRAM
In data communications between C24 and a target device, an interrupt program can be used to receive data for the following data communication functions.
• Data reception during communication using the nonprocedural protocol
• Data reception during communication using the bidirectional protocol
This chapter explains data reception with the following data communication function by an interrupt program.
Target device
10
C24
Main program
CPU module
Data transmission
Receive
Interruptissued
Interrupt program execution
Main program
FEND
SM400
BUFRCVS
Receiving data with an interrupt program expedites the process of retrieving received data to the CPU module.
10.1
Settings for Receiving Data Using an Interrupt
Program
The following explains the settings for performing data reception with an interrupt program during communication using the nonprocedural protocol or bidirectional protocol.
For setting for data reception with an interrupt program, set "Interrupt factor" to "BUFRCVS instruction data reception", and set the interrupt pointer to be used in the program to "Interrupt pointer".
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Interrupt Settings"
10.2
Interrupt Program Startup Timing
The following explains the startup timing for interrupt program when performing data reception with an interrupt program during communication using the nonprocedural protocol or bidirectional protocol.
• The startup timing is the same for communication using either the nonprocedural protocol or bidirectional protocol.
• Received data from the target device is stored in the receive area of the buffer memory. When the next input signal rises, the interrupt program is started.
Input signal name
CHn reception data read request signal
CHn reception abnormal detection signal
CH1 side
X3
X4
CH2 side
XA
XB
10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
10.1 Settings for Receiving Data Using an Interrupt Program
251
10.3
Reception Control Method Using an Interrupt
Program
The following explains the reception control method when receiving data with an interrupt program during communication using the nonprocedural protocol or bidirectional protocol.
<Data reception using the dedicated instruction,
BUFRCVS instruction (interrupt program)>
FEND
SM400
I50 Z.BUFRCVS
"U0" K1 D200 Control data
[D200]: Word count for stored receive data
[D201]: Receive data
IRET
Ó Ö
Main program execution
Interrupt program execution
BUFRCVS instruction Ô
Reception data read request signal
Reception abnormal detection signal
Buffer memory reception area
X3
X4
Ò
Õ
Reception using bidirectional protocol
Data reception Response transmission
When data is received from the target device, the receive data is stored in the buffer memory and the 'CH1 reception data read request' signal turns ON.
The main program stops executing and the interrupt program starts.
The data reception dedicated instruction, BUFRCVS, for the interrupt program is executed and data is received.
*1
When the execution of the BUFRCVS instruction is complete, the 'CH1 reception data read request' signal turns OFF.
The execution of the interrupt program is completed, and execution of the main program restarts.
*1 When the reading of received data using the BUFRCVS instruction is finished, the following processes are performed.
At normal completion
CPU module error flag (SM0) turns OFF.
At abnormal completion
CPU module error flag (SM0) turns ON.
The error code is stored in the CPU module error code (SD0).
For more details on the error flag (SM0) and error codes (SD0) of the CPU module, refer to the following manual.
MELSEC iQ-R CPU Module User's Manual (Application)
252
10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
10.3 Reception Control Method Using an Interrupt Program
10.4
Program Example
This section shows programming examples for data reception with an interrupt program in data communications using the nonprocedural protocol or bidirectional protocol.
Program example for data reception
The following shows a program example for data reception with an interrupt program in data communication using the nonprocedural protocol.
■
Parameter list
The following shows the parameters for this program.
Setting item
Interrupt settings CH1 Interrupt factor
Interrupt pointer
Setting content
BUFRCVS instruction data reception
I50
■
Program example
Category Label name
Module label C24_1.stnCH1.bSet_Req_ReceptionRead_D
C24_1.stnCH1.bSts_ReceptionAbnormalDetection_D
C24_1.stnCH1.uSet_ReceiveInterruptIssued_D
Label to be defined Define the global label as shown below.
Description Device
CH1 Reception data read request
CH1 Reception abnormal detection
DX3
DX4
CH1_Receive interrupt-issued designation U0\G8208
10
(0)
(15)
For the CH1 side, designate the receive interrupt-issued designation.
Receive the data.
10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
10.4 Program Example
253
D200
D201
Data register
D2nn
Buffer memory
Reception area
Receive data count
Receive data
• For communication using either the nonprocedural protocol or bidirectional protocol, BUFRCVS instruction is used to receive data with an interrupt program. (
Page 580 Dedicated Instructions)
• To startup an interrupt program, create a program to allow/prohibit interrupt during the main program.
Instruction to be used is EI, DI, and IMASK.
254
10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
10.4 Program Example
10.5
Considerations when Receiving Data with an
Interrupt Program
This section describes the considerations when receiving data with an interrupt program.
• Create an interrupt program for data reception for each interface.
• Do not use the INPUT and BIDIN instructions during execution of the interrupt program.
Always use the BUFRCVS instruction to receive data.
• Do not turn the 'CH reception data read completion' (Y1/Y8) ON/OFF during execution of the interrupt program since C24 turns OFF the 'CH reception data read request' (X3/XA) and the 'CH reception abnormal detection' (X4/XB) for data reception with an interrupt program.
• Use always ON (SM400) or direct input signal (DX3, DX4) as the contact signal when executing the BUFRCVS instruction.
• After the power supply turns OFF ON or the CPU module is reset, data cannot be received because the interrupt program is invalid during the initial processing of the CPU module. For asynchronous data communication with C24 from the target device without communication procedure setting, refer to the program example shown below.
Program example
The following shows an example of program for asynchronous data communications from the target device side to C24 without communication procedure settings on the target device side.
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.uSet_ReceiveInterruptIssued_D
Label to be defined Define the global label as shown below.
Description Device
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
X3
X4
CH1_Receive interrupt-issued designation U0\G8208
10
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
10.5 Considerations when Receiving Data with an Interrupt Program
255
(0)
(61)
(65)
(71)
For the CH1 side, designate the receive interrupt-issued designation.
Processing at normal completion
Processing at abnormal completion
Execute the receive interrupt program.
256
10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
10.5 Considerations when Receiving Data with an Interrupt Program
U0\G8208
11
CHANGING DATA LENGTH UNITS TO BYTE
UNITS (WORD/BYTE UNITS SETTING)
The word units are used for the data length (count) of the amount of data transmitted/received using the following data communication functions in data communication between C24 and target devices.
This chapter explains how to change the units (word byte, byte word) of the data length (count) transmitted/received with the following data communication functions.
The data length units can be set for each C24 interface. C24 controls the number of data to be transmitted to the target device and the number of data when it requests the CPU module to read the data received from the target device according to the units set by the user.
Data communication functions and buffer memory affected by data length units
The following lists the data communication functions and buffer memory which are affected by the data length units.
(The buffer memory addresses in the table are the default value.)
Data communication function
MC protocol
Name of buffer memory related to data length units
On-demand function Data length designation (Un\G161/321)
Nonprocedural protocol
Bidirectional protocol
Data transmission function
Data reception function
Send data quantity designation (Un\G1024/2048)
Receive end data quantity designation (Un\G164/324)
Receive data quantity (Number of data for which read is requested)
(Un\G1536/2560)
Send data quantity designation (Un\G1024/2048)
Reference
MELSEC Communication
Protocol Reference
Manual
Data transmission function
Data reception function
Receive end data quantity designation (Un\G164/324)
Receive data quantity (Number of data for which read is requested)
(Un\G1536/2560)
11
How to change the units of the data length (count)
Change the units of the data length (count) by the either of the following methods.
• Changing with Engineering tool
Set "Word/byte units designation" to "Byte units".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
• Changing by the CPU module
The units can be changed with the CSET instruction. (
Page 580 Dedicated Instructions)
11 CHANGING DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTE UNITS SETTING)
257
MEMO
258
11 CHANGING DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTE UNITS SETTING)
12
CHANGING DATA COMMUNICATION
MONITORING TIME
The monitoring time is time used by C24 to monitor the receiving interval time between each byte when receiving data from the target device, the programmable controller CPU processing time, and the time it takes to transmit to the target device.
The monitoring time can be set for each interface. C24 uses the monitoring time set by the user to control data transmission to and reception from the target device.
Set the monitoring time in accordance with the specifications of the target device.
C24 monitoring times are listed below.
: Configurable : Non-configurable, : Not used
Monitoring time C24 default value Remarks
No-reception monitoring time
(timer 0)
Method
0
Method
1
Response monitoring time (timer 1)
0 bytes
(Unlimited wait)
5 seconds
Protocol that can monitor the time
MC Non Bi Pd
Transmission time for the set number of byte (depending on the transmission speed)
Send monitoring time (timer 2)
Transmission wait time
3 minutes
0 ms
Transmission only for the bidirectional protocol.
No wait time
*1 Nonprocedural and no-reception monitoring time method
The C24 input signal which turns ON when the no-reception monitoring time (timer 0) timed out differs.
Nonprocedural and no-reception monitoring time method
Method 0
Method 1
Input signal which turns ON
Reception abnormal detection (X4, XB)
Reception data read request (X3, XA)
Ex.
Data communication using MC protocol
Command message
Head data
Target device
CPU module
Last data
1 byte
Head data Last data
Response message C24 ready to receive data state
Timer 0 monitoring time
Timer 0 elapsed time reset Timer 1 monitoring time
Message wait time
Timer 2 monitoring time H/W gate OFF time
Timer 2 elapsed time reset
Timer 1 elapsed time reset
12
12 CHANGING DATA COMMUNICATION MONITORING TIME
259
12.1
No-reception Monitoring Time (timer 0) Setting
The no-reception monitoring time (timer 0) is a monitoring time for clearing the state of C24 when it is placed into the data receive wait state by trouble on the target device side.
C24 monitors the reception interval in byte units at the start of data reception from the target device and ends monitoring when the preset last data is received, and it repeats this operation.
The following explains the no-reception monitoring time (timer 0) operation.
1 byte
Target device
CPU module
Data 1 Data 2 Data n-1 Data n
Data receive interval
(depends on the transmission rate, etc.)
Monitoring time
Elapsed time reset
One byte is always handled as 12 bits in the no-reception monitoring time (timer 0), regardless of the transmission setting.
When the no-reception monitoring time (timer 0) is changed by a program, perform any of the following to enable the changed value.
• Mode switching (
Page 409 SWITCHING THE MODE AFTER STARTING)
• UINI instruction ( MELSEC iQ-R Programming Manual (Module Dedicated Instructions))
• Programmable controller CPU information clear (
Page 498 How to Clear Programmable Controller CPU Information)
C24 operation by no reception monitoring time (timer 0)
C24 monitors the reception interval in byte units and returns the elapsed time to 0 each time one byte is received.
At time-out, C24 performs the following processing.
Data communication using the MC protocol
• C24 stores the error code to the 'MC protocol send error code' (Un\G602/618) for the target interface side.
• C24 transmits a NAK message to the target device and waits to receive the next command message.
Data communications using the nonprocedural protocol (Method 0)
■
Data communications not using user frames
• C24 retrieves the received data up to time-out to C24.
• C24 stores the error code to the 'Data reception result' (Un\G600/616) for the target interface and turns ON the 'CH reception abnormal detection' (X4, XB), and waits to receive the next data.
Ex.
Receiving by the receive end code (Receive end code: CR + LF (0D0AH))
When the LF is not received within the set time for timer 0 after reception of the CR, the received data up to the CR is stored in the receive data storage area of the buffer memory and the reception abnormal detection signal to the CPU module turns
ON.
Target device
C24
CR
Timer 0
Set time
(*1)
Reception abnormal detection signal
(X4/XB)
*1 CR is treated as 1 byte of data included in the message.
260
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.1 No-reception Monitoring Time (timer 0) Setting
■
Data communications using user frames
• When designating the final frame, C24 retrieves an arbitrary portion of data in the received data between the start of the reception of the current message and the time-out, and ignores (deletes) the data in the final frame portion.
• C24 stores the error code to the 'Data reception result' (Un\G600/616) for the target interface and turns ON the 'CH reception abnormal detection' (X4, XB) and waits to receive the next data.
Data communication using the nonprocedural protocol (Method 1)
The reception monitoring using Method 1 of the no-reception monitoring time (timer 0) is used to receive a message of which receive end code and receive end data quantity are not determined due to time-out of the no-reception monitoring time (timer
0) in data communication using the nonprocedural protocol.
• Data is received by C24 until the time is out, the 'CH reception data read request' (X3, XA) turns ON, and waits to receive the next data.
Ex.
When receiving using the receive end data quantity (Receive end data quantity: 511 bytes)
After 16 bytes of data is received, the 16-byte data is stored in the receive data storage area of the buffer memory by the time out (timer 0) and the reception data read request signal to the CPU module turns ON.
12
A B C
Timer 0
Set time
Target device
C24
Reception data read request signal
(X3/XA)
Data communications using the bidirectional protocol
• C24 ignores (deletes) the received data from the start of reception of the current message to time-out.
• C24 stores the error code to the 'Data reception result' (Un\G600/616) for the target interface.
• When reading received data is completed, C24 transmits a NAK message to the target device, and waits to receive the next data.
Changing the no-reception monitoring time (timer 0)
Changing the no-reception monitoring time (timer 0)
For the no-reception monitoring time (timer 0), set the number of transmission characters (number of bytes) corresponding to the data transmission speed set to the target interface to "No-reception monitoring time (timer 0) designation".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
Adjust or set the value based on the specifications of the target device.
Nonprocedural no-reception monitoring time method designation (Method 0/1)
For the nonprocedural and no-reception monitoring time method designation, set the method to use the no-reception monitoring time (timer 0) in data communications using the nonprocedural protocol to "Nonprocedural and no-reception monitoring time method designation".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.1 No-reception Monitoring Time (timer 0) Setting
261
Remarks
■
When changing the no-reception monitoring time (timer 0)
Set the no-reception monitoring time (timer 0) to the following number of bytes or greater.
No-reception monitoring time (timer 0) = 1 +
Td × Vbps
12000
(Round up fractions below decimal point.)
Td : Maximum delay time for target device output processing (ms)
Vbps: Transmission rate (bps)
Ex.
Calculation of no-reception monitoring time (timer 0)
Transmission rate (Vbps) : 9600 bps
Maximum delay time for target device output processing (Td) : 50 ms
No-reception monitoring time (timer 0) = 1 +
50 × 9600
12000
= 41 bytes
In this case, actual monitoring time is as shown below:
41 bytes 12
*1 9600 1000 = 51.25 ms
*1 Number of transmit bits per byte (Fixed)
■
When changing the no-reception monitoring time (timer 0) for data communication with a target device through C24 RS-422/485 interface
Set the no-reception monitoring time (timer 0) to the following number of bytes or greater.
No-reception monitoring time (timer 0) = 1 +
(Td + T1) × Vbps
12000
(Round up fractions below decimal point.)
Td : Maximum delay time for target device output processing (ms)
T1 : Target device side hardware gate OFF time (ms)
Vbps: Transmission rate (bps)
262
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.1 No-reception Monitoring Time (timer 0) Setting
12.2
Response Monitoring Time (timer 1) Setting
The response monitoring time (timer 1) is a monitoring time for clearing the receive wait state of the device that receives a response message when any trouble occurs on the side of device which received a message and the response message
(result) cannot be returned to the target device.
When C24 receives a message from the target device, it monitors the CPU module processing time up to the start of transmission of the response message to the target device.
When a message was transmitted, it monitors the target device processing time up to the start of reception of the response message from the target device.
The following describes the response monitoring time (timer 1) operation.
Response message
Target device
CPU module
Message
Response message
Monitoring time
Message
Monitoring time
Elapsed time reset Elapsed time reset
If on-demand data is transmitted before a response message during data communications using the MC protocol, the time up to the start of transmission of the on-demand data is monitored.
Target device
CPU module
Command message
On-demand data
Monitoring time
Response message
Elapsed time reset
C24 operation by response monitoring time (timer 1)
When response monitoring time (timer 1) is set to 0 ms
• After receiving a message, C24 does not monitor the time up to the start of transmission of the response message to the target device, but waits infinitely.
• After transmitting a message, C24 does not monitor the time up to the start of reception of the response message from the target device, but waits infinitely.
When response monitoring time (timer 1) is set to 100 ms or longer
• After receiving a message, C24 monitors the time up to the start of transmission of the response message to the target device and returns the elapsed time to 0 at the start of transmission.
• After transmitting a message, C24 monitors the time up to the start of reception of the response message from the target device and returns the elapsed time to 0 at the start of reception.
At time-out, C24 performs the following processing.
■
Data communications using the MC protocol
• C24 stores the error code to the 'MC protocol send error code' (Un\G602/618) for the target interface.
• C24 transmits a response message (NAK message) to the target device and waits to receive the next command message.
■
Data communications using the bidirectional protocol
• C24 stores the error code to the 'Data transmission result' (Un\G599/615) for the target interface and completes the transmission processing abnormally.
• While waiting to transmit a response message, C24 does not check the response monitoring time.
12
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.2 Response Monitoring Time (timer 1) Setting
263
Changing the response monitoring time (timer 1)
The response monitoring time (timer 1) is registered on "Response monitoring time (timer 1) designation" of the parameter.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
During data communications using the MC protocol, set the response monitoring time so as to be as long as the transmission wait time or longer.
The transmission wait time is designated in the following:
• 1C frame: Designate it is a command message.
• 2C/3C/4C frame: "Transmission wait time designation"
Considerations for data communications using the MC protocol
When changing the response monitoring time (timer 1) default value (5 sec), take into account the following.
Set it as to be as long as the transmission wait time or longer in either case of the following. (
■
When specifying monitor condition
When designating the monitor conditions with the following functions, set the maximum time according to the system operation.
• Random read in word units
• Device memory monitor
■
When accessing by other than above
• When accessing a station connected (including multidrop connection) to a target device, set the following value, or longer.
Response monitoring time Maximum number of scans required to process the command used Connected station scan time
• When accessing another station over a network system, set the default value to 'Unlimited wait', or the following time or longer.
Response monitoring time maximum number of scans required to process the command used communications time
When setting the default value to 'Unlimited wait', check the target device response wait time, and initialize C24 transmission sequence when time-out occurs.
For the maximum number of scans and the communication time required by processing, refer to the following manual.
MELSEC Communication Protocol Reference Manual
Considerations for data communications using bidirectional protocol
when changing the default value (5 seconds) for the response monitoring time (timer 1), set it as to be as long as the following time, or longer.
• (Sequence scan time 2) + 100 ms
264
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.2 Response Monitoring Time (timer 1) Setting
12.3
Send Monitoring Time (timer 2) Setting
The send monitoring time (timer 2) is a monitoring time for clearing the wait state of C24 when C24, which is to transmit a message or response message (result), is placed into the data transmit wait state due to any trouble of the target device side
When C24 transmits a message, it monitors the wait time up to the end of transmission of the message.
When C24 received a message from a target device, it monitors the wait time up to the end of transmission of the response message.
The following explains the send monitoring time (timer 2) operation.
Target device
CPU module
Message
Response message Message
Response message
Target device
CPU module
Monitoring time
On-demand data
Monitoring time
Elapsed time reset
If on-demand data is transmitted before a response message during data communications using the MC protocol, each time is monitored.
Command message
Monitoring time
Response message
Monitoring time
Elapsed time reset
C24 operation by send monitoring time (timer 2)
12
When send monitoring time (timer 2) is set to 0 ms
• The time until transmission of a message or response message has been completed is not monitored.
• If C24 cannot transmit, it waits infinitely.
When send monitoring time (timer 2) is set to 100 ms or longer
• C24 monitors the time from completion of message or response message transmission preparations to the end of transmission, and returns the elapsed time to 0 at the end of transmission.
At time-out, C24 performs the following processing.
■
Data communications using MC protocol
• While waiting for the end of transmission of the response message, C24 stores the error code to the 'Data transmission result' (Un\G599/615) for the target interface.
C24 enters the state in which it waits to receive the next command message without sending a response message (NAK message) to the target device.
• During on-demand data transmission, C24 stores the error code to the 'On-demand execution results' (Un\G598/614) for the target interface.
• If transmission was terminated midway in either of the cases above, C24 does not transmit the remaining data.
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.3 Send Monitoring Time (timer 2) Setting
265
■
Data communications using nonprocedural protocol or bidirectional protocol
• While waiting for the end of transmission of a message, C24 stores the error code to the 'Data transmission result'
(Un\G599/615) for the target interface and completes the transmission processing abnormally.
If message transmission was terminated midway, C24 does not transmit the remaining data.
• If waiting for the end of transmission of a response message, C24 stores the error code to the 'Data reception result'
(Un\G600/616) for the target device and turns ON the 'CH reception abnormal detection' (X4, XB).
*1
When the receive data read processing completes, C24 turns OFF the 'CH reception abnormal detection' (X4, XB) and waits to receive the next command.
If transmission of the response message was terminated midway, C24 does not transmit the remaining data.
*1 When communicating using bidirectional protocol, it stores the error code in the data reception result storage area for the target interface. (The reception abnormal detection signal does not turn ON.)
Changing the send monitoring time (timer 2)
The send monitoring time (timer 2) is set in "Send monitoring time (timer 2) designation" of the parameter.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
The send monitoring time (timer 2) monitors the transmission termination time in the condition below.
• When DTR/DSR signal control is used and the DR (DSR) signal is turned OFF (
Page 269 Control Contents of DTR/
• When DC1/DC3 receive control is used and DC3 is received (
Page 271 Control Contents of DC Code Control)
• When the RS-232 interface CS (CTS) signal is turned OFF ( MELSEC iQ-R Serial Communication Module User's
Manual(Startup))
Remarks
■
When changing the send monitoring time (time 2) setting
Find the send monitoring time (timer 2) from the maximum delay time for the message reception processing or response message transmission processing on the target device side and the transmission time per one-byte (t), and change the setting value. However, the value should be rounded to the nearest 100 ms above.
• Number of bytes transmitted per second (n) = Transmission rate/number of bits transmitted per byte
• Transmission time per byte (t) = 1000 (ms)/number of bytes transmitted per second (n)
• Send monitoring time (timer 2) = (Maximum processing delay time of target device) + (Transmission time per one-byte (t)
Number of transmission bytes)
Under the following conditions, the send monitoring time (timer 2) is set to 300 ms.
• Transmission rate : 9600 bps
• Number of transmit bits/byte : 11 (start bit: 1, data bits: 8, stop bits: 2)
• Maximum processing delay time : 200 ms
• Number of transmission bytes: 3 bytes
266
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.3 Send Monitoring Time (timer 2) Setting
12.4
Transmission Wait Time Setting
The transmission wait time is used during data communications using the MC protocol.
It is the time for a target device that cannot receive the data immediately after data has been transmitted.
When C24 transmits a response message in reply to a command message received from the target device, transmission of the response message is delayed by the transmission wait time, or longer.
The following explains the transmission wait time operation for data communications using 2C/3C/4C frame. (For 1C frame, the transmission wait time is designated in the command message.)
Command message
Target device
CPU module
Response message
Message wait time
C24 operation by transmission wait time
When transmission wait time is set to 0 ms
If a response message can be transmitted, C24 immediately transmits the response message. A transmission wait time is not set.
When the transmission wait time is set to 10 ms or longer
If a response message can be transmitted, and the transmission wait time after reception of the command message has elapsed, C24 transmits the response message.
Changing the transmission wait time
The transmission wait time is registered on "Transmission wait time designation" of the parameter.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
• If the target device that must wait a certain time before it can receive a response message after a command message was transmitted, set the transmission wait time as explained above.
Especially, for data communications with a target device connected to C24 RS-422/485 interface, set the transmission wait time to the hardware gate OFF time or longer of the target device.
• The transmission wait time described here is the time for data communications using the 2C/3C/4C frame.
12
12 CHANGING DATA COMMUNICATION MONITORING TIME
12.4 Transmission Wait Time Setting
267
13
DATA COMMUNICATIONS USING DC CODE
TRANSMISSION CONTROL
The transmission control function controls (suspends, restarts) the transmission and reception of data between C24 and target device by turning transmission control signals ON and OFF or by transmitting and receiving DC codes (DC1, DC2,
DC3, DC4), or informs the valid range for the data to the target device.
The transmission control function can be set for each C24 interface. C24 uses the transmission control function set by the user to control data communications with target devices.
Set the transmission control function to match the specifications of the target device.
The table below lists C24 transmission control functions.
The meanings of abbreviations in the table are as follows:
• MC: MC protocol
• Non: Nonprocedural protocol
• Bi: Bidirectional protocol
• Pd: Predefined protocol
• MD: MODBUS (slave function)
• S: Simple CPU communication
( : Valid, : Invalid)
Transmission control function
DTR/DSR signal control
DC code control
Type of control Interface that can be controlled
232 422/485
DTR control
DSR control
(ignore)
Protocol that can be controlled
MC
Non
Bi
Pd
MD
DC1/DC3 transmission control
DC1/DC3 reception control
DC2/DC4 transmission control
DC2/DC4 reception control
S
Remarks
Cannot be used simultaneously with DC control.
Select either one.
Normally controlled.
The cable wiring depends on whether or not control is used.
With half-duplex communications, control is necessary.
Cannot be used simultaneously with DTR/DSR signal control.
Select either one.
*1 Refer to the following section when the full-duplex communication is used to communicate data with the bidirectional protocol.
Page 107 Processing when Simultaneous Transmission is Performed during Full-Duplex Communications
*2 Check the operation on C24 by the RS(RTS) signal, control contents of CS(CTS) signal, or CD terminal check designation.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
Precautions
• When C24 is started, DTR/DSR signal control and RS/CS signal control are enabled.
• For simple CPU communication, a setting for communication depends on the target device. Set it according to the target device. (
Page 121 Data Communication Procedure)
How to change the transmission control method and DC code
Switching between DC code control and DTR/DSR control as well as changing of the DC code are set on "Transmission control specification" of the parameter.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
268
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
13.1
Control Contents of DTR/DSR (ER/DR) Signal
Control
This control uses the RS-232 interface DTR/DSR signals to inform the target device whether or not the host station is ready to receive data.
C24 uses the ER (DTR) signal to inform the target device whether or not the host station is ready to receive data, and uses the DR (DSR) signal to check if the target device is ready to receive data.
Ex.
(Terminate)
Data 1-1
(Restart)...Continue
Data 1-2 Target device
CPU module Data 2-1
(Terminate)
Data 2-2
(Restart)...Continue
ER(DTR) signal
13
DR(DSR) signal
C24 DTR control contents and free OS area specification
C24 DTR control contents
C24 uses the ER (DTR) signal to inform the target device whether or not it is ready to receive data.
The data transmitted from the target device using the nonprocedural protocol is stored in the receive data storage area in the buffer memory through the OS area. (
Page 57 Receiving Data from Target Device)
Under the following conditions, received data is temporarily stored in the OS area and is transferred to the receive data storage area when the current received data read processing is completed.
• Received data exceeding the size of the receive data storage area on the buffer memory when data, which is "receive data storage area < receive data length", was received.
• Data received before the program reads the previously received data.
C24 turns the ER (DTR) signal ON/OFF as listed below, depending on the size of the free OS area.
• Free area is 64 bytes (default) or less: OFF
• Free area is 263 bytes (default) or more: ON
ON ON
OFF OFF
ER(DTR) signal
ON: Ready to receive
OFF: Not ready to receive
Preparation for reception is completed C24(OS area) C24(OS area)
8448 bytes
(Data storage)
Free area
8448 bytes
64 bytes or less
(Default)
(Data storage)
Free area
After completion of reading from program
263 bytes or more
(default)
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
13.1 Control Contents of DTR/DSR (ER/DR) Signal Control
269
Free OS area specification
For the DTR/DSR (ER/DR) signal control, an available capacity in the OS area that informs data cannot be received can be set in the parameter below.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
Set the setting value as to be "Transmission control start free space < Transmission control end free space".
● "Transmission control start free space designation"
Specify an available capacity in the OS area in order to notify that data cannot be received (ER (DTR) signal is OFF).
• Transmission control start free space: 64 to 4,095 (Default: 64)
● "Transmission control end free space designation"
Specify an available capacity in the OS area in order to notify that data can be received (ER (DTR) signal is ON).
• Transmission control end free space: 263 to 4,096 (Default: 263)
■
Remarks
• The receive data clear processing clears the data stored in the OS area. (The receive area in the buffer memory is not cleared.) (
• If more data is received when the above free OS area is 0 bytes, an SIO error occurs and the received data is ignored until a free area is available. In this case, the SIO signal turns ON. (
Page 511 Hardware information communication error
C24 DSR control
C24 uses the DSR signal to detect whether or not the target device is ready to receive data and to control data transmission to the target device as shown below, depending on whether the DSR is ON/OFF.
• If the DSR signal is ON and there is data to be transmitted, C24 transmits it to the target device.
• If the DSR signal is OFF, even if there is data to be transmitted, C24 does not transmit it to the target device.
When the DSR signal is turned ON, C24 transmits the data to the target device.
270
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
13.1 Control Contents of DTR/DSR (ER/DR) Signal Control
13.2
Control Contents of DC Code Control
This control uses C24 transmission control data to inform a target device whether or not host station is ready to receive data and the valid range of the transmitted/received data.
The four types of C24 DC code control shown below are available. These control functions can be used simultaneously.
• DC1/DC3 transmission control
• DC1/DC3 reception control
• DC2/DC4 transmission control
• DC2/DC4 reception control
DC1/DC3 transmission control, DC1/DC3 reception control
C24 informs the target device whether or not host station is ready to receive data by transmitting the DC1 and DC3 signals, and checks whether or not the target device is ready to receive data by receiving the DC1 and DC3 signals.
• DC1: Control data that notifies the target device that C24 is ready to receive data
• DC3: Control data that notifies the target device that C24 is not ready to receive data
Ex.
Target device
CPU module
(Terminate)
Data 1-1
D
C
3
D
C
1
(Restart)...Continue
Data 1-2
Data 2-1
D
C
3
D
C
1
Data 2-2
(Terminate) (Restart)...Continue
C24 DC1/DC3 transmission control contents and free OS area specification
The control contents and the free OS area specification are the same as those of the DTR control. (
Page 269 C24 DTR control contents and free OS area specification)
C24 operates depending on the capacity of free OS area as follows:
• Free area is 64 bytes (default) or less: DC3 transmission (reception disabled)
• Free area is 263 bytes (default) or more: DC1 transmission (reception enabled)
13
Target device
CPU module
Data
D
C
3
D
C
1
Data
■
Remarks
• The receive data clear processing clears the data stored in the OS area. (The receive area in the buffer memory is not cleared.) (
• If more data is received when the above free OS area is 0 bytes, an SIO error occurs and the received data is ignored until a free area is available. In this case, the SIO signal turns ON. (
Page 511 Hardware information communication error
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
13.2 Control Contents of DC Code Control
271
C24 DC1/DC3 reception control contents
• When C24 receives DC3 from the target device, it terminates data transmission.
The program cannot read the received DC3 signal.
• When C24 receives DC1 from the target device, it restarts data transmission. (C24 resumes transmission from the data terminated by the DC3 reception.)
The program cannot read the received DC1 signal.
D
C
3
D
C
1 Target device
C24 Data Data
• Once DC1 is received, subsequent DC1 is ignored and removed from the received data.
■
Remarks
In the DC1/DC3 transmission/reception control, the state of C24 is as follows at the time of power-on, reset or mode switching of the CPU, or the UINI instruction execution.
• C24 does not transmit DC1 to the target device.
• C24 is in the same state as when it transmits DC1.
• C24 is in the same state as when it received DC1 even if DC1 is not received from the target device.
272
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
13.2 Control Contents of DC Code Control
DC2/DC4 transmission control, DC2/DC4 reception control
C24 encloses the data transmitted from the host station in the DC2 and DC4 codes and transmits it to the target device, and processes the data received from the target device enclosed in the DC2 and DC4 codes as valid data.
• DC2: Control data that informs the target device that the data following it is the start of the valid data
• DC4: Control data that informs the target device that the data immediately preceding it is the end of the valid data
Ex.
Target device
CPU module
DC2 Data DC4
DC2 Data DC4
DC2 Data
C24 DC2/DC4 transmission control contents
When transmitting data to a target device, C24 adds the DC2 code to the head of the data to be transmitted and the DC4 code to the end of the data to be transmitted.
Target device
CPU module
D
C
2
Data
D
C
4
D
C
2
E
N
Q
Data
D
C
4
13
Transmit order
(Nonprocedural protocol)
Transmit order
(Bidirectional protocol)
* The DC2 and DC4 code are also added for communication using MC protocol.
C24 DC2/DC4 reception control contents
• When DC2 is received from the target device, C24 processes the received data up to DC4 as valid data.
The received DC2 cannot be read by the program.
• When DC4 is received from the target device, C24 ignores the received data up to the one immediately before DC2 as invalid data.
The received DC4 cannot read by the program.
(Nonprocedural protocol) *1
D
C
2
Data
D
C
4
Target device
CPU module
*1 MC protocol 1C frame
Stored to C24 buffer memory or OS area
Arbitrary data
D
C
2
Data
D
C
4
Ignored by the C24 Stored to C24 buffer memory or OS area
PC
No.
Target device
D
C
2
E
N
Q
Character
D
C
4
• Once DC2 is received, subsequent DC2 is ignored and removed from the received data.
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
13.2 Control Contents of DC Code Control
273
13.3
Considerations for Using Transmission Control
Functions
The following describes the considerations for using the transmission control function of C24.
Agreement between target device and CPU module
Determine the following between the target device and the CPU module.
• Whether or not the transmission control function is to be used. When it is used, which control is to be used for data communications.
• Control timing
• DC1 to DC4 codes when DC code control is performed
(The DC1 to DC4 codes to be used can be arbitrarily changed.)
Conditions to use the transmission control function
• DTR/DSR control and DC code control cannot be used at the same time.
• When using DTR/DSR control, connect the ER (DTR) and DR (DSR) signals on the C24 side to the target device.
Transmission control function setting
Set the transmission control function that can control the target interface.
If a function that cannot control the target interface is set, the set contents are invalid.
Setting of transmission control function during interlink operation
When the two interfaces of C24 is used as interlink operation, set the transmission control function to either one of interfaces of which transmission control is required.
Set the other interface to "Do not use transmission control function" (the setting values to directly set to the buffer memory is
0001H).
DC code control
• DC1/DC3 transmission control and DC1/DC3 reception control are possible when full-duplex communications is used to communicate data between C24 and target devices.
Do not use DC1/DC3 control for half-duplex communications.
• The same data as the DC1 to DC4 codes cannot be included in the user data.
To handle the same data as a DC code as user data, perform any of the following:
Use DTR/DSR control.
Change the DC code. Do not use the transmission control function.
■
Remarks
If the user data received from the target device includes the relevant DC code when DC1/DC3 reception control and DC2/DC4 reception control are used, C24 performs the corresponding DC code control.
If the user data transmitted from the CPU module includes a DC code, it is sent unchanged.
Handling of ER (DTR) and DR (DSR) signals when DTR/DSR control is not used
When the DTR/DSR control is not used, C24 handles the ER (DTR) and DR (DSR) signals as described below.
• ER (DTR) signal is always ON.
• The ON/OFF status of DR (DSR) signal is ignored.
274
13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
13.3 Considerations for Using Transmission Control Functions
14
DATA COMMUNICATIONS USING HALF-
DUPLEX COMMUNICATIONS
This chapter explains the settings to prevent simultaneous transmission from C24 and the target device for data communication between them using the RS-232 interface.
The setting for each interface is available for RJ71C24-R2.
When C24 is started, full-duplex communications is set. The communication method can be changed by the user according to the specifications of the target device.
Target device
CPU module
Since the setting for half-duplex communications is not required in the following cases, this chapter can be skipped.
• When data is only transmitted or received during data communications using the nonprocedural protocol.
• When no data is transmitted from the target device to C24 without direction from C24 by the specifications of the target device.
14.1
Half-duplex Communications
The following describes the differences between full-duplex communications and half-duplex communications.
Since C24 performs the communication controls on the C24 side with the communication method set by the parameter as shown below, control by a program is not necessary.
Full-duplex communications
This is a communication method to communicate data with a target device like a conversation pattern with a telephone.
C24 can receive data while transmitting data to the target device.
It can also transmit data while receiving data from the target device.
Data A-1
Data B-1
Data A-2
Data B-2
Half-duplex communications
This is a communication method to communicate data with a target device like a conversation pattern with a transceiver.
When C24 receives data from the target device while transmitting data to the target device, it controls data transmission and reception according to 'simultaneous transmission priority/non-priority designation'.
C24 does not transmit data while it is receiving data from the target device.
Target device
CPU module
Data A-1
Data B-1 Data B-2
Data A-2
14
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
14.1 Half-duplex Communications
275
14.2
Data Transmission and Reception Timing
Half-duplex communications uses C24 RS-232 interface CD (DCD) and RS (RTS) signals to control communications.
If the target device can transmit and receive data according to ON/OFF of C24 RS (RTS) and CD (DCD) signals as shown below, half-duplex communications is possible.
• RS (RTS) signal : C24 turns ON/OFF this signal as shown below.
When data is transmitted from C24, this signal is turned ON. When transmission is completed, this signal is turned OFF.
• CD (DCD) signal: Turn ON/OFF this signal on the target device side as shown below.
To transmit data from the target device, turn ON this signal. When transmission is complete, turn OFF this signal.
The data transmission/reception timings for data communications with half-duplex communications are shown by the CD
(DCD) signal and RS (RTS) signal of C24.
Timing when transmitting data from target device
Transmit data by controlling C24 CD (DCD) signal according to the setting value for "simultaneous transmission priority/nonpriority designation" of the parameter.
■
When C24 is designated to "Priority"
Terminate data transmission.
Data A Data B Data B
Target device
CPU module
Data C
Since the C24 has priority, it continues to transmit even if the
CD(DCD) signal is turned ON.
Store this data at the target device.
Data C
SD(TXD) (Send Data)
Õ
RS(RTS) (Send Request)
Ò Ö
CS(CTS) (Send Possible)
Ó
CD(DCD)
(Data Carrier Detect) The C24 ignores the receive data.
(*1)
RX(RXD) (Receive Data)
Data A Ô
Data B
Data B
Retransmission
When transmitting data, check the RS (RTS) signal. If the RS (RTS) signal is OFF, turn ON the CD (DCD) signal. If the RS
(RTS) signal is ON, wait until it is turned OFF, then turn ON the CD (DCD) signal.
Transmit data after turning ON the CD (DCD) signal.
After data transmission is completed, turn OFF the CD (DCD) signal.
If the RS (RTS) signal is turned ON during data transmission, terminate data transmission and turn OFF the CD (DCD) signal, and perform data reception processing. (Simultaneous transmission occurred.)
After transmission from C24 is completed, retransmit all the data terminated at the step .
*1 Take the following measures between the devices communicating data as a countermeasure against ignoring received data by C24.
Transmission and reception of a response message in reply to data transmission
Time-out check of a response message and retransmission of data due to time-out error (target device side)
276
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
14.2 Data Transmission and Reception Timing
■
When C24 is designated to "Non-priority"
Target device
CPU module
Data A
Continue data transmission.
Data B
Data C-1
Data C-1 Data C-2
Since the C24 does not have priority, when the CD(DCD) signal is turned
ON, it terminated transmission.
Retransmission
(*1)
Data C-2
SD(TXD) (Send Data)
Õ
RS(RTS) (Send Request)
Ò
CS(CTS) (Send Possible)
Ó Ö
CD(DCD)
(Data Carrier Detect)
The C24 stores the received data.
Data A Ô Data B
RX(RXD) (Receive Data)
The contents of steps and below are different from those of the case "Priority" is designated.
When transmitting data, check the RS (RTS) signal. If the RS (RTS) signal is OFF, turn ON the CD (DCD) signal. If the RS
(RTS) signal is ON, wait until it is turned OFF, then turn ON the CD (DCD) signal.
Transmit data after turning ON the CD (DCD) signal.
After data transmission is completed, turn OFF the CD (DCD) signal.
Keep transmitting data to C24 even if the RS (RTS) signal is turned ON during data transmission. (Simultaneous transmission occurred.)
After transmission from the target device is completed, transmit data from C24 to the target device. (
Page 278 Timing when transmitting data from C24)
*1 For the transmission content, refer to the following section.
Page 278 Timing when transmitting data from C24
■
Remarks
When using the DTR/DSR transmission control function, transmit data from the target device to C24 as shown below in both cases above. (
Page 268 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL)
• When C24 ER (DTR) signal is turned OFF, terminate data transmission.
• When C24 ER (DTR) signal is turned ON after data transmission is terminated, restart data transmission (transmit from the terminated part of the data).
14
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
14.2 Data Transmission and Reception Timing
277
Timing when transmitting data from C24
Transmit data by controlling C24 RS (RTS) signal according to the setting value for "simultaneous transmission priority/nonpriority designation" of the parameter.
■
When C24 is designated to "priority"
Data C-1
Terminate data transmission.
Retransmission
Data C
Target device
CPU module
Data A Data B
Send request
Since the C24 has priority, it continues to transmit even if the
CD(DCD) signal is turned ON.
SD(TXD) (Send Data)
Ò Ó
Time for transmitting
2 characters
Data A
Ô
Send request
Data B
Store this data at the target device.
RS(RTS) (Send Request)
CS(CTS) (Send Possible)
Ö
Õ CD check
CD check CD check
CD(DCD)
(Data Carrier Detect)
Data C-1 Data C
RX(RXD) (Receive Data)
The C24 ignores the received data. (*1)
The C24 stores the received data.
When transmitting data, check the C24 CD (DCD) signal. If the CD (DCD) signal is OFF, turn ON the C24 RS (RTS) signal.
If the CD (DCD) signal is ON, wait until it is turned OFF, and then turn ON the RS (RTS) signal.
Transmit the data after turning ON the RS (RTS) signal.
After data transmission is completed, turn OFF the RS (RTS) signal.
Keep transmitting data from C24 to the target device even if the CD (DCD) signal is turned ON during data transmission.
(Simultaneous transmission occurred.)
After transmission from C24 is completed, transmit all the data terminated at step from the target device to C24.
*1 As a countermeasure against the disregard for the received data by C24, perform the following between the communicating devices.
Transmission and reception of a response message in reply to data transmission.
Time-out check of a response message and retransmission of data due to time-out error (target device side)
278
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
14.2 Data Transmission and Reception Timing
■
When C24 is designated to "Non-priority"
Target device
CPU module
SD(TXD) (Send Data)
Send request
Data A
Ò Ó
Time for transmitting
2 characters
Data A
Continue data transmission.
Data C
Ô
Send request
Data B Data B
Since the C24 does not have priority, when the CD(DCD) signal is turned
ON, it terminated transmission.
Data B
Data B
(*2)
RS(RTS) (Send Request)
CS(CTS) (Send Possible)
CD(DCD)
(Data Carrier Detect)
CD check CD check
Õ CD check Ö
CD check
Transmission wait time (*1)
Data C
RX(RXD) (Receive Data)
The C24 stores the received data.
The contents of steps and below are different from those of the case "Priority" is designated.
When transmitting data, check the C24 CD (DCD) signal. If the CD (DCD) signal is OFF, turn ON the C24 RS (RTS) signal.
If the CD (DCD) signal is ON, wait until it is turned OFF, then turn ON the RS (RTS) signal.
Transmit the data after turning ON the RS (RTS) signal.
After data transmission is completed, turn OFF the RS (RTS) signal.
If the CD (DCD) signal is turned ON during data transmission, terminate data transmission and turn OFF the RS (RTS) signal, and perform the data receive processing. (Simultaneous transmission occurred.)
After transmission from the target device is completed, transmit the data terminated at step from the beginning or terminated part of the data.
*2
*1 The data equivalent to the setting value of "simultaneous transmission priority/non-priority" is not transmitted.
*2 The data is transmitted from the beginning or from the part where the last transmission has been terminated according to the settings of
"Retransmission time transmission method".
■
Remarks
When using the DTR/DSR transmission control function, transmit data from the target device to C24 as shown below in both cases above. (
Page 268 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL)
• When the C24 DR (DSR) signal is turned OFF, terminate data transmission.
• When the C24 DR (DSR) signal is turned ON after data transmission is terminated, restart data transmission (transmit from the terminated part of the data).
14
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
14.2 Data Transmission and Reception Timing
279
14.3
Changing the Communication Method
To change the data communication method from full-duplex communication to half-duplex communication, setting the following parameters is required.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
RS-232 communication method designation
Set to "half-duplex communications".
Simultaneous transmission priority/non-priority designation
Set whether to continue ("priority") or stop ("non-priority") transmission from C24 when C24 and the target device start data transmission simultaneously in half-duplex communications.
Setting values "1" to "255" to set to "Non-priority" will be the transmission wait time that elapses from when the resumption of data transmission becomes available until data is actually sent.
Retransmission time transmission method designation
When "half-duplex communication" and "non-priority" are set as indicated above, this setting becomes valid. Set whether the terminated message will be transmitted from the beginning ('Resend') or from the terminated part of the message ('Do not resend') when C24 and the target device start transmission simultaneously, and C24 stops and then restarts transmitting.
RS-232 CD terminal check designation
Set the CD terminal check designation to "Check".
14.4
Connector Connections for Half-duplex
Communications
The following explains the connector that connects C24 and target device when half-duplex communications are used.
Connect to the target device in accordance with the following.
• Connect the C24 RS (RTS) signal to one of the target device signals (CS (CTS), DR (DSR), or CD (DCD) signal) for halfduplex communications.
• Connect the C24 CD (DCD) signal to one of the target device signals (RS (RTS) or DR (DSR) signal) for half-duplex communications.
• The half-duplex communications cannot be performed when an RS-232 and RS-422 converter is used.
Signal name
CD(DCD)
RD(RXD)
SD(TXD)
ER(DTR)
SG
DR(DSR)
RS(RTS)
CS(CTS)
CI(RI)
C24
7
8
5
6
9
Pin No.
3
4
1
2
Cable connection and signal direction
Target device
Signal name
CD(DCD)
RD(RXD)
SD(TXD)
ER(DTR)
SG
DR(DSR)
RS(RTS)
CS(CTS)
280
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
14.3 Changing the Communication Method
14.5
Considerations for Half-duplex Communications
The following describes the considerations for using half-duplex communications.
Half-duplex communications system configuration and functions
Half-duplex communications can be used only in a system configuration where the CPU module and a target device are connected on a 1:1 basis.
(Half-duplex communications can be designated)
Target device
(Half-duplex communications cannot be designated)
Target device
RS-232
RS-232
CPU CPU CPU CPU
C24 RS-422/485
Agreement and confirmation between target device and CPU module
Determine and confirm the following items between the target device and the CPU module.
• Whether or not half-duplex communications can be performed by C24 RS (RTS) signal and CD (DCD) signal.
• C24 RS (RTS) signal and CD (DCD) signal ON/OFF timing
• C24 and target device data transmission timing
• RS-232 cable connection method
Transmission control
When the transmission control function is used, DC1/DC3 transmission control and DC1/DC3 reception control of the DC code control cannot be used with half-duplex communications. Therefore, do not designate them.(
COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL)
14
14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
14.5 Considerations for Half-duplex Communications
281
15
CONTENTS AND REGISTRATION OF USER
FRAMES FOR DATA COMMUNICATION
User frames are used to register some part, or all of messages exchanged between a target device and C24 in advance and use them to check the data to be transmitted or received.
The following functions can use C24 user frames to transmit and receive data.
• MC protocol on-demand function.(
Page 299 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES)
• The data transmit/receive function using the nonprocedural protocol (
Page 308 DATA COMMUNICATIONS USING
Data can be transmitted and received by registering the corresponding user frames to C24 in advance to match the data contents that are transmitted and received between the target device and C24.
This chapter explains the data that can be registered, the data contents that are transmitted and received, and registering to
C24 of user frames that can be used in data communications with the target device.
For information on how to use user frames in each data communication function, refer to the following sections.
Page 299 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
Page 308 DATA COMMUNICATIONS USING USER FRAMES
15.1
User Frame Types and Contents During
Communication
This section explains the types of user frames handled by C24 and the data contents that are transmitted and received.
The following two types of user frames are available. Either type can be used as a user frame.
Frame type
User frame
Default registration frame
Overview
A frame that contains arbitrary data arranged according to the specifications of a target device. The data arrangement can be defined by a user.
A frame that is registered in C24 in advance. The frame cannot be changed by a user.
Reference
Page 282 User frames to be registered and used by the user
Page 290 Default registration frame
User frames to be registered and used by the user
The following explains data to be registered, data contents that are transmitted and received, and how C24 handles user frames registered C24 flash ROM or buffer memory by the user.
Overview
User frames registered by the user are frames that contain arbitrary data according to the specifications of the target device, and the data arrangement are determined by the user.
282
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
User frame registration
Up to 80 bytes (80 characters) of data can be registered as 1 user frame.
Up to 231 user frames can be registered (written), read, and deleted to/from C24.
Registration destination Frame No.
Application
CPU module
Maximum number of frames can be registered
31 frames
C24
Flash ROM
Buffer memory
31 frames
200 frames
31 frames
8001H to
801FH
8001H to
801FH
03E8H to
04AFH
8001H to
801FH
A user frame of which contents are changed after data communication has started
A user frame of which contents are changed after data communication has started
A user frame of which contents is not changed after data communication has started
A user frame of which contents are changed after data communication has started
Remarks
Registration by overwriting with MOV instruction is available.
*1 For the priority of the registered data, refer to the following section.
Page 434 PARAMETER REGISTRATION TO CPU MODULE
Registration data to handle variable data (Sum check code, C24 station number, etc.) as a part of the user frame can be included in the user frame. (
User frames can be registered by overwriting to C24 buffer memory. (The preceding contents are destroyed.)
Data that can be registered as user frame
Up to 80 bytes of data can be registered by combining 1 byte data of which registered code is 01H to FEH and 2 bytes data of which registered code is FFH + 00H to FFH + FFH.
■
One byte data of which registered code is (01H to FEH)
This is the registered code for transmitting and receiving the data of which registered code is (01H to FEH).
■
Two bytes data of which registered code is (FFH + 00H) to (FFH + FFH)
This is the registered code for transmitting and receiving the variable data (sum check code, C24 station number, etc.) as part of the user frame. (
FFH is the registered code of the first byte for handling variable data.
Variable data
"Variable data" is a generic term for the data shown below.
These variable data can be handled as part of a user frame.
• Sum check code covering a determined range of messages to be transmitted/received
• Horizontal parity code covering a determined range of message to be transmitted/received
• Two's complement sum check code covering a determined range of messages to be transmitted/received
• C24 station number
• One byte data in data transmission (00H (NULL), FFH)
• One byte of arbitrary data in data reception. (Used to handle an arbitrary byte of data as part of the user frame during reception check by C24.)
■
Variable data designation method
Variable data is designated by combining registered code FFH and the data codes shown in the table below.
The sum check code, C24 station No., and other variable data can be handled according to FFH of the first byte and 00H to
FFH of the second byte.
FFH 00H to FFH
2nd byte
1st byte
15
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
283
■
Variable data designation contents, data contents transmitted and received, and handling by
C24
The table below shows the registered codes (FFH+00H) to (FFH + FFH) combinations for handling variable data, the data contents that are transmitted and received, and how C24 handles the data.
Variable data registered code
1st byte
FFH
2nd byte
00H
Data contents transmitted and received/C24 handling Calculating range
Detailed explanation
01H
When transmitting: Transmits the data code 00H (NULL) data (1 byte).
When receiving: Skips the given part (1 byte) of the receive user frame. (Skips the check and performs receive processing.)
Transmits and receives the host station number as 1-byte binary code data (00H to 1FH).
Page 285 C24 processing to the registered code
04H
05H
0AH
0BH
11H
17H
Transmits and receives the horizontal parity code in the calculating range using 1 byte of binary code data.
Transmits and receives the horizontal parity code in the calculating range using 2-byte ASCII code data
Transmits and receives the horizontal parity code in the calculating range using 1 byte of binary code data.
Transmits and receives the horizontal parity code in the calculating range using 2-byte ASCII code data
Transmits and receives the two's complement sum check code in the calculating range.
Range 1
Range 2
Range 1
Range 2
Page 285 C24 processing to the registered code
Page 286 C24 processing to registered codes FFH+04H,
E5H
EBH
Transmits and receives the sum check code in the calculating range.
(Excluding the last one frame) *1
Transmits and receives the sum check code in the calculating range.
Range 3
Range 4
Range 1
Page 287 C24 processing to registered codes FFH+11H and FFH+17H
Page 289 C24 processing to registered code FFH+E5H
Page 289 C24 processing to registered code FFH+EBH
Page 288 C24 processing to registered codes FFH+EEH to FFH+F9H
F6H
F7H
F9H
FFH
EEH
F0H
F1H
F3H
F4H
Transmits and receives the registered code FFH data (1 byte).
Range 2
*1 During data communication using a user frame that handles the final frame, the contents of the "sum check code" in the transmission setting set by the parameter will be ignored.
284
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
■
Calculating ranges for the registered codes
The following shows the calculating ranges for the registered codes.
Range 4
User frame
(1st)
User frame
(2nd)
Range 3
User frame
("n-1"th)
User frame
("n"th)
User frame
(First frame)
Range 4
Range 3
Arbitrary data
User frame
(Last frame)
Register code
FFH H FFH H
Range 1 Range 1
Register code
Range 2
(Calculation range when transmitting data)
Range 2
(Calculation range when receiving data)
Calculating range
Range 1
Range 2
Range 3
Range 4
When transmitting
When receiving
When transmitting/ receiving
When transmitting
When receiving
When transmitting/ receiving
Range from the data following the start frame (the user frame (1st) when multiple user frames are designated) to the one immediately before the registered code
Range from the data following the start frame to the one immediately before the registered code
Range from the head of a message to the data immediately before the registered code
Range from the data following the start frame (the user frame (1st) when multiple frames are designated) to the one immediately before the final frame (the user frame (nth) when multiple frames are designated)
Range from the data following the start frame to the one preceding the final frame
Range from the head of a message to the data preceding the final frame
*1 The additional code data for the transparent code designation shown below is excluded.
Page 358 TRANSPARENT CODES AND ADDITIONAL CODES
Variable data registered code
■
C24 processing to the registered code FFH+00H
The following shows an example to describe the processing performed by C24 when it receives a user frame portion corresponding to registered codes FFH and 00H.
When setting a user frame containing the data codes 02H, FFH, 00H, and 3BH for a receive user frame as user frame number, 3EAH
• C24 performs the reception processing as the user frame, 3EAH has been received when it receives 3 bytes of data, "STX, arbitrary data (for 1 byte), ;".
• C24 does not check the 2 bytes described above.
15
Receive data
S
T
X
1 ; A B
02
H
31
H
3B
H
41
H
42
H
Receive data code
Check
If the 02H and 3BH data portions match, they are processed as if user frame No. 3EAH mentioned above was received
■
C24 processing to the registered code FFH+01H
C24 transmits and receives the user frame portion corresponding to registered code, FFH+01H by representing the station number set in the parameter as 1-byte binary data.
For the usage example, refer to the start frame portion in the figures below.
Page 286 C24 processing to registered codes FFH+04H, FFH+05H, FFH+0AH, and FFH+0BH
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
285
■
C24 processing to registered codes FFH+04H, FFH+05H, FFH+0AH, and FFH+0BH
• For FFH + 04H and FFH + 0AH
The horizontal parity code that calculates the range for the data to be transmitted/received (message) is expressed as 1 byte binary data and then transmitted and received.
The difference between FFH + 04H and FFH + 0AH is the difference in the calculating range.
• For FFH + 05H and FFH + 0BH
The horizontal parity code that calculates the range for the data to be transmitted/received (message) is expressed as 2byte ASCII code data and then transmitted and received from the upper digit.
The difference between FFH + 05H and FFH + 0BH is the difference in the calculating range.
Ex.
Examples of data arrangement when the horizontal parity code is transmitted/received are shown below. (The start frame and final frame are equivalent to one frame respectively.)
• For registered code FFH + 04H • For registered code FFH + 05H
User frame
(first frame)
Arbitrary data User frame
(last frame)
User frame
(first frame)
Arbitrary data User frame
(last frame)
User frame register code
02H FFH+01H 3BH
S
T
X
; 1 2 3 4
03H FFH+04H 0DH 0AH
E
T
X
C
R
L
F
User frame register code
02H FFH+01H 3BH
S
T
X
;
1 2 3 4
03H FFH+05H 0DH 0AH
E
T
X
C
R
L
F
Transmission/ reception data code
02H 00H 3BH 31H 32H 33H 34H 03H 07H 0DH 0AH
Transmission/ reception data code
02H 00H 3BH 31H 32H 33H 34H 03H 30H 37H 0DH 0AH
Calculation range
Calculation range
• How to calculate the horizontal parity code
This is a numeric value obtained by calculating the XOR for the subject data and then converting it to ASCII code.
Ex.
For message example above
"1" (31H) 0011 0001
XOR
"2" (32H) 0011 0010 = 0000 0011
"3" (33H)
XOR
0011 0011 = 0011 0000
"4" (34H)
"ETX" (03H)
XOR
0011 0100 = 0000 0100
XOR
0000 0011 = 0000 0111
ASCII code
"0" "7"
(30H) (37H)
286
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
■
C24 processing to registered codes FFH+11H and FFH+17H
The two's complement sum check code that calculates the range for data (message) to be transmitted/received is expressed as two character data in ASCII code, then transmitted and received from the upper digit.
The difference between (FFH+11H) and (FFH+17H) is the difference in the calculating ranges.
An example of the contents (arrangement) of the transmission and reception of the two's complement sum check code is shown below.
Ex.
Arrangement of data transmitted and received with the registered code FFH+17H (The start frame and final frame are equivalent to one frame respectively.)
User frame
(first frame)
Arbitrary data User frame
(last frame)
User frame register code
02H FFH+01H 3BH
S
T
X
; 1 2 3 4
03H FFH+17H 0DH 0AH
E
T
X
C
R
L
F
Transmission/rec eption data code 02H 00H 3BH 31H 32H 33H 34H 03H 46H 36H 0DH 0AH
Calculation range
• How to calculate the two's complement sum check code
The lower 1 byte of the value obtained by adding the subject data as binary data is converted to a two's complement, then converted to a hexadecimal ASCII code.
Ex.
For message example above
02H+00H+3BH+31H+32H+33H+34H+03H=10AH Data in the subject range are added as binary data (hexadecimal)
00001010
11110110
F6H
"F" "6"
(46H) (36H)
The lower 1 byte of the above numeric value is expressed as a binary number
Reversed, then converted to a two's complement
Converted to a hexadecimal ASCII code
15
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
287
■
C24 processing to registered codes FFH+EEH to FFH+F9H
The sum check code that calculates the range for data (message) to be transmitted/received is expressed as the binary code/
ASCII code data listed below, then transmitted and received.
Registered code
FFH + EEH or FFH + F4H
FFH + F0H or FFH + F6H
FFH + F1H or FFH + F7H
FFH + F3H or FFH + F9H
Data contents transmitted and received
The lower 2 bytes of the calculated sum check code are transmitted and received as 2-byte binary code data.
The lower byte of the calculated sum check code is transmitted and received as 1-byte binary code data.
The lower byte of the calculated sum check code is converted to 2-digit ASCII code, then transmitted and received.
The lower 4 bits of the calculated sum check code is converted to 1-digit ASCII code, then transmitted and received.
An example of the contents (arrangement) of the transmission and reception of the sum check code is given below.
Ex.
Arrangement of data transmitted and received (one start frame and one final frame)
User frame register code
User frame
(first frame)
Arbitrary data
User frame
(last frame)
02H FFH+01H 3BH
S
T
X
; A 1 (12ABH)
03H FFH+F1H 0DH 0AH
E
T
X
C
R
L
F
Transmission/reception data code
02H 00H 3BH 41H 31H ABH 12H 03H 32H 01H 0DH 0AH
Range 1
Range 2
• How to calculate the sum check code and data contents transmitted and received
This is a numeric value obtained by adding data in the above range as binary data.
Ex.
For Range 1: 41H+ 31H + ABH + 12H + 03H = 0132H
For Range 2: 02H + 00H + 3BH + 41H + 31H + ABH + 12H + 03H = 016FH
Registered code Data contents transmitted and received (arrangement) Calculating range
Range 1
Range 2
FFH + EEH
FFH + F0H
FFH + F1H
FFH + F3H
FFH + F4H
FFH + F6H
FFH + F7H
FFH + F9H
01H and 32H are transmitted and received, beginning from 32H.
32H is transmitted and received.
"3" and "2" are transmitted and received, beginning from "3."
"2" is transmitted and received.
01H and 6FH are transmitted and received, beginning from 6FH.
6FH is transmitted and received.
"6" and "F" are transmitted and received, beginning from "6".
"F" is transmitted and received.
288
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
■
C24 processing to registered code FFH+E5H
The sum check code that calculates data (message) to be transmitted/received excluding the first one frame and last one frame is expressed as the ASCII code data and transmitted or received.
• How to calculate the sum check code
Lower one byte of the calculated sum check code is converted into 2-digit ASCII code data, and transmitted and received.
Ex.
Arrangement of data when transmitted/received
User frame
(First frame)
User frame register code
Transmission/ reception data code
Arbitrary data
User frame
(Last frame)
02H
S
T
X
Station
No.
Read data
0 1 1 7 7 0
03H FFH+E5H
E
T
X
Sum check code
3 0
02H 30H 31H 31H 37H 37H 30H 03H
Calculation range
30H+31H+31H+37H+37H+30H
=130H
33H 30H
■
C24 processing to registered code FFH+EBH
The sum check code that calculates the data (message) to be transmitted/received, including the first one frame and excluding the last one frame, is expressed as the ASCII code data, and transmitted or received.
• How to calculate the sum check code
Lower one byte of the calculated sum check code is converted into 2-digit ASCII code data, and transmitted or received.
Ex.
Arrangement of data when transmitted/received
User frame
(First frame)
Arbitrary data
User frame
(Last frame)
User frame register code
Transmission/ reception data code
02H
S
T
X
Station
No.
Read data
0 1 1 7 7 0
E
T
X
03H FFH+EBH
Sum check code
3 2
02H 30H 31H 31H 37H 37H 30H
Calculation range
02H+30H+31H+31H+37H+37H+30H
=132H
03H 33H 32H
15
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
289
Default registration frame (read only)
This frame is registered in C24 in advance and can be used in the same way as the other user frames.
Overview
The default registration frame is registered in the operating system ROM of C24.
The one-byte data (code: 01H to FEH) and a maximum of five-byte data is registered, and can be used for read-only. (Frame
No.: 1H to 3E7H)
Each of these frames is treated as a user frame.
110H (272)
111H (273)
113H (275)
114H (276)
116H (278)
117H (279)
119H (281)
11FH (287)
120H (288)
3E7H (999)
1H (1)
2H (2)
FEH (254)
FFH (255)
100H (256)
101H (257)
102H (258)
103H (259)
104H (260)
105H (261)
106H (262)
107H (263)
108H (264)
109H (265)
10DH (269)
10EH (270)
Default registration frame registered data and data contents transmitted and received
The codes of the registration data for default registration frame and the data contents that are transmitted and received are shown below.
Default registration frame No.
(HEX (DEC))
Registration data code
(1st byte to nth byte)
Registered byte count
Frame byte count
01H
02H
FEH
00H
FFH
0DH, 0AH
10H, 02H
10H, 03H
00H, FEH
00H, 00H, FEH
03H, FFH, F1H
03H, FFH, F1H, 0DH, 0AH
(None)
1
1
1
2
3
5
2
3
1
1
2
2
4
2
3
Data contents transmitted and received
Data contents
(Data of code shown at the left)
STX
(Data of code shown at the left)
(For variable data designation)
NUL
(Data of code shown at the left)
CR, LF
DLE, STX
DLE, ETX
(Data of codes shown at the left)
(Data of codes shown at the left)
ETX, sum check code
ETX, sum check code, CR, LF
FFH, EEH
FFH, F0H
FFH, F1H
FFH, F3H
FFH, F4H
FFH, F6H
FFH, F7H
FFH, F9H
FFH, FFH
(None)
2
1
Registered code FFH data (1 byte)
*1 The combination of FFH, H in the registered code is used to handle variable data (sum check code, C24 station number, etc.) as part of the user frame.
The data contents that are transmitted and received and the byte count depend on the code combined with registered code FFH.
For combination of registered code to handle variable data and the data contents transmitted/received, refer to the following section.
290
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.1 User Frame Types and Contents During Communication
15.2
Transmission/Reception Processing Using User
Frame Registration Data
The following explains how C24 transmits and receives using user frame registration data.
C24 checks the transmission/reception of following data, using registered data.
Transmitting data
When user frame transmission is designated
A user frame is converted or not converted from ASCII to binary data and transmitted, depending on the data communications protocol, ASCII-BIN conversion designation, and user frame No. designation, based on the following data as the send data of the given part.
■
Registered portion of 1-byte data for code of registration data, 01H to FEH
C24 transmission is based on the data for registered code (01H to FEH).
Ex.
When data codes 03H, 0DH, and 0AH are registered as user frame number, 3E8H
When user frame number, 3E8H is designated during data transmission, C24 transmits the data codes 03H, 0DH, 0AH (ETX,
CR, LF) as the data to be transmitted for the given user frame if ASCII-BIN conversion is disabled.
When ASCII-BIN conversion is enabled, C24 converts each of the data above to 2-byte ASCII code data and transmits.
Data designated by program
A B 1 2
41H 42H 31H 32H to
E
T
X
C
R
L
F
(89ABH)
ABH 89H 03H 0DH 0AH
Part that designated user frame
No. 3E8H (Added by the C24)
(When ASII-BIN conversion disabled)
■
Registered portion of 2-byte data for code of registration data, FFH+00H to FFH
C24 transmission is based on the variable data corresponding to the combination of the registered codes FFH and 00H to
FFH.
For example, if sum check code is registered, C24 will calculate and transmit the sum check code. If C24 station No. is registered, the station number set to C24 is transmitted.
Ex.
When data codes 03H, FFH, F0H, 0DH, 0AH are registered as user frame number, 3E9H
When user frame number, 3E9H is designated during data transmission, C24 calculates the sum check code as the data to be transmitted for the given user frame portion. If ASCII-BIN conversion is disabled, C24 transmits the calculated data. If ASCII-
BIN conversion is enabled, C24 converts the calculated data to 2 bytes per byte ASCII code data and transmits.
Data designated by program
A B 1 2
41H 42H 31H 32H to
E
T
X
C
R
L
F
(89ABH)
ABH 89H 03H 12H 0DH 0AH
Part that designated user frame
No. 3E9H (Added by the C24)
(When ASII-BIN conversion disabled)
Calculated by the C24
15
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.2 Transmission/Reception Processing Using User Frame Registration Data
291
■
Remarks
With the multidrop connection, including data for the target device to identify which station transmitted a message in the user frame can facilitate creation of arbitrary data to be transmitted.
Target device
Data used by the target device to identify the transmitting station
S
T
X
1 A ; A B C 1 2 3 ;
C
R
L
F
When message transmitted from the station No.1 C24
“ABC123” … Data designated to the station
No.1 C24 transmission data designation area.
Arbitrary data
User frame
CPU C24
(0)
CPU C24
(1)
CPU C24
(5)
( ): Station No.
Data when transmitting a frame written to each
C24 for transmission
S
T
X
0 A ;
;
C
R
L
F
Receiving data
S
T
X
1 A ;
;
C
R
L
F
S
T
X
5 A ;
;
C
R
L
F
When user frame reception is designated
When the start frame is set, C24 receives the message when it receives data with the same arrangement as the designated start frame.
If the final frame is set, C24 issues the read request of received data to the CPU module when it receives data with the same arrangement as the designated final frame.
C24 reception processing by registration data
■
Registered portion of 1-byte data for code of registration data, 01H to FEH
C24 receives and checks if the received data is data of the same code (01H to FEH) as the registered code.
Ex.
When data codes 03H, 0DH, and 0AH are registered as user frame number, 3E8H
When user frame No. 3E8H is set for data reception, C24 receives and checks data codes 03H, 0DH, 0AH (ETX, CR, LF) as the receive data of that user frame portion.
CPU module
Reception data read request
C24
Buffer memory
4241H
(Receive data storage area)
89ABH
Arbitrary data E
T
X
C
R
L
F
A B 1 2 3 4
(1234H) (89ABH)
41H 42H 31H 32H 33H 34H 34H 12H ABH 89H 03H 0DH 0AH
When the C24 receives the data,it issues reception data read request to the CPU module
292
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.2 Transmission/Reception Processing Using User Frame Registration Data
■
Registered portion of 2-byte data for code of registration data, FFH+00H to FFH
C24 receives and checks if the received data is variable data corresponding to the combination of the registered codes FFH and 00H to FFH.
For example, if a sum check code is registered, C24 calculates the sum check code from the receive data and checks if it is the same as the received sum check code. If the two codes are not the same, C24 performs error processing.
If C24 station number is registered, C24 checks if the received station number is the same as the station number set in C24. If the two station numbers are not the same, C24 processes the data as if normal data was received instead of a user frame.
Ex.
When data code 03H, FFH, F0H, 0DH, 0AH is registered as user frame number, 3E9H
When user frame No. 3E9H is set for data reception, C24 calculates, receives, and checks the sum check code as the receive data of that user frame portion.
■
In a reception message
C24 removes the user frame data portion from the reception message.
(The CPU module cannot read this data.)
■
Remarks
With the multidrop connection, the module on a given station stores only arbitrary data portion of a message transmitted by the target device in the receive data storage area by registering each receive user frame specific to respective modules to be connected.
Target device
Data used by the target device to indicate the transmission destination
S
T
X
5 A ;
Arbitrary data
;
C
R
L
F
Received by the station No.5 C24.
15
Data when a receive frame is received at each C24
(First frame)
(Last frame)
CPU C24
(0)
S
T
X
0 A ;
;
C
R
L
F
CPU C24
(1)
S
T
X
1 A ;
;
C
R
L
F
CPU C24
(5)
S
T
X
5 A ;
;
C
R
L
F
( ): Station No.
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.2 Transmission/Reception Processing Using User Frame Registration Data
293
15.3
Considerations for Registering, Reading, and
Deleting User Frames
The following shows the considerations for registering user frames and using registered user frames to transmit data to and receive data from the target device normally.
Considerations for registering, reading or deleting user frames
■
Registration of user frame
A user frame can be registered using one of the following methods.
• Registering by using the module extended parameters. (
Page 297 Registration method using module extended parameters)
• Registering with the dedicated instruction "PUTE" from the CPU module. ( MELSEC iQ-R Programming Manual
(Module Dedicated Instructions))
• Registering from a target device with command "1610" through communications using the MC protocol. ( MELSEC
Communication Protocol Reference Manual)
When a user frame is registered using the dedicated instruction or the MC protocol after the registration to the CPU built-in memory or SD memory card by module extended parameters, it is replaced with the contents registered using module extended parameters by powering OFF ON or switching the CPU module STOP RUN.
■
Setting required to register/delete user frame
The following settings are required when registering or deleting user frames.
• Set "Setting change" to "Enable" in the transmission setting of the parameter.
■
Registering, reading or deleting user frames from the CPU module
Register/read/delete a user frame when no data is communicated with the target device.
■
Registration of sum check code
A user frame only with sum check code for variable data cannot be registered.
To register sum check code, add arbitrary data.
■
User frame to be used for reception
Register a receive user frame in the CPU module or the flash ROM of C24.
■
Designation of variable data
The variable data (05H to F9H) can be designated at only one place in the final frame.
294
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.3 Considerations for Registering, Reading, and Deleting User Frames
Considerations for using user frames
■
Transmitting/receiving data using user frames
It is necessary to set the user frame number to be used to the buffer memory prior to data transmission/reception (receive user frames must be set at the startup of C24).
■
Data communication procedure when the number for a receive user frame is set from the CPU module
The procedure to set a receive user frame number form the CPU module and receive data is shown below.
Receive user frame data by performing the following operations sequentially.
• Restart the CPU module when a user frame to be used for data reception was registered from the CPU module.
• Set the receive user frame number to the buffer memory at the startup of C24, and write "1" in the 'User frame use enable/ disable designation' (Un\G173/333) on the buffer memory.
• Start data reception once the value in the user frame use enable/disable designation area on the buffer memory changes to
"2".
• Check whether data is received normally from the target device.
■
When additional code data is received during data reception using the nonprocedural protocol
C24 does not assume that 1-byte data immediately after it is data for the following controls.
• Data received as the start frame, final frame for user frame (
Page 282 User Frame Types and Contents During
Page 291 Transmission/Reception Processing Using User Frame Registration Data)
• Receive end code data
Therefore, do not set a user frame containing data receive additional code data as a user frame for data reception using the nonprocedural protocol.
■
Arbitrary data portion in a message received from a target device
The arbitrary data portion of a message received from a target device cannot include data with the same arrangement (same code) as the final frame.
Ex.
15
User frame
(First frame)
Arbitrary data
User frame
(Last frame)
■
Data bit length of transmission specification
In the following cases, set the data bit length of the transmission specification to 8 bits.
(Set this in "Transmission Setting" of the parameter with Engineering tool for the C24 side.)
• When transmitting and receiving the sum check code of the variable data as binary data (registered code: FFH+EEH,
FFH+F0H, FFH+F4H, FFH+F6H)
• When transmitting and receiving a user frame containing data codes 80H to FFH
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.3 Considerations for Registering, Reading, and Deleting User Frames
295
15.4
Registering/Reading/Deleting User Frames
This section explains registering, reading, and deleting user frames in/from C24 flash ROM or buffer memory.
Type of user frames
Type
Data communication function
Default registration frame
User frame
User frame No.
1H to 3E7H
(1 to 999)
(1000 to 1199)
8001H to 801FH
(-32767 to -32737)
B001H to B00AH, B061H,
B080H to B082H
Registration destination
ROM for C24 operating system
C24 flash ROM
C24 buffer memory
(Un\G6912 to 8182)
ROM for C24 operating system
Remarks
Read enabled
Register/read/delete enabled
User frame for the programmable controller CPU monitoring function
Register/read/delete disabled
*1 A user frame cannot be overwritten for registration. To reregister a user frame having the same number, first delete the current user frame and then reregister.
*2 Check the registration status of the user frame number with Engineering tool.
*3 The data arrangement of user frame for registration or reading is the same as the one for registration or reading to/from the flash ROM.
Register or read user frames in accordance with the arrangement above.
Although user frames can registered in the buffer memory, register user frames of the fixed format portion in the flash ROM as much as possible.
Devices that can register/read/delete user frames
Type User frame No.
Default registration frame
User frame
User frame for the programmable controller
CPU monitoring function
*1 Use the PUTE instruction.
*2 Use the GETE instruction.
1H to 3E7H
3E8H to 4AFH
8001H to 801FH
B001H to B00AH,
B061H, B080H to
B082H
Device that can register/read/delete
CPU module Target device Engineering tool
Register Read Delete Register Read Delete Register Read Delete
Precautions
Register/read/delete user frames by a program while no data is communicated with the target device.
296
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.4 Registering/Reading/Deleting User Frames
Registration method using module extended parameters
Register the user frame to be used for "Registration frame No. 1000" to "Registration frame No. 1199".
Navigation window [Parameter] [Module Information] Module Name [Module Extended Parameter] "User frame contents"
Buffer memory to be used
Requirement for reading/writing from CPU module
: Always performed, : Performed as required, : Unnecessary
Name Address
(Hexadecimal
(decimal))
2H (2) For flash
ROM access
Register/read/delete instruction
3H (3)
4H (4)
5H (5)
6H (6) to 2DH
(45)
204H (516)
Frame number direction
Registration/read/delete result storage
Registration data byte count designation
(
Page 298 Registration data byte count designation (Un\G5, 6912, 6953, ..., 8142))
User frame
(
Page 298 User frame (Un\G6 to 45,
6913 to 6952, 6954 to 6993, ..., 8143 to
Number of registered user frame storage
Stored value
0: No request
1: Registration request
2: Read request
3: Deletion request
0: No designation
1000 to 1199 (3E8H to 4AFH): Frame
No. to be registered/read/deleted
0: Normal completion
Other than 0: Abnormal completion
(error code)
0: When deleting
1 to 80 (1H to 50H): Registered code byte count
Code of frame to be registered/read
(for 80 bytes)
205H (517) to
21DH (541)
0: No registration to flash ROM
1 to 200 (1H to C8H): Number of registration to flash ROM
0: No registration in the given range
Other than 0 : Registration status
21EH (542)
User frame registration status storage
(
Page 298 User frame registration status
(For registration number check) (Un\G517 to
(For registration No. check)
Number of registered default registration frames storage
(ROM for operating system)
1B00H (6912)
1B01H (6913) to
1B28H (6952)
1B29H (6953)
1B2AH (6954) to
1B51H (6993)
Registration
No. 8001H
Registration
No. 8002H
Registration data byte count designation
(
Page 298 Registration data byte count designation (Un\G5, 6912, 6953, ..., 8142))
User frame storage (for 40 words)
(
Page 298 User frame (Un\G6 to 45,
6913 to 6952, 6954 to 6993, ..., 8143 to
Registration data byte count designation
(
Page 298 Registration data byte count designation (Un\G5, 6912, 6953, ..., 8142))
User frame storage (for 40 words)
(
Page 298 User frame (Un\G6 to 45,
6913 to 6952, 6954 to 6993, ..., 8143 to
n: number of registration (
290 Default registration frame (read only))
• 1 to 80 (1H to 50H): Number of registered code bytes
• Registered frame code (for 80 bytes)
(Registered area for 31 frames)
1B52H (6994) to
1FCDH (8141)
1FCEH (8142) Registration
No. 801FH
1FCFH (8143) to
1FF6H (8182)
Registration data byte count designation
(
Page 298 Registration data byte count designation (Un\G5, 6912, 6953, ..., 8142))
User frame storage (for 40 words)
(
Page 298 User frame (Un\G6 to 45,
6913 to 6952, 6954 to 6993, ..., 8143 to
Processing
Register Read Delete
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.4 Registering/Reading/Deleting User Frames
297
15
■
Registration data byte count designation (Un\G5, 6912, 6953, ..., 8142)
• The total number of bytes of registration data of user frame to be registered (written)/read is indicated.
• Accessing to the flash ROM
At the time of registration, the user writes the total number of bytes of registration data.
At the time of reading, the total number of bytes of registration data is stored.
• Accessing to the buffer memory
At the time of registration, the user writes the total number of bytes of registration data.
■
User frame (Un\G6 to 45, 6913 to 6952, 6954 to 6993, ..., 8143 to 8182)
• During the registration, the user sequentially stores the registration data of the user frame to be registered in the order of
(L) and (H), beginning from the head area of the given area range.
• During the reading, the registration data of the registered user frame is stored with the same contents and arrangement as when registering.
Ex.
Contents stored in the user frame storage area when a user frame to transmit and receive ETX, sum check code, CR, and LF
(registered codes: 03H, FFH, F1H, 0DH, 0AH) is registered to the flash ROM.
Address
Un\G6
Un\G7
Un\G8
Buffer memory
(H) (L)
FFH, 03H
0DH, F1H
00H, 0AH
(Data contents transmitted and received)
Head data
Last data
(Part corresponding to registered frame above)
User frame
(First frame)
Arbitrary data
User frame
(Last frame)
User frame register code
Transmission/reception data corresponding to register code
02H FFH,01H 3BH
S
T
X
;
A 1 (12ABH)
03H FFH,F1H 0DH 0AH
E
T
X
C
R
L
F
Transmission/recep tion data code
02H 00H 3BH 41H 31H ABH 12H 03H 32H 01H 0DH 0AH
Sum check code calculation range
The C24 calculates the
CPU module checksum.
■
User frame registration status (For registration number check) (Un\G517 to 541)
• The registration status of user frames to the flash ROM is stored with the values shown below.
• The contents of each area that indicates the registration status are shown below. The contents of the area are indicated in one user frame number/1 bit form.
Ex.
User frame No. 1015 (3F9H) registration status
User frame No. 1000 (3E8H) registration status
(H) Buffer memory (L)
Address b15 to b8 b7 to b0
0: Not registered
1: Registered
Un\G517
Un\G518
0
0
0
0
0
0
0
0
0
0
0 1
0 1
1
1
0
0
0
0
0
0
0
0
1
0
1
0
1
1
1
1 to 030FH to 0303H
Un\G529 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 to 0000H
User frame No. 1199 (4AFH) registration status (Subsequent bits are spares)
298
15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
15.4 Registering/Reading/Deleting User Frames
16
ON-DEMAND DATA COMMUNICATIONS USING
USER FRAMES
During communications between a target device and a CPU module using the MC protocol, on-demand data can be transmitted from the CPU module to the target device with the on-demand function using user frames.
This chapter explains the transmission of the data specified by the CPU module using a message format other than the formats ( 1C frame format 1 to 4, 4C frame format 5) described in the following manual.
( MELSEC Communication Protocol Reference Manual)
16.1
Data Communication Function Using User Frame
The data communication using user frame means transmitting/receiving the first and last parts of a message in the format selected by a user in data communications between the CPU module and target devices via C24.
By using the function described in this chapter, on-demand data in the order shown below can be transmitted from C24 to the target device.
Ex.
Transmitting data according to the order of 3C frame, format 1
On-demand data
As shown in the left, the user can sort the data except for the "Send data" portion.
H L H L H L H L H L character area
H L
Transmitted by user frame.
Data can be communicated using the user frames by registering in advance (by data codes) message formats that can be transmitted/received by the target device according to its specifications as user frames in C24.
In the above figure, C24 transmits the on-demand data as described below:
• Sum check code of a user frame
C24 calculates the sum check code according to the contents registered in advance by the user, and transmits it as ASCII/ binary data.
• Other than sum check code of a user frame
C24 transmits data of the code registered in advance by the user. (No conversion)
• Send data (character B portion)
This is the data that the program requested to transmit with ONDEMAND instruction.
It is transmitted with the same contents and in the same order as the one transmitted without using a user frame according to the communication protocol and word/byte designation by the parameters of Engineering tool. ( MELSEC
Communication Protocol Reference Manual)
16
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.1 Data Communication Function Using User Frame
299
16.2
User Frame On-Demand Data Transmission and
Buffer Memory Used
This section explains the on-demand data transmission processing using a user frame and the arrangement of on-demand data based on the user frame specification to the buffer memory.
Transmission of on-demand data using user frames
The following describes the transmission of on-demand data using user frames.
■
Processing on the CPU module side
• Before issuing a transmission request to C24, set the No. of the user frame registered in C24 to the buffer memory shown in the table below.
• The execution procedures and control procedures of the CPU module side excluding the above are the same as transmitting on-demand data without user frame described in the following manual.
( MELSEC Communication Protocol Reference Manual)
■
Processing of the target device side
• When the target device receives the user frame transmitted by C24 as the start frame, receive it as on-demand data.
Buffer memory to be used and the order of on-demand data
■
Buffer memory to be used
For on-demand data transmission using a user frame, the user frame to be transmitted is designated in the buffer memories shown below.
Name Description Address
CH1
A9H
AAH
ABH
ACH
CH2
149H
14AH
14BH
14CH
On-demand user frame specification
Start frame No. designation
Final frame No. designation
(1st)
(2nd)
(1st)
(2nd)
Designates the number of the user frame to be transmitted as the start frame.
0H: No designation
For the 1st frame, other than 0 must be designated.
When designating the 1st frame, the 2nd frame can also be designated.
Designates the number of the user frame to be transmitted as the final frame.
0H: No designation
When designating the 1st frame, the 2nd frame can also be designated.
*1 Designates the registration No. (shown below) of the user frame to be transmitted from among the user frames registered in C24.
1H to 3E7H (1 to 999) : Default registration frame
3E8H to 4AFH (1000 to 1199) : User frame (registered in flash ROM)
8001H to 801FH (-32767 to -32737) : User frame (registered in buffer memory)
■
On-demand data arrangement
The following shows the order of on-demand data by user frame specification.
On-demand data
User frame User frame Send data User frame User frame
Transmitted when last frame (2nd) designated.
Transmitted when last frame (1st) designated.
On-demand instruction/transmitted when send data designated in buffer memory.
Transmitted when first frame (2nd) designated.
First frame (1st).
300
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.2 User Frame On-Demand Data Transmission and Buffer Memory Used
■
Combination
Only the following combinations can be used for arrangement of on-demand data by user frame specification.
: designated data
7
8
5
6
3
4
1
2
Combination Data name
Start frame (1st)
Start frame (2nd)
Send data
Final frame (1st)
Final frame (2nd)
■
Description of data to be transmitted
• The outline of data to be transmitted for on-demand data transmission by user frame specification is shown below.
Contents of data to be transmitted
User frame
• Start frame (1st)
• Final frame (Last 1 frame)
User frame
• Start frame (2nd)
• Final frame (Other than last 1 frame)
Send data
( MELSEC Communication
Protocol Reference Manual)
Communication with ASCII code
Communication wit binary code
The data of the code registered in C24 is transmitted. (No conversion) The portions of which registered code is from 00H to FEH
Combined portions of which registered code is FFH and 00H to
FFH
The portions of which registered code is from 00H to FEH
Combined portions of which registered code is FFH and 00H to
FFH
The data according to the user-designated contents, code, and number of bytes is transmitted.
The data of the code registered in
C24 is converted to ASCII data and transmitted.
The data of the contents, code, and number of bytes designated by the user to ASCII data and transmitted.
The designated send data is converted to ASCII data and transmitted.
The data of the code registered in
C24 is transmitted.
For 10H data, the data of 10H + 10H is transmitted.
The data of the contents, code, and number of bytes designated by the user is transmitted.
For 10H data, the data of 10H + 10H is transmitted.
The designated send data is transmitted by the code unchanged.
(No conversion)
For 10H data, the data of 10H + 10H is transmitted.
16
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.2 User Frame On-Demand Data Transmission and Buffer Memory Used
301
16.3
On-Demand Function Control Procedure During
User Frame Use
This section explains the control procedure when on-demand data is transmitted to a target device with the on-demand function by using a user frame.
Data communication using the ASCII code
Control procedure when two-word send data (1234H, 5678H) is designated by ONDEMAND instruction
• Set the "Communication protocol setting" to any one of "MC protocol (Format 1)" to "MC protocol (Format 4)".
• Set the "Station number" to "0".
• Set the "Word/byte units designation" to word unit.
• Set the "On-demand user frame specification" items to the following:
Start frame No. 1st: 02H
Start frame No. 2nd: 3EBH
Final frame No. 1st: 401H
Final frame No. 2nd: 0H (No specification)
• User frame registration
User frame No.
02H (2)
3EBH (1003)
401H (1025)
User frame (Registered code)
02H
F9H, 00H, 00H, FFH, FFH, 00H
03H, FFH, F1H
Contents of user frame registration
Data code from STX to host station number matched to 3C frame, format 1
Data code of ETX, sum check code equivalent to 3C frame, format 1
302
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.3 On-Demand Function Control Procedure During User Frame Use
Target device
(Data name)
CPU module
(Example)
Added by C24
First frame (1st)
First frame (2nd) Last frame (1st)
Send data
User frame User frame
02H F9H 00H
S
T
X F 9 0 0
00H FFH,FFH 00H
0 0 F F 0 0 1 2 3 4 5 6 7 8
Sum check
Code
H L
02H 46H 39H 30H 30H 30H 30H 46H 46H 30H 30H 31H 32H 33H 34H 35H 36H 37H 38H 03H 44H 32H
User frame registration code
Send data corresponding to registration code
Send data code
ONDEMAND command
ONDEMAND command complete bit
ONDEMAND command abnormal complete bit
1Scan
(Word units) Un\G150
Buffer memory
0
(First address) Un\G160
(Data length) Un\G161
(1st first frame No.) Un\G169
(2nd first frame No.) Un\G170
(1st last frame No.) Un\G171
(2nd last frame No.) Un\G172
C00H
2
02H
3EBH
401H
0H
(Result of execution) Un\G598 0
(Send data)
Un\G3072
Un\G3073
(CH1 side)
1234H
5678H
When a transmission error is generated, other than 0 is stored.
Sequentially transmits the data in 4-bit units, beginning from the most significant bit.
16
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.3 On-Demand Function Control Procedure During User Frame Use
303
Data communications using the binary code
Control procedure when two-word send data (1234H, 5678H) is designated by ONDEMAND instruction
• Set the "Communication protocol setting" to "MC protocol (Format 5)".
• Set the "Station number" to "0".
• Set the "Word/byte units designation" to word unit.
• Set the "On-demand user frame specification" items to the following:
Start frame No. 1st: 3ECH
Start frame No. 2nd: 0H (No specification)
Final frame No. 1st: 402H
Final frame No. 2nd: 0H (No specification)
• User frame registration
User frame No.
3ECH (1004)
402H (1026)
User frame (Registered code)
02H, FFH, 01H, 3BH
03H, FFH, F0H, 0DH, 0AH
Contents of user frame registration
STX + C24 station No. +;
ETX + sum check code + CR + LF
Sum check code is designated by one byte binary code.
304
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.3 On-Demand Function Control Procedure During User Frame Use
Target device
(Data name)
CPU module
(Example)
Added by C24
First frame
(1st)
Last frame
(1st)
User frame
Send data
User frame
02H FFH,01H 3BH
S
T
X ;
03H FFH,F0H 0DH 0AH
E
T
X
Sum check code
C
R
L
F
02H 00H 3BH 12H 34H 56H 78H 03H 17H 0DH 0AH
User frame registration code
Send data corresponding to registration code
Send data code
ONDEMAND command
ONDEMAND command complete bit
ONDEMAND command abnormal completion bit
1 scan
(Word units) Un\G150
Buffer memory
0
(First address) Un\G160
(Data length) Un\G161
C00H
2
(1st first frame No.) Un\G169
(2nd first frame No.)
(1st last frame No.)
(2nd last frame No.)
Un\G170
Un\G171
Un\G172
3ECH
0H
402H
0H
(Result of execution) Un\G598
(Send data)
Un\G3072
Un\G3073
(CH1 side)
0
1234H
5678H
When a transmission error is generated, other than 0 is stored.
Sequentially transmits the data in 4-bit units, beginning from the most significant bit.
16
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.3 On-Demand Function Control Procedure During User Frame Use
305
16.4
Example of On-Demand Data Transmission
Program Using User Frames
The following shows a program example when transmitting on-demand data including user frames.
Configure the settings and perform registration with Engineering tool in advance.
On-demand data transmission program using user frames
■
Input/output signal of C24
Install C24 in the position where the I/O signal is X/Y00 to X/Y1F.
■
C24 interface used for communication with target device
CH1 side RS-232 interface of C24
■
Parameter settings
Setting item
Basic settings
Various control specification
Application settings
User frame specification
Communication protocol setting
Communication speed setting
Transmission setting Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Communication control specification Word/byte units designation
Send wait time specification
On-demand function specification
On-demand user frame specification
Transmission wait time designation
Buffer memory start address designation
Data length designation
Start frame No. designation (1st)
Start frame No. designation (2nd)
Final frame No. designation (1st)
Final frame No. designation (2nd)
0H
2H
3EBH
401H
0H
Setting value
MC protocol (format 1)
19200 bps
8 bits
None
Odd
1 bit
None
Disable
Disable
0
Word
0H
400H
■
Program example
Transmit the on-demand data with the on-demand function, and designate the two-word data to be transmitted with the
ONDEMAND instruction.
The data in the user frame portion of the on-demand data to be transmitted is the registered data of the user frame number registered with Engineering tool.
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_SendOndemand Sends data using the on-demand function of MC protocol.
For information on the module FB to be used, refer to the following manual.
306
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.4 Example of On-Demand Data Transmission Program Using User Frames
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(3)
(61)
(63)
(65)
On-demand transmission direction pulse
Set the transmission channel to the CH1 side.
Set the send data quantity to two-word.
Set the data to be transmitted.
Reset the normal completion flag.
Reset the abnormal completion flag.
Set the execution direction.
Normal completion
Abnormal completion
Reset the execution direction.
• The SPBUSY instruction is used to read the communication status by the dedicated instruction. (
• Designate the storage capacity for send data (stored in D10 to D11 in the above program example) and data length (stored in D2 in the above program example) so that they do not exceed the range of buffer memory assigned by the user for the on-demand function.
16
16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
16.4 Example of On-Demand Data Transmission Program Using User Frames
307
17
DATA COMMUNICATIONS USING USER
FRAMES
Registering the fixed format portion of the message transmitted/received by a target device and C24 as a user frame beforehand allows data transmission/reception using a user frame.
Data transmission/reception using a user frame simplifies the creation of data to be transmitted on the CPU module side, and the program for checking received data.
This chapter explains the data transmission/reception methods and procedures when communication data using user frames with the nonprocedural protocol of C24.
User frame
Data transmission
Arbitrary data
C24
Arbitrary data
Data reception
User frame
Target device such as a bar code reader or ID controller personal computer
For details on "Transparent code" and "ASCII-BIN conversion", refer to the following chapters.
• When using transparent codes (
Page 358 TRANSPARENT CODES AND ADDITIONAL CODES)
• When performing data communication using ASCII-BIN conversion (
WITH ASCII CODE (ASCII-BIN CONVERSION))
308
17 DATA COMMUNICATIONS USING USER FRAMES
17.1
Procedure of Data Communication
This section explains an overview of the procedure when performing data communication between a target device and a CPU module using a user frame.
Start
17
Parameter setting with Engineering tool
(When only default registration frame is used)
(When registering user frames)
Registration using module extended parameter or registration in flash ROM of C24
*1,*2
(When receiving data)
Set user frame No., etc. to receive user frame designation area
(Un\G173 to 181, 333 to 341, 8224 to 8231,
8480 to 8487) of the
C24 buffer memory
*3
Start data communications
(Transmission) (Reception)
Read receive data Designate user frame No. to transmission user frame designation area (Un\G183 to 285, 343 to 445) of the C24 buffer memory.
*4,*5
Designate transmitted data (arbitrary data portion in message to be transmitted) to transmit area of the C24 buffer memory.
*6
Data transmission
*1
*2
Page 282 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
*3
Page 321 Setting of receive user frames
*4
*5
Page 316 Timing for start/completion of data reception
*6
17 DATA COMMUNICATIONS USING USER FRAMES
17.1 Procedure of Data Communication
309
17.2
Data Reception
When receiving data using a user frame, the reception method on C24 side includes Method 0 and Method 1.
The following explains data reception for each method.
Receive data
In data reception using a user frame, data arranged as indicated below can be received.
User frame
(first frame)
Arbitrary data
User frame
(last frame)
With the first frame ( *1)
Without the first frame ( *1)
Reception method
Combination
Format-0
Format-1
Format-0
(1-A)
(1-B)
(1-C)
(1-D)
(1-E)
(2-A)
(2-B)
User frame
(first frame)
Arbitrary data
User frame
(last frame)
Remarks
For data reception, mixed settings are possible.
: Specified data exists.
(When ASCII-BIN conversion is set to "Disable")
Codes that can be received
Codes stored to reception area*3
00H to FFH
00H to FFH
(Not stored)
00H to FFH
*2
(When ASCII-BIN conversion is set to "Enable")
Codes that can be received
00H to FFH
30H to 39H,
41H to 46H
Codes stored to reception area*3
(Not stored)
0H to 9H, AH to FH
*1 User frames for receiving
The user frame for data reception can be set to a maximum of four combinations of the start frame and the final frame, regardless of whether there is a specification.
For a combination that specifies the start frame (with a start frame), specifying the start frame is required even in other combinations.
For a combination that does not specify the start frame (without a start frame), the start frame cannot be specified even in other combinations.
A combination with the start frame and a combination without the start frame cannot be combined.
*2 If data of other than 30H to 39H and 41H to 46H are received as the data code of the arbitrary data area (including the transparent code data), an error will occur after the C24 ASCII-BIN conversion processing.
*3 Arbitrary data portion of received data
When the arbitrary data portion is stored to the receive area, and the storage byte quantity is an odd number of bytes, the receive data quantity shown below is stored to the receive data quantity storage area. (When ASCII-BIN conversion is enabled, the receive data quantity is the storage byte count when the arbitrary data portion is converted to binary code and stored to the receive area.)
Word units: Receive data quantity = Number of bytes stored to receive area 2 (Digits after a decimal points are rounded up.)
Byte units: Receive data quantity = Number of bytes stored to receive area
(00H is stored to the upper byte of the last data storage location of the receive area.)
When "ASCII-BIN conversion" is enabled, make the arbitrary data part of the receive data an even number of bytes excluding the additional code.
310
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
Handling of received data by C24
• When a user frame (start frame, final frame) registered to C24 is received, the reception processing by user frame is performed.
• Of the start frame No. and final frame No. (maximum 4 sets) set in default by the user for the user frame specification for receiving area in buffer memory, the set number (nth) of the user frame received from the target device is stored to the receive user frame storage area.
• When a transparent code for receiving is specified, the additional code data included in the arbitrary data portion is deleted immediately after reception (or, before conversion when ASCII-BIN conversion is performed).
17
Reception with the start frame (combination 1-A to C) (reception using Method 0)
■
Reception of combination (1-A)
This is a method that any data portion of a reception message which can be handled by the CPU module side is enclosed by a start frame and a final frame and transmitted from a target device.
C24 starts the reception processing when data of the same arrangement as the start frame is received.
When data of the same arrangement as the final frame is received, the arbitrary data is stored in the receive area on the buffer memory and a read request is issued to the CPU module.
Precautions
• Any received data prior to the start frame will be ignored.
• Set a data quantity that exceeds the size of the arbitrary data portion to be received for the receive end data quantity initially set to C24.
• Reception processing by the receive end code initially set to C24 will not be performed. Received data of a receive end code are treated as an arbitrary data portion.
Ex.
When data transmitted from a bar code reader is received
Register STX as the start frame and register ETX as the final frame according to the message format of the bar code reader.
(Data format transmitted from the bar code reader)
Receive data
S
T
X
02
H
Data
(arbitrary data)
E
T
X
03
H
First frame : STX
Last frame : ETX
: Reception start timing
: Receive complete timing (read timing)
Ignored Stored in the reception area
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
311
■
Reception of combination (1-B)
This is a method that message to be received by the CPU module side are all transmitted in a fixed format from a target device.
C24 starts the reception processing when data of the same arrangement as the start frame is received.
When data of the same arrangement as the final frame is received, a read request is issued to the CPU module.
Since there is no arbitrary data portion, the receive data quantity will be "0" when a read request is issued to the CPU module.
Precautions
• Any received data prior to the start frame will be ignored.
• The receive end data quantity initially set to C24 uses the default value.
Ex.
When ACK is registered as the start frame, and CR+LF is registered as the final frame
Receive data
A
C
K
C
R
L
F
06
H
0D
H
0A
H
First frame : ACK
Last frame : CR, LF
: Reception start timing
: Receive complete timing (read timing)
Ignored Stored in the reception area
The received data count is "0".
■
Reception of combination (1-C)
This is a method that the start of data transmission from a target device to the CPU module side is notified by a start frame, an arbitrary data portion of a fixed length is repeatedly transmitted from a target decide after that.
After the start frame is received, the subsequent received data will be handled as arbitrary data portion.
C24 starts the reception processing when data of the same arrangement as the start frame is received.
A read request is repeatedly issued to the CPU module when an arbitrary data portion, which is equivalent to the receive end data quantity initially set to C24, is received.
Precautions
• Any received data prior to the start frame will be ignored.
• The receive end data quantity initially set to C24 should be a data quantity for an arbitrary data (fixed length) transmitted from the target device.
• Reception processing by the receive end code initially set to C24 will not be performed. Received data of a receive end code are treated as an arbitrary data portion.
Ex.
Receive data
First frame
Ignored
Arbitrary data
For the received data count
For the received data count
Stored in the reception area
Stored in the reception area
: Reception start timing
: Receive complete timing (read timing)
312
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
Reception with the start frame (combination 1-D, 1-E) (reception using Method 1)
This is a method that an arbitrary data portion, which is equivalent to the 'Method 1 dedicated receive end data quantity' initially set to C24, is transmitted from a target device with a start frame.
C24 starts the reception processing when data of the same arrangement as the start frame is received.
When an arbitrary data, which is equivalent to the specified 'Method 1 dedicated receive end data quantity', is received, the arbitrary data portion is stored in the receive area on the buffer memory and a read request is issued to the CPU module.
• Method 1 dedicated receive end data quantity
The receive end data quantity for data reception by using Method 1 is referred to as 'method 1 dedicated receive end data quantity'.
It can be specified with the number of word/byte of "0" or bigger (the unit depends on the word/byte units designation) for each combination of the start frame and the final frame, which specifies Method 1 (up to 4 combinations).
Precautions
• Any received data prior to the start frame will be ignored.
• The receive end data quantity initially set to C24 is not used.
• Reception processing by the receive end code initially set to C24 will not be performed. Received data of a receive end code are treated as an arbitrary data portion.
• For reception using Method 1, set "No designation" to the final frame.
Ex.
By specifying a user frame, in which only ACK (06H) is registered, as the start frame and also the 'method 1 dedicated receive end data quantity' for an arbitrary data portion as 0 bytes, a read request will be issued to the CPU module upon the reception of a 1-byte ACK.
Ex.
By specifying a user frame, in which only NAK (15H) is registered, as the start frame and also the 'method 1 dedicated receive end data quantity' for an arbitrary data portion as 2 bytes, a read request will be issued to the CPU module upon the reception of NAK + 2-byte data.
Receive data
N
A
K
(1234H)
15
H
34
H
12
H
For received data count for format 1 only
First frame: NAK
: Reception start timing
: Receive complete timing (read timing)
Ignored Stored in the reception area
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
313
Reception without the start frame (combination 2-A, 2-B) (reception using Method 0)
■
Reception of combination (2-A)
This is a method that a user frame is used as the final frame in place of the end code for nonprocedural protocol data reception and transmitted from a target device with an arbitrary data portion.
C24 starts the reception processing when the arbitrary data portion is received.
When data of the same arrangement as the final frame is received, the arbitrary data is stored in the receive area on the buffer memory and a read request is issued to the CPU module.
Precautions
• Any received data prior to the final frame will be all treated as an arbitrary data portion.
• The receive end data quantity initially set to C24 should be a data quantity that exceeds the size of the arbitrary data to be received.
• C24 performs the following processing with respect to the received data that is the same as the receive end code initially set to C24.
When it is included in the arbitrary data portion: C24 performs the reception processing by the receive end code.
When it is included in the final frame: C24 does not perform the reception processing by the receive end code.
Ex.
By registering ETX + CR + LF as the final frame, a read request is issued to the CPU module when the end of the received data receives a message of ETX + CR+ LF.
Arbitrary data
E
T
X
C
R
L
F
03
H
0D
H
0A
H
Last frame: ETX, CR, LF
: Reception start timing
: Receive complete timing (read timing)
Stored in the reception area
■
Reception of combination (2-B)
This is a method that a user frame is used as the final frame in place of the end code for nonprocedural protocol data reception and data in a fixed format is transmitted from a target device.
C24 issues a read request to the CPU module when data of the same arrangement as the final frame is received.
Upon data reception of this combination which contains no arbitrary data portion, the receive data quantity will be "0" when a read request is issued to the CPU module.
Precautions
• Any received data prior to the final frame will be all treated as an arbitrary data portion.
• The receive end data quantity initially set to C24 uses the default value.
• When received data that is the same as the receive end code initially set to C24 is included in the final frame, C24 does not perform the reception processing by the receive end code.
Ex.
By registering ACK + CR + LF as the final frame, a read request is issued to the CPU module when the end of the received data receives a message of ACK + CR + LF.
A
C
K
C
R
L
F
06H 0DH 0AH
Last frame: ACK, CR, LF
314
: Reception start timing
: Receive complete timing (read timing)
Stored in the reception area
The received data count is "0".
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
Remarks
The following shows the difference between the reception methods (Method 0 and Method 1) in regard to how to treat the received data when data in combination of (a start frame + and arbitrary data portion) is received.
■
When data is received using Method 0 (combination (1-C))
• C24 regards all arbitrary data portions as valid data after a start frame has been received, and stores it sequentially in the receive area.
• C24 issues a read request to the CPU module each time arbitrary data portions, which are equivalent to the receive end data quantity, are received, and repeats this process.
17
Receive data
First frame Arbitrary data
For the received data count
For the received data count
: Reception start timing
: Receive complete timing (read timing)
Ignored Stored in the reception area
Stored in the reception area
■
When data is received using Method 1 (combination (1-D, 1-E))
• C24 regards arbitrary data portions, which are equivalent to the 'method 1 dedicated receive end data quantity' specified for combination of the received start frames, as valid data after a start frame has been received, and stores it in the receive area. It then issues a read request to the CPU module.
• Any received data after data, which is equivalent to the 'method 1 dedicated receive end data quantity', has been received up to the next start frame will be ignored. (Data will not be stored in the receive area.)
Receive data First frame Arbitrary data
For received data count for format 1 only
Receive data First frame Arbitrary data
For received data count for format 1 only
Ignored Stored in the reception area
Ignored Stored in the reception area
: Reception start timing
: Receive complete timing (read timing)
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
315
Timing for start/completion of data reception
This section explains the reading of received data based on the user frame and other factors (such as the receive end code and receive end data quantity) during data reception using a user frame.
Timing for start/completion of data reception
The following describes the timing for start/completion of the data reception processing with C24.
• Data reception using a user frame
• Data reception using the receive end code and receive end data quantity initially set in C24
• Data reception using 'method 1 dedicated receive end data quantity'
Type When using Method 1 Setting of the receive user frame
When using Method 0
With a start frame When the start frame is received.
Without a start frame When the first data of arbitrary data is received.
Data receptio n start
Data receptio n completi on
The factors of data reception completion (timing of reading received data to the CPU module) is one of the following:
(Depends on the conditions of the prior settings.
Page 317 Timing chart for reception processing of C24)
• When the final frame is received.
• When data of the receive end code is received. (In the case of a combination without the start frame)
• When data which is equivalent to the receive end data quantity is received.
• When a reception error (time out for the no-reception monitoring time (timer 0)) occurs.
• When the start frame is received while "0" is specified for the 'method 1 dedicated receive end data quantity'.
• When data which is equivalent to the 'method 1 dedicated receive end data quantity' is received while "1" or more is specified for the 'method 1 dedicated receive end data quantity'.
• When a reception error (time out for the no-reception monitoring time (timer 0)) occurs.
Arbitrary data portion up to the reception of any listed above or the occurrence of a reception error is stored in the receive area in the buffer memory.
316
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
Timing chart for reception processing of C24
The charts indicating the timing of the reception processing for data reception using a user frame, including the reception processing by the receive end data quantity, are shown below.
The numbers in the table indicate the timing of a received data read request to the CPU module.
Combination Amount of received data of arbitrary data
Combi nation with the start frame
Combi nation without the start frame
1-A
1-B
1-C
1-D
1-E
Receive data quantity < receive end data quantity
Receive data quantity Receive end data quantity
Receive data quantity = 0
Receive data quantity Receive end data quantity
Receive data quantity > Receive end data quantity
Receive data quantity
Method 1 dedicated receive end data quantity > 0
Receive data quantity
Method 1 dedicated receive end data quantity = 0
Receive data quantity < Receive end data quantity
Receive data quantity Receive end data quantity
Receive data quantity = 0
Timing pattern number
Received data
Received data prior to the reception of the start frame
When receiving the start frame
Deleted Data reception start
When receiving arbitrary data in the reception message
1-A(2)
Data recepti on start
1-E
1-C(1)
1-C(2)
1-D
Data recepti on start
When receiving the final frame
1-A(1)
1-B
Data reception start 2-A(1)
2-A(2)
Data reception start
When receiving
Data of the end code is treated as part of arbitrary data.
Data of the end code is treated as part of arbitrary data.
2-A(3)
2-A(4)
2-B
*1 The reception processing by the receive end code is not performed when the same data as the receive end code has been registered in the final frame.
*2 The data reception interval is not monitored with the no-reception monitoring time (timer 0) when only the final frame is set.
17
When a reception error is detected, C24 stores arbitrary data portion of the data received immediately before the error in the receive area on the buffer memory, then turns the 'CH1 reception abnormal detection' (X4) ON.
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
317
■
Combination with the start frame (Timing patterns for data reception start and data reception complete (read))
(For data reception with format-0)
Pattern No. 1-A 1) Pattern No. 1-A 2)
Arbitrary data Arbitrary data Target device
CPU module
Equaling the received data count
For the received data count
Pattern No. 1-B
Target device
CPU module
Target device
CPU module
Pattern No. 1-C 1)
Arbitrary data
For the received data count
Pattern No. 1-C 2)
Arbitrary data
For the received data count
For the received data count
(For data reception with format-1)
Pattern No. 1-D
Target device Arbitrary data
CPU module
For received data count for format 1 only
Pattern No. 1-E
Receive data
Ignored
Arbitrary data
For received data count for format 1 only
Target device Receive data : Reception start timing
: Receive complete timing (read timing)
CPU module When received data count for format 1 only is 0
Ignored
When data is received using Method 1, C24 checks again whether the start frame has been received after receiving data equaling the 'method 1 dedicated receive end data quantity'. Reception data during that time is ignored.
318
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
■
Combination without the start frame (Timing patterns for data reception start and data reception complete (read))
Pattern No. 2-A 1) Pattern No. 2-A 2)
Target device
CPU module
Arbitrary data
Target device
CPU module
Pattern No. 2-A 3)
Arbitrary data
Pattern No. 2-B
Arbitrary data
Arbitrary data
For the received data count
Pattern No. 2-A 4)
Arbitrary data
For the received data count
Arbitrary data
: Reception start timing
: Receive complete timing (read timing)
Target device
CPU module
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
319
Reception procedure
The following shows the reception procedure when a message, including data with the same arrangement as the specified user frame, is received and the arbitrary data is read to the CPU module.
Procedure
(When the CH1 side interface of C24 receives data)
Read the user frame setting number received from the target device ( -th) out of the start frame number and final frame number (up to 4 combinations) initially set in the user frame specification for receiving area on the buffer memory from the
'Receive user frame (nth)' (Un\G603).
Read arbitrary data portion in the reception message from the receive area (Un\G1536 to 2047 (default))
Receive data with the user frame (*1)
Target device
User frame
(first frame)
Arbitrary data
User frame
(last frame)
CPU module (*2)
Reception data read request
X3
(*1)
CPU module
(*3
Ó
)
INPUT
ON
Completion device
ON
Abnormal completion
Status display device at completion Normal completion
1 scan
(*3
Ò
)
FROM
*1 For received data using a user frame and the timing of reading the received data to the CPU module, refer to the timing for start/ completion of data reception (
Page 316 Timing for start/completion of data reception)
*2 The receive user frame registration number and others should have been set with Engineering tool.
At the time of debugging, the initial setting value for data reception shall be set prior to data reception, but after debugging is completed, it shall be set to the startup of C24. (
Page 321 Setting of receive user frames)
*3 Reading ( ) for the CPU module to check which user frame was received by C24 and reading of the received data ( ).
320
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
Setting of receive user frames
Setting of the receive user frame
This setting is to receive data from a target data using the nonprocedural protocol with a user frame.
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "User frame specification"
Setting item
Receive end data quantity designation
Receive end code designation
User frame use enable/disable designation
Start frame No. designation 1st to 4th
Final frame No. designation
User frame receiving method designation
1st to 4th
1st to 4th
Method 1 dedicated receive end data quantity
1st to 4th
Description of setting value
Method 0 Method 1
Designates the data quantity that exceeds the size of the arbitrary data to be received or the data count of the received data size.
The specified value is invalid. (The 'method 1 dedicated receive end data quantity' becomes valid.)
• Reception of combination with the start frame: The specified value is invalid
• Reception of combination without the start frame: Designate the code for the last data in the reception message for performing a read request to the CPU module.
Designates "Use".
Designate the user frame No. ('0' or '1' or higher).
Designate the user frame No. ('0' or '1' or higher).
Designate "Method 0".
Designate the user frame No. ('1' or higher).
Designate '0H' for all.
Designate "Method 1".
The specified value is invalid.
Designate the data quantity for the arbitrary data to be received.
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
321
Examples of registering a receive user frame
The following are examples of pre-registering a receive user frame on the CH1 side with Engineering tool.
■
When the start frame is specified
In the example, the following three combinations are registered for the receive user frame.
• Setting conditions
User frame
(Start frame + Final frame)
User frame receiving method designation
Method 0
Method 1 dedicated receive end data quantity
1st combination
2nd combination
3rd combination
(Start frame only)
(Start frame only)
Method 1
Method 1
0H
2H
Remarks
The receive end data quantity becomes valid.
Method 1 dedicated receive end data quantity becomes valid.
• Setting value
Setting item
Receive end data quantity designation
Receive end code designation
User frame specification for receiving
User frame use enable/disable designation
User frame specification for receiving
Start frame No. designation
1st
2nd
3rd
User frame specification for receiving
Final frame No. designation
4th
1st
User frame receiving method designation
2nd
3rd
4th
1st
Method 1 dedicated receive end data quantity designation
2nd
3rd
4th
1st
2nd
3rd
4th
Setting value
1FFH
FFFFH
Use
0H
2H
0H
3E8H
3E9H
3EAH
0H
41DH
0H
0H
0H
Method 0
Method 1
Method 1
Method 0
0H
Remarks
For Method 0
Set to "No designation" for receive end code.
Always specify "Use".
0H: No designation
1H or higher: Designated
In this setting, only three combinations become valid.
The receive end data quantity becomes valid.
Method 1 dedicated receive end data quantity becomes valid.
For Method 1
322
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
■
When the start frame is not specified
In the example, the following three combinations are registered for the receive user frame.
• Setting conditions
User frame
(Final frame only)
User frame receiving method designation
Method 0
Method 1 dedicated receive end data quantity
1st combination
2nd combination
3rd combination
(Final frame only)
(Final frame only)
Remarks
The receive end data quantity becomes valid.
• Setting value
Setting item
Receive end data quantity designation
Receive end code designation
User frame specification for receiving
User frame use enable/disable designation
User frame specification for receiving
Start frame No. designation
1st
2nd
3rd
4th
User frame specification for receiving
Final frame No. designation
User frame receiving method designation
1st
2nd
3rd
4th
1st
2nd
3rd
4th
Method 1 dedicated receive end data quantity designation
1st
2nd
3rd
4th
Setting value
1FFH
H
Use
0H
0H
0H
0H
Method 0
Method 0
Method 0
Method 0
0H
0H
0H
0H
41DH
41EH
41FH
0H
Remarks
For Method 0
Designate any receive end code.
Always specify "Use".
0H: No designation
0H: No designation
1H or higher: Designated
In this setting, only three combinations become valid.
The receive end data quantity becomes valid.
'Method 0' is applied to all since the start frame is not designated.
Setting value for Method 1.
This setting is not required since 'Method 0' is applied to all.
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
323
Receive user frame setting details
The following explains the purpose and designated value/stored value of each setting data for data reception using a user frame.
■
User frame use enable/disable designation (Un\G173/333)
Designate "Use" when using user frames to receive data.
Buffer memory address Un\G173/333 b15 to b0
(Default 0H)
Write 1H
0: Do not use.
1: Use.
2: Data communication enable (C24 is set)
• Write '1' in the user frame use enable/disable designation area.
• After the preparation for receiving data using the user frames is completed, '2' is written in the user frame use enable/ disable designation area. (Set by C24)
• After the value in the user frame use enable/disable designation area is changed from '1' to '2', start receiving data used by the user frame.
Until '2' is written in the user frame use enable/disable designation area, data transmission cannot be started.
324
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
■
Start frame No. designation area and final frame No. designation area (Un\G174 to 181/334 to
341)
From among the user frames registered in C24, designate the user frame No. to be used by following the designation method as shown below.
Buffer memory address Un\G174/334 to
Un\G177/337
Un\G178/337 to
Un\G181/341 b15 to to to b0 (Default All 0H)
First frame (1st) to
First frame (4th)
Last frame (1st) to
Last frame (4th)
First combination
Fourth combination
Write 0H to 801FH
• 0H (0): No designation
• 1H to 3E7H (1 to 999): Designate the default registration frame (for OS ROM registration).
• 3E8H to 4AFH (1000 to 1199): Designate the user frame (for flash ROM registration).
• 8001H to 801FH (-32767 to -32737): Designate the user frame (for buffer memory registration).
Precautions
• For the receive user frames, the start frame and final frame are set as a pair, regardless of whether the target device transmits these frames.
(If the target device does not transmit either one of the frames, set the frame No. that is not transmitted to "0" (No designation).)
• A maximum of four combinations of start and final frames can be set for the nonprocedural protocol.
However, if there is a combination that specifies the start frame when multiple combinations are set, specify the start frame for all other combinations.
In addition, set in the following order starting from the first buffer memory.
When specifying the start frame
Each frame number for combinations that specify the start frame and the final frame
Each frame number for combinations that specify the start frame but not the final frame
When setting multiple combinations
For the combination that specifies only the final frame without specifying the start frame, the start frame for all of the combinations cannot be specified. Set the frame number for the final frame to be used from the first buffer memory in order.
• When setting more than one combination, the start frame having the registered code in the same arrangement or the same frame No. cannot be designated.
• Use the user frame No. of the following user frames to set the receive user frames.
Default registration frame No.: 1H to 3E7H
User frame No. registered in C24 flash ROM: 3E8H to 4AFH
User frame No. registered in C24 buffer memory: 8001H to 801FH
• Do not set the frame number of a user frame contains the additional code data by the transparent code for receiving specification as a user frame for data reception using the nonprocedural protocol.
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
325
■
User frame receiving method designation (Un\G8224 to 8227/8480 to 8483)
In data reception using a user frame, designate the reception method for each combination of receive user frames.
This setting is valid when the setting is configured in a combination that specifies a start frame. (
(Default 0H)
Buffer memory address Un\G8224/8480 b15 to
Setting for the first combination
Setting for the second combination
Setting for the third combination b0
Un\G8227/8483 Setting for the fourth combination
Specify the reception method
0H: Format-0
1H: Format-1
For combinations other than those with the start frame only, data reception is performed using 'Method 0' even if 'Method 1' is designated through the above reception method setting.
■
Method 1 dedicated receive end data quantity designation (Un\G8228 to 8231/8484 to 8487)
• For a combination specifying Method 1 in the user frame receiving method designation, designate the arbitrary data word/ byte count (size for performing a reception data read request to the CPU module) when the applicable start frame is received.
Specify this for each combination specifying Method 1.
• Designate this within the size of the receive data storage area on the buffer memory.
• The unit of setting values is in accordance with the setting value set for word/byte units designation.
(Default 0H)
Buffer memory address Un\G8228/8484 b15 to
Setting for the first combination
Setting for the second combination b0
Un\G8231/8487
Setting for the third combination
Setting for the fourth combination
Received data count for format 1 only
Write 0H to FFFFH
326
17 DATA COMMUNICATIONS USING USER FRAMES
17.2 Data Reception
17.3
Program for Data Reception with User Frame
This section shows examples of the program to read the received data stored in C24 buffer memory to the CPU module, when data including the user frame is received.
Reception program example
Data reception using a user frame in the following conditions and settings is shown below.
■
Input/output signal of C24
Install C24 in the position where the I/O signal is X/Y00 to X/Y1F.
■
C24 interface used for communication with target device
CH1 side RS-232 interface of C24
■
Parameter settings
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting
Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
■
Setting content of buffer memory
For other than the following items, use default values.
Name Address DEC (HEX)
CH1
173 (ADH)
174 (AEH)
User frame use enable/disable designation
Start frame No. designation, 1st
Setting value
175 (AFH)
176 (B0H)
177 (B1H)
178 (B2H)
179 (B3H)
180 (B4H)
181 (B5H)
8224 (2020H)
8225 (2021H)
8226 (2022H)
8227 (2023H)
8229 (2025H)
8230 (2026H)
8231 (2027H)
Start frame No. designation, 2nd *1
Start frame No. designation, 3rd
Start frame No. designation, 4th *1
Final frame No. designation, 1st *1
Final frame No. designation, 2nd
Final frame No. designation, 3rd
Final frame No. designation, 4th
User frame receiving method designation, 1st
User frame receiving method designation, 2nd
User frame receiving method designation, 3rd
User frame receiving method designation, 4th
Method 1 dedicated receive end data quantity designation, 2nd
Method 1 dedicated receive end data quantity designation, 3rd
Method 1 dedicated receive end data quantity designation, 4th
1H: Use
6H
15H
0H: None
0H: None
0H: None
0H: Method 0
1H: Method 1
1H: Method 1
1H: Method 1
12 words
0 word
2 words
Setting value
Nonprocedural protocol
19200 bps
Independent
8
None
Odd
1
None
Disable
Disable
*1 It indicates the registered contents of the user frame No. specified to the start and final frame No., respectively.
*2 When the setting is configured with Engineering tool. (
Page 328 Program example when setting with Engineering tool)
*3 When the setting is configured by a program. (
Page 331 Program example when setting by a program)
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
327
■
Registration contents in user frame
User frame No.
3E8H/8001H
3E9H/8002H
6H
15H
41BH/8005H
Registered code
02H, 51H, 20H, 0AH, 3BH
02H, 41H, 3BH
06H
15H
03H, FFH, F0H
Registered data content
STX, Q, (SP), Station No. of target device, ;
STX, A, ;
ACK
NAK
ETX, Sum check code
Program example when setting with Engineering tool
■
Program example
Category Label name/FB name Description
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.uResult_ReceiveUserFrame_D
Label to be defined Define the global label as shown below.
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
CH1_Receive user frame (nth)
Device
X3
X4
U0\G603
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
328
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
(0)
(14)
(60)
(62)
Read the combinations of user frames received.
Set the reception channel to CH1.
Set the allowable number of data to be received to 20.
Specify the execution instruction.
Execute reception
Set normal completion flag.
Set abnormal completion flag.
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
329
17
(program)
Sets the receive user frame registration No.
D0
D1
D2
D3
D10
D11
Receive user frame
Data reception result
Receive data count
Receive data
Dn
(program)
Setting the user frame receiving format, etc.
Address
Un\G173
Un\G174
Buffer memory
User frame use enable/disable designation to
Un\G177
Un\G178
First frame
No. designation to
Un\G181
Last frame
No. designation
(1st) to
(4th)
(1st) to
(4th)
Un\G600 Data reception result
Un\G603 Receive user frame ( th set)
1st set
4th set
Un\G1536
Un\G1537 to
Reception area
Un\G2047
Received data count storage
Received data storage
Un\G8224 to
Un\G8227
Un\G8228 to
Un\G8231
User frame receiving format designation
Received data count designation for format 1 only
(1st) to
(4th)
(1st) to
(4th)
1st set
4th set
330
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
Program example when setting by a program
■
Program example
Category Label name/FB name Description
Module label
Label to be defined
C24_1
C24_1.bSts_UnitReady
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.uSet_UserFrameUse_Enable_disable_Recei
veUserFrame_D
C24_1.stnCH1.wnSet_FirstFrameNum_1st_ReceiveUserFra
me_D[0]
C24_1.stnCH1.wnSet_FirstFrameNum_1st_ReceiveUserFra
me_D[1]
C24_1.stnCH1.wnSet_FirstFrameNum_1st_ReceiveUserFra
me_D[2]
C24_1.stnCH1.wnSet_FirstFrameNum_1st_ReceiveUserFra
me_D[3]
C24_1.stnCH1.wnSet_LastFrameNum_1st_ReceiveUserFra
me_D[0]
C24_1.stnCH1.wnSet_LastFrameNum_1st_ReceiveUserFra
me_D[1]
C24_1.stnCH1.wnSet_LastFrameNum_1st_ReceiveUserFra
me_D[2]
C24_1.stnCH1.wnSet_LastFrameNum_1st_ReceiveUserFra
me_D[3]
C24_1.stnCH1.uResult_ReceiveUserFrame_D
C24_1.wnForUserRegistrationNo8001H_D[0]
C24_1.wnForUserRegistrationNo8001H_D[1]
C24_1.wnForUserRegistrationNo8001H_D[2]
C24_1.wnForUserRegistrationNo8001H_D[3]
C24_1.wnForUserRegistrationNo8002H_D[0]
C24_1.wnForUserRegistrationNo8002H_D[1]
C24_1.wnForUserRegistrationNo8002H_D[2]
C24_1.wnForUserRegistrationNo8005H_D[0]
C24_1.wnForUserRegistrationNo8005H_D[1]
C24_1.wnForUserRegistrationNo8005H_D[2]
C24_1.stnCH1.wnSet_UserFrameReceiveFormat_D[1]
C24_1.stnCH1.wnSet_UserFrameReceiveFormat_D[2]
C24_1.stnCH1.wnSet_UserFrameReceiveFormat_D[3]
C24_1.stnCH1.wnSet_UserFrameExclusiveFormat1Receive
dDataCount_D[1]
C24_1.stnCH1.wnSet_UserFrameExclusiveFormat1Receive
dDataCount_D[2]
C24_1.stnCH1.wnSet_UserFrameExclusiveFormat1Receive
dDataCount_D[3]
Define the global label as shown below.
Target module
Module READY
CH1 Reception data read request
CH1 Reception abnormal detection
CH1_Receive user frame use enable/disable designation
CH1_Receive user frame_Start frame No. designation
[0]
CH1_Receive user frame_Start frame No. designation
[1]
CH1_Receive user frame_Start frame No. designation
[2]
CH1_Receive user frame_Start frame No. designation
[3]
CH1_Receive user frame_Final frame No. designation [0]
CH1_Receive user frame_Final frame No. designation [1]
CH1_Receive user frame_Final frame No. designation [2]
CH1_Receive user frame_Final frame No. designation [3]
CH1_Receive user frame (nth)
For user registration number 8001H [0]
For user registration number 8001H [1]
For user registration number 8001H [2]
For user registration number 8001H [3]
For user registration number 8002H [0]
For user registration number 8002H [1]
For user registration number 8002H [2]
For user registration number 8005H [0]
For user registration number 8005H [1]
For user registration number 8005H [2]
CH1_User frame receiving method designation [1]
CH1_User frame receiving method designation [2]
CH1_User frame receiving method designation [3]
CH1_User frame method 1 dedicated receive end data quantity [1]
CH1_User frame method 1 dedicated receive end data quantity [2]
CH1_User frame method 1 dedicated receive end data quantity [3]
Device
X1E
X3
X4
U0\G173
U0\G174
U0\G175
U0\G176
U0\G177
U0\G178
U0\G179
U0\G180
U0\G181
U0\G603
U0\G6912
U0\G6913
U0\G6914
U0\G6915
U0\G6953
U0\G6954
U0\G6955
U0\G7076
U0\G7077
U0\G7078
U0\G8225
U0\G8226
U0\G8227
U0\G8229
U0\G8230
U0\G8231
17
FB M+RJ71C24_Input Reads the received data.
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
331
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
332
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
333
17
(3) Frame No. 8001H setting: registration 1 to 4
Frame No. 8002H setting: registration 1 to 4
Frame No. 8005H setting: registration 1 to 4
Start frame No. designation for receiving: 1 to 4
Final frame No. designation for receiving: 1 to 4
Receiving method designation: 2 to 3 - Method 1 designation
Method 1 dedicated receive end data quantity: 2 to 3
Set User frame use enable/disable designation to "Enable".
(105) Reception ready
(112) Read combined number.
Specify the reception channel.
Set the allowable number of data to be received.
Issue the INPUT instruction execution direction.
(172) Normal completion
(174) Abnormal completion
334
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
Application program for data reception using a combination that specifies the start frame
The following shows the program example when receiving data using a combination that specifies the start frame.
Reception program example
Data reception using a user frame set with the following conditions is shown below.
■
C24 interface used for communication with target device
CH1 side RS-232 interface of C24
■
Parameter settings
For other than the following items, use default values.
Item
Word/byte units designation
Transparent code for receiving specification
ASCII-BIN conversion designation
Receive end data quantity
Receive end code
User frame use enable/disable designation
Start frame No. designation
Final frame No. designation
User frame receiving method designation
Method 1 dedicated receive end data quantity designation
Setting content Buffer memory address to store registration value
Word/byte
Designated/No designation
Do not convert
6
No designation
Use
150(96H)
288(120H)
289(121H)
164 (A4H)
165 (A5H)
173 (ADH)
Designated
Method 0/Method 1 8224 to 8227 (2020H to 2023H)
0H to FFFFH
174 to 177 (AEH to B5H)
8228 to 8231 (2024H to 2027H)
Remarks
Set to either one according to the program example.
When 'Designated', Additional code: 10H (DLE)
Transparent code: 02H (STX)
Refer to the illustrations provided in this section.
*1 It indicates the registered contents of the user frame No. specified to the start and final frame No., respectively.
■
Registration contents in user frame
Item
Start frame No.
Final frame No.
1st
2nd
3rd
4th
1st
2nd
3rd
4th
User frame No.
3E8H
3E9H
6H
15H
41BH/8005H
0H (none)
0H (none)
0H (none)
Registered code
02H, 51H, 20H, 0AH, 3BH
02H, 41H, 3BH
06H
15H
03H, FFH, F0H
Registered data content
STX, Q, (SP), Station No. of target device, ;
STX, A, ;
ACK
NAK
ETX, Sum check code
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
335
■
Program example
The following shows example of data reception with a user frame.
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.uResult_ReceiveUserFrame_D
Label to be defined Define the global label as shown below.
Description
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
CH1_Receive user frame (nth)
Device
X3
X4
U0\G603
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(14)
(60)
(62)
Read the combinations of user frames received.
Set the reception channel to CH1.
Set the allowable number of data to be received to 6.
Specify the execution instruction.
Execute reception
Set normal completion flag.
Set abnormal completion flag.
336
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
Operation example of various combinations
■
When receiving with a combination of the start frame, arbitrary data and final frame (reception using Method 0)
Additional code (C24 deletes)
Transparent code
Target device
CPU module
Reception data read request
CPU module
Completion device
Status display device at completion
Head data
X3
M0
M1
When STX is handled as transparent code
D
L
E
S
T
X
10H 02H
Receive data count
Word units
Number of received byte excluding frame and additional code (12)/2=6
Byte units
Number of received byte excluding frame and additional code (12)
S
T
X
Q
;
0 1 2 3
S
T
X
A B C
C
R
L
F
E
T
X
(1234H)
02H 51H 20H 0AH 3BH 30H 31H 32H 33H 02H 41H 42H 43H 34H12H 0DH0AH03H EEH
The following diagram is for word unit
First frame
(corresponds registration
No. 3E8H)
Ò
Arbitrary data portion
INPUT
Un\G8224
Un\G8225
Un\G8226
Un\G8227
Un\G8228
Un\G8229
Un\G8230
Un\G8231
ON
ON
0H
0H
1H
1H
0H
0H
0H
2H
1 scan
Buffer memory
Last frame
(corresponds to register No. 41BH)
Abnormal completion
Normal completion
User frame receiving format designation
(1st = format-0)
(2nd = format-0)
(3rd = format-1)
(4th = format-1)
Received data count for format 1 only
(1st)
(2nd)
(3rd)
(4th)
Un\G173
Un\G174
2H
3E8H
User frame use enable/ disable designation
First frame No. designation
(1st)
Un\G175 3E9H
(2nd)
Un\G176 6H
(3rd)
Un\G177
Un\G178
15H
41BH
(4th)
Last frame No. designation
(1st)
Un\G179
Un\G180
Un\G181
Un\G288
Un\G289
Un\G603
Un\G1536
Un\G1537
Un\G1538
Un\G1539
(Non)
0H
(Non)
0H
(2nd)
(3rd)
(Non)
0H (4th)
(YES) (NO) Receive transparent code
1002H/ 0H designation
(Disable)
0H
1H
00H , 06H
ASCII-BIN conversion designation
Receive user
Ó frame ( th)
Receive data count
Ô to D0 to D3
(1) (0)
31H , 30H
(3) (2)
33H , 32H
Receive data
(arbitrary data portion)
Õ to D10 or after
(A) (STX)
41H , 02H
Un\G1540
Un\G1541
Un\G1542
(C) (B)
43H , 42H
(1234H)
12H , 34H
(LF) (CR)
0AH , 0DH
Buffer memory
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
337
■
When receiving with a combination of the start frame and arbitrary data (reception using
Method 0)
Additional code (C24 deletes)
Transparent code
When STX is handled as transparent code.
D
L
S
T
E X
Target device
Head data
10H 02H
S
T
X
A
;
0 1 2 3
S
T
X
A B C
C L
R F
(1234H)
02H 41H 3BH30H 31H 32H 33H 02H 41H 42H 43H 34H 12H 0DH0AH
Receive data count
Word units
Number of received byte excluding frame and additional code (12)/2=6
Byte units
Number of received byte excluding frame and additional code (12)
The following diagram is for word unit
CPU module
Reception data read request
CPU module
X3
Completion device
M0
Status display device at completion
M1
First frame (corresponds to registration No. 3E9H)
Ò
Arbitrary data
(Received data count)
INPUT
ON
ON
1 scan
Abnormal completion
Normal completion
Un\G8224
Un\G8225
0H
0H
User frame receiving format designation
(1st = format-0)
(2nd = format-0)
Un\G8226
Un\G8227
1H
1H
0H Un\G8228
Un\G8229 0H
0H Un\G8230
Un\G8231 2H
Buffer memory
(3rd = format-1)
(4th = format-1)
Received data count for format 1 only
(1st)
(2nd)
(3rd)
(4th)
Un\G164
Un\G173
Un\G174
6H
2H
3E8H
Received data count
User frame use enable/ disable designation
First frame No. designation
(1st)
Un\G175 3E9H
(2nd)
Un\G176 6H
(3rd)
Un\G177
Un\G178
15H
41BH
(4th)
Last frame No. designation
(1st)
Un\G179
Un\G180
Un\G181
Un\G288
Un\G289
(None)
0H
(None)
0H
(None)
0H
(YES) (NO)
1002H/ 0H
(Disable)
0H
Un\G603
2H
Un\G1536
Un\G1537
Un\G1538
Un\G1539
00H , 06H
(1) (0)
31H , 30H
(3) (2)
33H , 32H
(A) (STX)
41H , 02H
Un\G1540
Un\G1541
(C) (B)
43H , 42H
(1234H)
12H , 34H
Un\G1542
(LF) (CR)
0AH , 0DH
Buffer memory
(2nd)
(3rd)
(4th)
Receive transparent code designation
ASCII-BIN conversion designation
Receive user frame ( th)
Ó to D0
Ô to D3 Receive data count
Received data
(arbitrary data)
Õ to D10 or after
338
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
■
When receiving with user frame only (reception using Method 0)
Target device
CPU module
Head data
S
T
X
Q
First frame
(Correspond to register No. 3E8H and 41BH)
Ò
(For reception using the combination of first frame and last frame)
;
E
T
X
02H51H 20H 0AH 3BH 03H 03H
Last frame
Since there is no arbitrary data portion, the receive data count is [0].
The following diagram is for reception using the combination of first frame and last frame.
Un\G173 2H
User frame use enable/disable designation
Un\G174
3E8H
First frame No. designation
(1st)
Un\G175
3E9H (2nd)
Un\G176 6H (3rd)
Reception data read request
CPU module
X3
INPUT
Un\G177 15H (4th)
Last frame No. designation
(1st)
Completion device M0
Status display device at completion
M1
ON
ON
1 scan
Abnormal completion
Normal completion
Un\G178
41BH
Un\G179
Un\G180
Un\G181
Un\G288
Un\G289
(None)
0H
(None)
0H
(None)
0H
(YES) (NO)
1002H/ 0H
(Disable)
0H
Un\G603 1H
Un\G1536
Un\G8224
Un\G8225
00H , 00H
0H
0H
(2nd)
(3rd)
(4th)
Receive transparent code designation
ASCII-BIN conversion designation
Receive user
Ó frame ( th)
Receive data count
Ô
User frame receive format designation
(1st = format-0) to D0 to D3
(2nd = format-0)
Un\G8226 1H
(3rd = format-1)
Un\G8227 1H
Un\G8228
Un\G8229
0H
0H
(4th = format-1)
Received data count for format 1 only
(1st)
(2nd)
Un\G8230 0H
(3rd)
Un\G8231 2H
Buffer memory
(4th)
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
339
■
When receiving with first start only (reception using Method 1)
Head data
A
C
K
Target device
CPU module
Reception data read request
CPU module
X3
Completion device
M0
Status display device at completion
M1
06H
First frame
(Corresponds to registration No.6H)
Ò
INPUT
ON
ON
1 scan
Abnormal completion
Normal completion
Since the received data count for format 1 is designated to
"0", the receive data count is "0".
The following diagram is for byte unit.
Un\G173
Un\G174
Un\G175
2H
3E8H
3E9H
User frame use enable/ disable designation
First frame No. designation
(1st)
(2nd)
(3rd) Un\G176 6H
Un\G177 15H
Un\G178
41BH
Un\G179
Un\G180
Un\G181
Un\G288
(None)
0H
(None)
0H
(None)
0H
(YES) (NO)
1002H/ 0H
Un\G289
(Disable)
0H
Un\G603
3H
Un\G1536
Un\G8224
00H , 00H
0H
Un\G8225
Un\G8226
0H
1H
(4th)
Last frame No. designation
(1st)
(2nd)
(3rd)
(4th)
Receive transparent code designation
ASCII-BIN conversion designation
Receive user
Ó frame ( th)
Receive data
Ô count
User frame receiving format designation
(1st = format-0) to D0 to D3
(2nd = format-0)
(3rd = format-1)
Un\G8227
Un\G8228
1H
0H
Un\G8229
0H
Un\G8230
0H
Un\G8231
2H
Buffer memory
(4th = format-1)
Received data count for format 1 only
(1st)
(2nd)
(3rd)
(4th)
340
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
■
When receiving with a combination of the start frame and arbitrary data (method 1 dedicated receive end data quantity) (reception using Method 1)
Head data
N
A
K
Receive data count
Word units
Number of receive byte excluding frame and additional code (2)/2=1
Byte units
Number of received bytes excluding frame and additional code (2)
Target device
(0022)
15H 22H 00H
The following diagram is for byte unit.
CPU module
Reception data read request
CPU module
Completion device
Status display device at completion
Arbitrary data
First frame
(Corresponds to registration No. 15H)
Ò
X3
M0
M1
INPUT
ON
ON
1 Scan
Abnormal completion
Normal completion
Un\G173
Un\G174
User frame use enable/ disable designation
First frame No. designation
(1st)
Un\G175
Un\G8228
3E9H
Un\G176
Un\G1537
Un\G8224
6H
(0022H)
00H, 22H
0H
(3rd)
Un\G177
Un\G178
Un\G179
Un\G180
Un\G181
Un\G288
Un\G289
Un\G603
Un\G1536
15H
41BH
(4th)
Last frame No. designation
(1st)
(None)
0H
(None)
0H
(2nd)
(3rd)
(None)
0H (4th)
(YES) (NO) Receive transparent
1002H/ 0H code designation
(Disable)
0H
4H
00H , 02H
ASCII-BIN conversion designation
Receive user
Ó frame( th)
Ô
Receive data count to D0 to D3
Receive data
(arbitrary data portion)
User frame receiving format designation
(1st = format-0)
Õ to D10
Un\G8225 0H
(2nd = format-0)
Un\G8226 1H
(3rd = format-1)
Un\G8227 1H
(2nd)
0H
(4th = format-1)
Received data count for format 1 only
(1st)
Un\G8229 0H
(2nd
Un\G8230
2H
3E8H
0H
(3rd)
Un\G8231 2H
(4th)
Buffer memory
17
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
341
Application program for data reception using a combination that does not specify the start frame
The following shows the program example when receiving data using a combination that does not specify the start frame.
Reception program example
Data reception using a user frame set with the following conditions is shown below.
■
C24 interface used for communication with target device
CH1 side RS-232 interface of C24
■
Parameter settings
For other than the following items, use default values.
Item Setting content
Word/byte
Designated
Buffer memory address to store registration value
150 (96H)
288 (120H)
Word/byte units designation
Transparent code for receiving specification
ASCII-BIN conversion designation
Receive end data quantity
Receive end code
User frame use enable/disable designation
Final frame No. designation
User frame receiving method designation
Method 1 dedicated receive end data quantity designation
Do not convert
6
No designation
Use
No designation
Designated
Method 0
0H
289 (121H)
164 (A4H)
165 (A5H)
173 (ADH)
174 to 177 (AEH to B1H)
178 to 181 (B2H to B5H)
8224 to 8227 (2020H to
2023H)
8228 to 8231 (2024H to
2027H
Remarks
The unit is set to "Word" in the example.
Specify as follows: Additional code: 10H (DLE),Transparent code: 02H (STX)
*1 It indicates the registered contents of the user frame No. specified to the start and final frame No., respectively.
■
Registration contents in user frame
Item
Start frame No.
Final frame No.
1st
2nd
3rd
4th
1st
2nd
3rd
4th
User frame No.
0H (none)
0H (none)
0H (none)
0H (none)
419H
0H (none)
0H (none)
0H (none)
Registered code
3BH, 04H
Registered data content
;, E0T
342
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
■
Program example
The following shows the example of data reception with a user frame.
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.uResult_ReceiveUserFrame_D
Label to be defined Define the global label as shown below.
Description
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
CH1_Receive user frame (nth)
Device
X3
X4
U0\G603
17
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(14)
(60)
(62)
Read the combinations of user frames received.
Set the reception channel to CH1.
Set the allowable number of data to be received to 6.
Specify the execution instruction.
Execute reception
Set normal completion flag.
Set abnormal completion flag.
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
343
Operation example
■
When receiving data using a combination of arbitrary data and final frame (reception using
Method 0)
Additional code (C24 deletes)
Transparent code
When STX is handled as transparent code.
D
L
E
S
T
X
Target device
CPU module
Reception data read request
CPU module
Head data
X3
Completion device M0
Status display device at completion
M1
10H 02H
0 1 2 3
S
T
X
A B C
(1234H)
C L
R F
30H 31H 32H 33H 02H 41H 42H 43H 34H 12H 0DH 0AH 3BH 04H
E
O
T
Arbitrary data portion
Last frame
(Corresponds to registration No. 419H)
Ò
INPUT
ON
ON
1 scan
Abnormal completion
Normal completion
Un\G8224 0H
0H
User frame receiving format designation
(1st = format-0)
(2nd = format-0)
Un\G8225
Un\G8226 0H
(3rd = format-0)
Un\G8227
0H
0H Un\G8228
Un\G8229 0H
0H Un\G8230
Un\G8231 0H
Buffer memory
(4th = format-0)
Received data count for format 1 only
(1st)
(2nd)
(3rd)
(4th)
Receive data count
Word units
Number of received byte excluding frame and additional code (12)/2=6
Byte units
Number of received byte excluding frame and additional code (12)
The following diagram is for word unit
Un\G173 2H
User frame use enable/ disable designation
Un\G174
Un\G175
Un\G176
(None)
0H
(None)
0H
(None)
0H
(None)
0H
First frame No. designation
(1st)
(2nd)
(3rd)
Un\G177
Un\G178 419H
(4th)
Last frame No. designation
(1st)
Un\G179
Un\G180
Un\G181
Un\G288
Un\G289
Un\G603
(None)
0H
(None)
0H
(None)
0H
(None)
1002H
(Disable)
0H
1H
Un\G1536
Un\G1537
Un\G1538
Un\G1539
Un\G1540
Un\G1541
Un\G1542
00H , 06H
(1) (0)
31H , 30H
(3) (2)
33H , 32H
(A) (STX)
41H , 02H
(C) (B)
43H , 42H
(1234H)
12H , 34H
(LF) (CR)
0AH , 0DH
Buffer memory
(2nd)
(3rd)
(4th)
Receive transparent code designation
ASCII-BIN conversion designation
Receive user
Ó frame ( th)
Receive data count
Ô to D0 to D3
Receive data
(arbitrary data portion)
Õ to D10 or after
344
17 DATA COMMUNICATIONS USING USER FRAMES
17.3 Program for Data Reception with User Frame
17.4
Data Transmission
This section explains the arrangement of the data to be transmitted and transmission procedure when transmitting data using a user frame.
Send data
The order of data, codes, and handling of send data by C24 for data transmission using a user frame are shown below.
Send data arrangement
The combination shown below are only allowed as the order of data to be transmitted using a user frame.
17
User frame
(first n frames)
Arbitrary data
(Send data designation area data)
User frame
(last m frames)
Combination
Data name
(1)
(2)
(3)
(4)
User frame
(first n frames)
Arbitrary data
*2
User frame
(last m frames)
Remarks
Total 99 frames
Total 100 frames
: Specified data exists.
(When ASCII-BIN conversion disabled)
Codes that can be designated Codes when transmitting
00H to FFH
00H to FFH
Remarks
Added by the C24.
Transmission area data.
*1
(When ASCII-BIN conversion enabled)
Codes that can be designated Codes when transmitting
0H to 9H,
AH to FH
30H to 39H,
41H to 46H
Remarks
Added by the C24.
The codes shown at the left are 4-bit codes.
0H to 9H,
AH to FH
30H to 39H,
41H to 46H
Transmission area data.
The codes shown at the left at are 4-bit codes.
*1 0H to FH data for four bits are converted to 30H to 39H and 41H to 46H ASCII code data and transmitted as the data codes of the data to be transmitted (including the transparent code data).
*2 Arbitrary data portion of send data
When the send data quantity designated by the CPU module during transmission in byte units is an odd number of bytes, the data of the lower byte of the last transmitted data storage location in the send data storage area is transmitted.
When ASCII-BIN conversion is enabled, the data to be transmitted is transmitted as 2 characters per byte.
Handling of send data by C24
• The data of the user frame and the data in the send area designated from the CPU module is transmitted in accordance with the contents and order designated to the send user frame designation area in the buffer memory.
• For the user frame portion and arbitrary data portion, the data can be transmitted as ASCII code data using the ASCII-BIN conversion. (
Page 379 COMMUNICATING WITH ASCII CODE (ASCII-BIN
• If a transparent code for sending is specified, the additional code data is added in front of the transparent code/additional code in the data of the designated area and transmitted.
17 DATA COMMUNICATIONS USING USER FRAMES
17.4 Data Transmission
345
Transmission procedure
The following describes the transmission procedure when a message containing user frames is transmitted to the target device.
Procedure
Target device
CPU module(*1)
User frame
(1st)
User frame
(nth)
Arbitrary data
Transmission area data
User frame
(mth)
User frame
( ± th)
(*2)
TO
CPU module PRR
ON
Completion device
Status display device at completion
(*3)
ON
Abnormal completion
Normal completion
1 scan
*1 Designate the user frame number for the data to be sent.
*2 CPU module processing
Before issuing a transmission request to C24, designate (write) the following data.
Send user frame designation area : User frame number, transmission method and transmission order registered in C24
Send area (Buffer memory): User data corresponding to arbitrary data portion in the transmission message
*3 When a send data quantity designation error or data transmission error occurred, C24 stores the error code to the transmission result storage area of control data for PRR instruction, and the status display device at completion turns ON.
346
17 DATA COMMUNICATIONS USING USER FRAMES
17.4 Data Transmission
Settings of send user frames
These settings are required for transmitting data to a target device using user frames by the nonprocedural protocol.
These settings are configured with Engineering tool or from the CPU module.
Settings with Engineering tool
• Configure the settings to transmit data in "Send user frame designation" of the parameter.
Navigation window [Parameter] [Module Information] Module Name [Module Parameter] "Application
Settings" "User frame specification"
Settings by the CPU module
■
How to designate and write send data when transmitting with user frames
For arbitrary data portion when transmitting user frames and arbitrary data portion in combination, the send data quantity and send data are written in the send area as is the case in transmitting them in an arbitrary format.
User frames are registered using Engineering tool. Or, the user frame registration number to be sent is written from the CPU module to the send user frame designation area of the buffer memory as shown in the figure below.
After executing registration/write, C24 transmits the designated data in the designated order upon execution of the PRR instruction.
Ex.
Sending data in the following order
Transmission order Send data type
1
2
3
4
User frame
User frame
Arbitrary data
User frame
User frame No.
2H (2)
3E8H (1000)
8000H (-32768)
400H (1024)
Contents of transmitted/registered data
02H (STX)
01H, 3BH (station No., ";")
41H, 42H, 43H, 44H ("ABCD")
03H, FFH, F6H, 0DH, 0AH (ETX, Sum check, CR, LF)
17
To the target device
Address Buffer memory
Un\G182 0 or the following frame designation No.
Un\G183
Un\G184
0
1
Un\G185
Un\G186
4
2H (1st)
Un\G187 3E8H (2nd)
Un\G188
Un\G189
8000H (3rd)*1
400H (4th)
Un\G190
Un\G191
0H (5th)
0H (6th)
(Transmission user frame designation area)
User frame being transmitted designation No. area
CR/LF output designation area
Output head pointer designation area
Output count designation area
Transmission frame number designation area
Un\G1024
Un\G1025
Un\G1026
(When the ASCII-BIN conversion is not performed)
User frame Arbitrary data User frame
(1st) (2nd)
S
T
X
(;) A B C D
E
T
X
(4th)
C
R
L
F
2 or 4
42H(B) , 41H(A)
44H(D) , 43H(C)
Figure at left is for byte units.
(Transmission area)
Transmission data count (word unit/byte unit)
Transmitted data
For word units, the arbitrary data portion is sent in the sequence of "ABCD".
02
H
01
H
3B
H
41
H
42
H
43
H
44
H
03
H
4B
H
0D
H
0A
H
2H 3E8H 8000H
Corresponding frame No.
400H
17 DATA COMMUNICATIONS USING USER FRAMES
17.4 Data Transmission
347
■
Send user frame designation
The following explains the purpose of the buffer memory to be used when transmitting data using user frames, along with the designated and stored values.
• 'Sending user frame' (Un\G182/342)
In data communications using a user frame, what number of the send frame number designation area is being sent is stored.
Buffer memory address
Un\G182
Un\G342 b15 to
0H to 64H
0H to 64H b0
(CH1 side)
(CH2 side)
0H( 0): Not sent
1H to 64H( 1 to 100): User frame being transmitted designation No. (nth number)
• 'CR/LF output designation' (Un\G183/343)
When transmitting a user frame or arbitrary data that does not contain CR/LF, designate whether or not a CR+LF will be sent each time a user frame or arbitrary data is sent.
Buffer memory address
Un\G183
Un\G343 b15 to
0 to 1
0 to 1 b0
(CH1 side)
(CH2 side)
0 : Do not send
1 : Send
• 'Output start pointer designation' (Un\G184/344)
Write the head position ( th) in the send frame number designation area for writing the registration number of the user frame to be sent.
However, transmission using a user frame is not performed when the value of the output start pointer designation area is
"0".
Buffer memory address
Un\G184
Un\G344 b15 to
0 to 100
0 to 100 b0
(CH1 side)
(CH2 side)
Buffer memory address
Un\G185
Un\G345 b15 to
0 to 100
0 to 100
0 : No designation
1 : Send from the first
100 : Send from the 100th
• 'Output quantity designation' (Un\G185/345)
Write how many user frames are transmitted from the designated position in the output start pointer designation area.
However, transmission is not performed and completed normally when the value of the output quantity designation area is
"0".
b0
(CH1 side)
(CH2 side)
0 : No designation
1 : Transmit 1 frame
100 : Transmit 100 frames
348
17 DATA COMMUNICATIONS USING USER FRAMES
17.4 Data Transmission
•
'Send frame number designation' (Un\G186 to 285/346 to 445) Write the user frame No. to be sent in the order in which they are output from the position designated in the output start pointer designation area.
When transmitting data that is written in the send area, use 8000H as a temporary user frame No.
By designating user frame No. 8000H, C24 transmits the data in the send data specification area for the data quantity designated in the send data quantity designation area.
Buffer memory address Un\G186 to
Un\G285
User frame No.(1st) to
User frame No.(100th)
(CH1 side)
Un\G346 to
Un\G445
User frame No.(1st) to
User frame No.(100th)
(CH2 side)
Specifies the following user frame No. for the data to be sent.
Note that the number on the right side of the user frame No. below is the number used for transmission without ASCII-BIN conversion for only the data of any frame portion when transmission data is converted into ASCII-binary data and transmitted.
0H: No transmission designation. (No additional transmission is allowed.)
1H to 3E7H/4001H to 43E7H: Transmits the default frame having the designated number.
3E8H to 4AFH/43E8H to 44AFH: Transmits the user frame having the designated number. (For flash ROM registration)
8000H/C000H: Transmits data in the transmission area of the buffer memory.
8001H to 801FH/C001H to C01FH: Transmits the user frame having the designated number. (For buffer memory registration)
17
The following transmission can be performed by adding 4000H to the registered user frame number and specifying it.
• When ASCII-BIN conversion is enabled, a specified frame can be sent without the conversion. (
380 ASCII-BIN Conversion for Data Communicated with Nonprocedural Protocol)
• A specified frame can be transmitted without adding the additional code by the transparent code for sending specification. (
Page 360 Handling Transparent and Additional Codes for Nonprocedural Protocol Data
17 DATA COMMUNICATIONS USING USER FRAMES
17.4 Data Transmission
349
17.5
Application Program for Data Transmission using a Combination that does not Specify the Start
Frame
The following shows the program examples for data transmission using a user frame.
Transmission program example
Data transmission using user frames in the following conditions and settings is shown below:
■
C24 interface used for communication with a target device
CH1 RS-232 interface of C24
■
Parameter settings
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
■
Buffer memory setting contents
For other than the following items, use default values.
Item Setting content Buffer memory address to store registration value
Byte
No designation
150 (96H)
287 (11FH)
Word/byte units designation
Transparent code for sending specification
ASCII-BIN conversion designation
Send frame number designation (1st)
Send frame number designation (2nd)
Send frame number designation (3rd)
Send frame number designation (4th)
Send frame number designation (5th)
Do not convert
3F2H
3F3H
8001H
8000H
41BH
289 (121H)
186 (BAH)
187 (BBH)
188 (BCH)
189(BDH)
190(BEH)
Remarks
Setting value
Nonprocedural protocol
19200 bps
8
None
Odd
1
None
Disable
Disable
1
350
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
Program example when setting using Engineering tool
The following shows the method to send data by specifying the send frame number with Engineering tool.
■
Program example
Category Label name/FB name
Module label C24_1
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.uSet_TransmissionDataCount_D
C24_1.wnForUserRegistrationNo8001H_D[0]
C24_1.wnForUserRegistrationNo8001H_D[1]
Label to be defined Define the global label as shown below.
Description
Target module
Module READY
Watchdog timer error
CH1_Send data quantity designation
For user registration number 8001H [0]
For user registration number 8001H [1]
Device
X1E
X1F
U0\G1024
U0\G6912
U0\G6913
17
FB M+RJ71C24_SendUserFrame Sends data using the nonprocedural protocol communication and the user frame according to the setting of the user frame specification area for sending data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
351
352
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
(3)
(86)
(88)
Set the transmission channel to 1.
Set CR/LF to "Do not send".
Set the send pointer to 1.
Set the output quantity to 5.
Set an arbitrary send data quantity.
Set an arbitrary send data.
Set an arbitrary send data in send area.
Set the transmission direction.
Set normal completion flag.
Set abnormal completion flag.
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
353
17
Target device
CPU module
Register No. of corresponding user frame
Transmission command
CPU module
Completion device
Status display device at completion
S
T
X
Q ; T O T A L ; (Total number)
Data in transmission area
(arbitrary data portion)
E
T
X
02H 51H 0AH 01H 3BH 54H 4FH 54H 41H 4CH 3BH
(012DH)
2DH 01H
(1234H)
34H 12H
(56ABH)
ABH 56H 03H 37H
* Four bytes of data in the transmission area are transmitted as is.
(Byte units in the left diagram.)
3F2H
(for first designated frame)
3F3H
(for second designated frame)
8001H
(for third designated frame)
8000H
(for fourth designated frame)
41BH
(for third designated frame)
PRR
ON
ON Abnormal completion
Un\G182
Un\G183
Un\G184
(Not sent)(Sending)
0H/Other than 0H
(Do not send)
0H
(1st)
1H
Un\G185
5H
User frame No. being transmitted
CR/LF output designation
Output head pointer designation
Output count designation
Un\G186
3F2H
Transmission frame no. designation
(1st)
Un\G187
3F3H
(2nd)
Normal completion Un\G188
8001H
(3rd)
1 scan
Un\G189
8000H
(4th)
Un\G190
41BH
(5th)
Un\G191
0H
(6th)
Un\G192
3F4H
(7th)
Un\G193
8002H
(8th)
Un\G194
3F5H
(9th)
Un\G287
Un\G289
(YES) (NO)
1002H/ 0DH
(No conversion)
0H
00H , 04H
Transmit transparent code designation
ASCII-BIN conversion designation
*1 Un\G1024
Un\G1025
Un\G1026
(1234H)
12H , 34H
(56ABH)
56H , ABH
Buffer memory
Transmission area
(transmission data count designation)
(transmission data)
*1 0002H for word unit
Un\G195
8003H
Un\G196
3F6H
Un\G197
8004H
Un\G198
41BH
Un\G199
0H
Buffer memory
(10th)
(11th)
(12th)
(13th)
(14th)
354
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
Program example when not setting with Engineering tool
The following shows the methods to transmit data without specifying the send frame number with Engineering tool.
■
Program example
Category Label name/FB name
Module label C24_1
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.wnSet_OutputFrameNum_UserFrame_D
C24_1.stnCH1.uSet_TransmissionDataCount_D
C24_1.wnForUserRegistrationNo8001H_D[0]
C24_1.wnForUserRegistrationNo8001H_D[1]
Label to be defined Define the global label as shown below.
Description
Target module
Module READY
Watchdog timer error
CH1_Send user frame_Send frame number designation
CH1_Send data quantity designation
For user registration number 8001H [0]
For user registration number 8001H [1]
Device
X1E
X1F
U0\G186
U0\G1024
U0\G6912
U0\G6913
17
FB M+RJ71C24_SendUserFrame Sends data using the nonprocedural protocol communication and the user frame according to the setting of the user frame specification area for sending data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
355
356
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
(3) Set CR/LF to "Do not send".
Set the send pointer to 1.
Set the output quantity to 5.
Set an arbitrary send data.
Set an arbitrary send data in send area.
Set the send user frame.
(101) Set normal completion flag.
(103) Set abnormal completion flag.
Normal end
D6
D7
D8
D9
D0 Transmission data count
D1
Transmission data
D2
D5 Transmission frame No.
D10
D11
D12
D13
Interface No.
Transmission result
D14
D15
CR/LF output
Output head pointer
Output counter
(0004H)
(3412H)
(AB56H)
(03F2H)
(03F3H)
(8001H)
(8000H)
(041BH)
(0000H)
(0001H)
(0000H)
(0000H)
(0001H)
(0005H)
Abnormal end
Transmission data count
Transmission data
Transmission frame No.
(0004H)
(3412H)
(AB56H)
(03F2H)
(03F3H)
(8001H)
(8000H)
(041BH)
Interface No.
(0000H)
(0001H)
Transmission result (other than 0000H)
CR/LF output
Output head pointer
Output counter
(0000H)
(0001H)
(0005H)
17 DATA COMMUNICATIONS USING USER FRAMES
17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
357
17
18
TRANSPARENT CODES AND ADDITIONAL
CODES
Transparent codes and additional codes are used during data communication with a target device to send/receive one-byte data for transmission control on the target device side as arbitrary data.
Transparent codes and additional codes are handled in data communication using the nonprocedural or bidirectional protocol.
Type
Transparent code
Additional code
Description
One-byte data for transmission control
During transmission, one-byte data added immediately before the transparent code and additional code data
During reception, one-byte data to be deleted (The immediately following one-byte data is processed for reception.)
18.1
Handling Transparent Code and Additional Code
Data
The following explains how C24 handles transparent codes and additional codes during data communication using the nonprocedural or bidirectional protocol.
For the range of additional code data that is added or deleted, refer to the following sections.
Page 360 Handling Transparent and Additional Codes for Nonprocedural Protocol Data Communication
Page 371 Handling Transparent and Additional Codes for Bidirectional Protocol Data Communication
At the time of data transmission
Additional code data is added immediately before the transparent code and additional code data set for transmission.
Ex.
Buffer memory
Transparent code
Transparent code
Additional code
Send
At the time of data reception
When additional code data set for reception is detected, the additional code data is removed and the immediately succeeding
1-byte data is processed for reception.
Ex.
Buffer memory
Arbitrary code
Additional code
Arbitrary code
Receive
358
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.1 Handling Transparent Code and Additional Code Data
During data communication using the ASCII-BIN conversion
When transmitting data, the transparent code check is performed to the data after ASCII-BIN conversion. If a transparent code is detected, an additional code is added to the 1-byte immediately preceding it.
When receiving data, the additional code check is performed to the data before ASCII-BIN conversion. If an additional code is detected, the additional code are deleted.
Data which will be subject for the handling of a transparent code and an additional code is data after ASCII-BIN conversion for data transmission and data before ASCII-BIN conversion for data reception.
Ex.
When transmitting/receiving data using an arbitrary format of the nonprocedural protocol
Target device
Head data
Arbitrary data
1 2 0 2 3
31 H 32 H 30 H 32 H 33 H
D
L
E A B C
10 H 41 H 42 H 43 H
Send
Buffer memory (transmission area/reception area)
(H) (L)
(0002H)
00H , 02H
(0212H)
02H , 12H
(BC3AH)
BCH , 3AH
Transmission data count/Receive data count
Transmission data/ receive data
Receive
(The data count is in word units)
Transparent code
(For 41H)
Additional code
(For 10H)
18.2
Registering Transparent Codes and Additional
Codes
To control transparent codes and additional codes for data to be sent/received with the nonprocedural or bidirectional protocol, configuring the settings to C24 prior to data communication is required.
Registration method
For each interface, 10 combinations and one combination of transparent codes and additional codes can be set for transmission and reception, respectively.
Transparent codes and additional codes are set in "Transparent code designation_Transparent code for sending specification
(nth)", and "Transparent code designation_Transparent code for receiving specification" of the parameter.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
When specifying a transparent code for sending, set it by left justifying from the transparent code for sending specification
(1st) in order.
Precautions
If additional code data is received during data reception, C24 will not treat the immediately succeeding one-byte data as the control data for the following frame:
• Data received as the start frame and final frame of the user frames
Therefore, do not configure the following settings. (The code for the data described above cannot be designated as additional codes for data reception.)
• A receive user frame setting that contains an additional code data for data reception
• The same receive same code setting as the additional code data for data reception
18
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.2 Registering Transparent Codes and Additional Codes
359
18.3
Handling Transparent and Additional Codes for
Nonprocedural Protocol Data Communication
This section explains how to handle the transparent codes and additional codes during data communication using the nonprocedural protocol.
Adding/deleting data
The data designated by the additional code is added to/deleted from the data to be transmitted or received.
Transmitted/received data range for processing
The range of transmitted/received data to which the processing of transparent codes and additional codes is performed is as shown below.
Applicable range during transmission Applicable range during transmission
Message during communication using arbitrary format
Arbitrary data
Message during communication using user frames
User frame
(first frame)
Arbitrary data
User frame
(last frame)
Applicable range during reception
C24 performs the following processing during data transmission and reception.
Applicable range during reception
■
At the time of data reception
When an additional code set for reception is detected, C24 removes the additional code data and perform data reception processing by treating the immediately succeeding 1-byte data as a part of the received data.
■
At the time of data transmission
When transparent code/additional code data set for transmission is detected, C24 transmits data by adding the additional code designation data immediately before it.
During data transmission using user frames, even if a transparent code or additional code has been specified in the transparent code for sending specification area, it is possible to transmit data without adding the additional code data to the user frame portion or arbitrary data portion.
When sending data without adding the additional code specified by the transparent code for sending specification, specify the user frame number using the following method.
• Specify the number obtained by adding 4000H to the registered user frame No.
b15 b14 b13 to b0
Frame No.
0: Conversion enable 1: Conversion disable
0: Frame registered in flash ROM 1: Frame registered in the buffer memory
When sending data in the portions designated in 4001H to 44AFH, C000H to C01FH, the data is transmitted without conversion even when the following designations are enabled.
• Designating "Enable" in the ASCII-BIN conversion designation area. (
Page 380 ASCII-BIN Conversion for Data
Communicated with Nonprocedural Protocol)
• Designating "Auto delete enabled" in the NULL character automatic removal designation area. (
Character Removal to Send Data using Nonprocedural Protocol)
User frame No. to be sent
1H to 3E7H (1 to 999)
3E8H to 4AFH (1000 to 1199)
8000H to 801FH (-32768 to -32737)
Specified No. when transmitting data without adding the additional code specified by the transparent code for sending specification (4000H added)
4001H to 43E7H (16385 to 17383)
43E8H to 44AFH (17384 to 17583)
C000H to C01FH (-16384 to -16353)
360
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.3 Handling Transparent and Additional Codes for Nonprocedural Protocol Data Communication
Processing order for transmitting/receiving data
The processing steps taken by C24 to transmit/receive data by the transparent code designation and ASCII-BIN conversion enabled are as shown below.
■
Data reception in arbitrary format
• C24 deletes (removes) the additional code designation data when a transparent code for receiving is specified.
• C24 stores the arbitrary data portion in the receive area on the buffer memory.
When ASCII-BIN conversion is designated, C24 converts it to binary code data and stores in the buffer memory.
• C24 issues a reception data read request to the CPU module when the receive end code data is stored or data equivalent to the receive end data quantity is stored during reception of an arbitrary data portion.
■
Data transmission in arbitrary format
• C24 transmits the data to be sent (arbitrary data portion of a transmission message), which is designated by the CPU module.
When ASCII-BIN conversion is designated, C24 converts it to ASCII code data and transmits it.
• C24 adds the additional code data immediately before the transparent code/additional code data, and transmits it when a transparent code for sending is specified.
• C24 notifies the CPU module of the transmission normal (abnormal) completion once transmission for the send data quantity has been completed.
Target device C24
Data transmission
(Transparent code designation) (ASCII-BIN conversion designation)
No No
Adding additional code
Yes
ASCII-BIN conversion of transmission data
Yes
Buffer memory
Transmission area data
18
Data reception
No
Yes
Delete additional code
No
Yes
ASCII-BIN conversion of arbitrary data section
Ex.
When ASCII-BIN conversion is not performed
Target device (Communicating in an arbitrary format)
Head data
Arbitrary data
D
L
E
12 H 10 H 02 H 3A H BC H
(For 02H)
(For 10H)
Transparent code
Additional code
Send
Receive
Check receive complete code and received data count
Data to be stored in the reception area
C24
Buffer memory (transmission area/reception area)
(H) (L)
(0002H)
00H , 02H
(0212H)
02H , 12H
(BC3AH)
BCH , 3AH
Transmission data count/Receive data count
Transmission data/ receive data
(The data count is in word units)
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.3 Handling Transparent and Additional Codes for Nonprocedural Protocol Data Communication
361
Ex.
When ASCII-BIN conversion is performed
Target device (Communicating in an arbitrary format) C24
Head data Buffer memory (transmission area/reception area)
Arbitrary data
1 2 0 2 3
D
L
E A B C
31 H 32 H 30 H 32 H 33 H 10 H 41 H 42 H 43 H
Send
(H) (L)
(0002H)
00H , 02H
(0212H)
02H , 12H
(BC3AH)
BCH , 3AH
Transmission data count/Receive data count
Transmission data/ receive data
Receive
(The data count is in word units)
Transparent code
(For 41H)
Additional code
(For 10H)
■
Data reception using user frames
• C24 checks the reception of the user frame (start frame and final frame).
• C24 deletes (removes) the additional code designation data from an arbitrary data portion when a transparent code for receiving is specified.
• C24 calculates the sum check code when a sum check code is designated in a user frame (final frame).
• C24 stores the arbitrary data portion in the receive area on the buffer memory.
When ASCII-BIN conversion is designated, C24 converts it to binary code data and stores in the buffer memory.
• C24 issues a reception data read request to the CPU module when the receive end code/data equivalent to the receive end data quantity is stored during reception of an arbitrary data portion, or when a user frame (final frame) is received.
■
Transmitting data using user frames
• C24 transmits data to be sent (an arbitrary data portion of a transmission message), which is designated by the user frame or CPU module, in the order specified by the user.
• When ASCII-BIN conversion is designated, C24 converts the data in the applicable range to ASCII code data and transmits it.
In addition, it adds the additional code data immediately before the transparent code/additional code data when transmitting the data in the applicable range, and transmits it when a transparent code for sending is specified.
• C24 notifies the CPU module of the transmission normal (abnormal) completion once transmission for the send data quantity has been completed.
Target device C24
Data transmission
(Transparent code designation)
Adding additional code
No
Yes
(Sum check code designation)
Calculating sum check code using user frames
No
Yes
(ASCII-BIN conversion designation)
No
ASCII-BIN conversion of transmission data
Yes
Buffer memory
Data designated in the transmission frame No.
designation area
For Output count designation
No No No
Data reception
Check and delete user frames
Yes
Delete additional code
Yes
Calculate and check sum check code using user frames
Yes
ASCII-BIN conversion of arbitrary data section
Check reception complete code and received data count
Data stored in the reception area
(Arbitrary data section only)
The figure above shows how C24 processes the data to be sent/received when the data sending/receiving function using user frame, the ASCII-BIN conversion function, and/or the data send/receive function by transparent code designation are enabled and disabled.
Use this information as a reference to select the method to send/receive data for data communication with a target device.
362
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.3 Handling Transparent and Additional Codes for Nonprocedural Protocol Data Communication
18.4
Data Communication Using Nonprocedural
Protocol
This section shows examples of data communication using the nonprocedural protocol when the settings/registrations are made with Engineering tool.
Parameter settings
For details for each setting item, refer to "Parameter". (
Setting item
Basic settings
Various control specification
Test mode setting
Communication speed setting
Communication protocol setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Transparent code designation
Transparent code for sending specification
(1st)
Transparent code for sending specification
(2nd)
Transparent code
Additional code
Transparent code
Additional code
Transparent code for receiving
Transparent code
Additional code
Receiving end specification Receive end data quantity designation
Receive end code designation
Setting content
CH1
19200 bps
Nonprocedural protocol
Set according to the target device
Enable
Enable
02H (STX)
10H (DLE)
03H (ETX)
10H (DLE)
02H (STX)
10H (DLE)
6
0D0A
CH2
CH2 is not used
18
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
363
Example of data reception
Program example
The following shows an example of storing received data in the data register.
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
Label to be defined Define the global label as shown below.
Description
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
Device
X3
X4
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(55)
(57)
Set the reception channel to the CH1 side.
Set the allowable number of data to be received.
Set the reception direction.
Normal completion
Abnormal completion
364
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
Reception example based on the receive end data quantity
When C24 receives data from the target device when the transparent code designation is enabled
Ex.
Transparent code designation: Additional code: 10H (DLE), Transparent code: 02H (STX), Receive end data quantity designation: 6-word or 12-word
Head data
Additional code (C24 deletes)
Transparent code
Target device
0 1 2 3
D
L
E
S
T
X L
L
N
U A B
(1234H)
C D
30H31H 32H 33H 10H 02H 00H 41H 42H 34H 12H 43H 44H
For word unit:
Number of received byte excluding additional code (12)/2=6
For byte unit:
Number of received byte excluding additional code (12)
C24
Reception data read request
X3
CPU module INPUT
ON
Receive data count is stored
The following diagram is for word unit
Completion device
M0
ON
Abnormal completion
Status display device at completion
M1
1 scan
Normal completion
Un\G1536 00H , 06H
Un\G1537
Un\G1538
(1) (0)
31H , 30H
(3) (2)
33H , 32H
Un\G1539
Un\G1540
(NULL) (STX)
00H , 02H
(B) (A)
42H , 41H
Un\G1541
Un\G1542
(1234H)
12H , 34H
(D) (C)
44H , 43H
Buffer memory
D2 00H , 06H
D10
D11
D12
D13
D14
D15
(1) (0)
31H , 30H
(3) (2)
33H , 32H
(NULL) (STX)
00H , 02H
(B) (A)
42H, 41H
(1234H)
12H , 34H
(D) (C)
44H , 43H
Program device memory
When the transparent code for receiving specification is enabled, the codes for receivable data and the codes for the received data which is stored is stored in the receive area on the buffer memory are as shown below.
Type Receivable codes
Transparent code for receiving specification portion
Additional code
Transparent code
Arbitrary data portion (including end code)
01H to FFH
00H to FFH
Codes stored in the receive area
(Delete)
00H to FFH
18
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
365
Operation example of reception by the receive end code
When C24 receives data from the target device when the transparent code designation is enabled
Ex.
Additional code: 10H (DLE), Transparent code: 02H (STX), End code: 0D0AH (CR+LF)
Head data
Additional code (C24 deletes)
Transparent code
Target device
0 1 2 3
D
L
E
S
T
X L
L
N
U
A B
(1234H)
C
R
L
F
30H 31H 32H 33H 10H 02H 00H 41H 42H 34H12H 0DH0AH
For word unit:
Received byte count excluding additional code (12)/2=6
For byte unit:
Received byte count excluding additional code (12)
CPU module
Reception data read request
CPU module
X3
INPUT
Receive data count is stored
ON
The following diagram is for word unit
Completion device M0
Status display device at completion
M1
ON
1 scan
Abnormal completion
Normal completion
Un\G1536 00H , 06H
Un\G1537
Un\G1538
Un\G1539
Un\G1540
Un\G1541
Un\G1542
(1) (0)
31H , 30H
(3) (2)
33H , 32H
(NULL) (STX)
00H , 02H
(B) (A)
42H , 41H
(1234H)
12H , 34H
(LF) (CR)
0AH , 0DH
Buffer memory
D2 00H , 06H
D10
D11
D12
D13
D14
D15
(1) (0)
31H , 30H
(3) (2)
33H , 32H
(NULL) (STX)
00H , 02H
(B) (A)
42H , 41H
(1234H)
12H , 34H
(LF) (CR)
0AH , 0DH
Program device memory
When the transparent code for receiving specification is enabled, the codes for receivable data and the codes for the received data which is stored in the receive area on the buffer memory are as shown below.
Type Receivable codes
Transparent code for receiving specification portion
Additional code
Transparent code
Arbitrary data portion (including end code)
01H to FFH
00H to FFH
Codes stored in the receive area
(Delete)
00H to FFH
366
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
Example of data transmission
The following shows an example of data transmission.
Transmission by transparent code for sending specification, 1st
Ex.
Transparent code designation: Additional code: 10H (DLE), Transparent code: 02H (STX)
Target device
C24
Head data
Additional code (added by C24)
Transparent code
0 1 2 3
D
L
E
S
T
X
N
U
L
L
A B
(1234H)
C
R
L
F
30H 31H 32H 33H 10H 02H 00H 41H 42H 34H 12H 0DH0AH
For word unit:
Transmitted byte count excluding additional code (12)/2=6
For byte unit:
Transmitted byte count excluding additional code (12)
18
Transmission command
CPU module
X50
Completion device
Status display device at completion
M0
M1
OUTPUT
ON
ON Abnormal completion
Normal completion
Transmission data count
The following diagram is for word unit
1 scan
D3
D10
D11
00H , 06H
(1) (0)
31H , 30H
(3) (2)
33H , 32H
D12
(NULL) (STX)
00H , 02H
D13
D14
D15
(B) (A)
42H , 41H
(1234H)
12H , 34H
(LF) (CR)
0AH , 0DH
Program device memory
Un\G1024
Un\G1025
Un\G1026
Un\G1027
Un\G1028
Un\G1029
Un\G1030
00H , 06H
(1) (0)
31H , 30H
(3) (2)
33H , 32H
(NULL) (STX)
00H , 02H
(B) (A)
42H , 41H
(1234H)
12H , 34H
(LF) (CR)
0AH , 0DH
Buffer memory
■
Program example
When C24 transmits data to the target device by transparent code designation (1st combination of the transparent code for sending specification is set)
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_Output Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
367
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(65)
(67)
Set the data to be transmitted in D10 to D15.
Set the transmission channel to CH1.
Set the send data quantity to 6.
Execute transmission
Normal completion
Abnormal completion
368
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
Transmission by 1st/2nd combinations of transparent code for sending specification
Ex.
Transparent code designation (1st): Additional code: 10H (DLE),Transparent code: 02H (STX)
Transparent code designation (2nd): Additional code: 10H (DLE),Transparent code: 03H (ETX)
Target device
C24
Head data
Additional code
(1st)
Transparent code (1st)
Additional code
(2nd)
Transparent code (2nd)
0 1 2 3
D
L
E
S
T
X
N
U
L
L
A B
D
L
E
E
T
X
N
U
L
L
C
R
L
F
30H 31H32H 33H 10H 02H 00H 41H 42H 10H 03H 00H 0DH0AH
For word unit:
Transmitted byte count excluding additional code (12)/2=6
For byte unit:
Transmitted byte count excluding additional code (12)
18
Transmission command
CPU module
X50
OUTPUT
ON
Completion device
Status display device at completion
M0
M1
ON Abnormal completion
Normal completion
Transmission data count
The following diagram is for word unit
1 scan
D3
D10
D11
00H , 06H
(1) (0)
31H , 30H
(3) (2)
33H , 32H
D12
(NULL) (STX)
00H , 02H
D13
(B) (A)
42H , 41H
D14
(NULL) (ETX)
00H , 03H
D15
(LF) (CR)
0AH , 0DH
Program device memory
Un\G1024
Un\G1025
00H , 06H
(1) (0)
31H , 30H
Un\G1026
Un\G1027
Un\G1028
(3) (2)
33H , 32H
(NULL) (STX)
00H , 02H
(B) (A)
42H , 41H
Un\G1029
Un\G1030
(NULL) (ETX)
00H , 03H
(LF) (CR)
0AH , 0DH
Buffer memory
■
Program example
When C24 transmits data to the target device by transparent code designation (2nd combination of transparent code for sending specification is set.)
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_Output Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
369
(0)
(65)
(67)
Set the data to be transmitted in D10 to D15.
Set the transmission channel to the CH1 side.
Set the send data quantity to 6.
Set the transmission direction.
Normal completion
Abnormal completion
370
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.4 Data Communication Using Nonprocedural Protocol
18.5
Handling Transparent and Additional Codes for
Bidirectional Protocol Data Communication
This section explains how to handle the transparent codes and additional codes during data communication using the bidirectional protocol.
Adding/deleting additional code designation code
The data designated by the additional code is added to/deleted from the data to be transmitted or received.
Data range of transmit/receive processing
The range of transmitted/received data to which processing to transmit/receive transparent codes and additional codes is performed includes data length, data portion, and error code of a message.
Head code (ENQ, ACK, NAK) and sum check code of each message are not included.
Ex.
Transmission sequence
Target device
A
C
K
(When normal)
*
N
A
K
Error code
L H
(When abnormal)
CPU module
E
N
Q
Data length
L H
Data section
(Designated transmission data)
Sum check code
L H
* Applicable data range
*
C24 performs the following processing during data transmission/reception.
■
At the time of request data reception
When an additional code set for reception is detected, C24 removes the additional code data and perform data reception processing by treating the immediately succeeding 1-byte data as a part f the received data during the reception of a request data.
■
At the time of response message transmission
When transparent code/additional code data set for transmission is detected, C24 transmits data by adding the additional code designation data immediately before it during the transmission of the response message to data reception.
■
At the time of request data transmission
When transparent code/additional code data set for transmission is detected, C24 transmits data by adding the additional code designation data immediately before it during data transmission.
■
At the time of response message reception
When an additional code set for reception is detected, C24 removes the additional code data and perform data reception processing by treating the immediately succeeding 1-byte data as a part of the received data during the reception of the response message to data transmission.
18
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.5 Handling Transparent and Additional Codes for Bidirectional Protocol Data Communication
371
Precautions
The additional code data to be added/deleted is not included in the data length, nor will it be subject for sum check code.
Example of request data transmission when ASCII-BIN conversion is disabled
Additional code
Transparent code
Message
E
N
Q
Data length
(0002H)
Data section Sum check code
D
L
E
L H
D
L
E
L H
05H 10H 02H 00H 12H 10H 02H 3AH BCH 0CH 01H
Additional code : 10H
Transparent code : 02H
Buffer memory
(H) (L)
00H , 02H
02H , 12H
BCH , 3AH
Transmission data count/
Receive data count
Transmission data/ receive data
Processing order for transmitting/receiving data
■
At the time of reception
• C24 deletes (removes) the additional code designation data from an arbitrary data portion when a transparent code for receiving is specified.
• C24 stores the arbitrary data portion in the receive area on the buffer memory.
When ASCII-BIN conversion is designated, C24 converts it to binary code data and stores in the buffer memory.
• When the data portion for the designated data length is received, reading the received data is requested of the CPU module.
If the sum check code is set to 'Yes' in the transmission setting via an Engineering tool parameter settings, reading the received data is requested of the CPU module upon reception of the sum check code.
Target device
Data reception
C24
(Transparent code designation)
No
(Arbitrary data section only)
Yes
Deleting additional code
Deleting transmission control code (ENQ)
Response transmission
Adding additional code
Yes
(Error code section only)
No
Adding transmission control code (ACK/NAK)
(Sum check code setting)
No
Yes
Calculation and check of sum check code
(ASCII-BIN conversion designation)
No
Yes
ASCII-BIN conversion of data length, data section
Buffer memory
Reception area
ASCII-BIN conversion of error code
Yes
Reception result storage area
No
■
At the time of transmission
• C24 adds the transmission control code to the data to be sent (arbitrary data portion of a transmission message), which is designated by the CPU module, and transmits it.
When ASCII-BIN conversion is designated, C24 converts it to ASCII code data at first and transmits it.
• When the sum check code is set to be enabled, C24 calculates the sum check code from the transmission message and add it to the transmission message.
• C24 adds the additional code data immediately before the transparent code/additional code data in respect to arbitrary data portion, and transmits it when a transparent code for sending is specified.
Target device
Data transmission
C24
(Transparent code designation)
No
(Arbitrary data section only)
Adding additional code
Yes
Adding transmission control code (ENQ)
(Sum check code setting)
No
Calculation and check of sum check code
Yes
(ASCII-BIN conversion designation)
No
ASCII-BIN conversion of transmission data count and transmission data
Yes
Buffer memory
Transmission area
Response reception
Yes
Deleting additional code
(Error code section only)
No
Deleting transmission control code (ACK/NAK)
Yes
ASCII-BIN conversion of error code
Transmission result storage area
No
The figure above shows how C24 processes the data to be transmitted/received when the ASCII-BIN conversion function, and/or the data communication function by transparent code designation are enabled and disabled.
Use this information as a reference to select the method to send/receive data for data communication with a target device.
372
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.5 Handling Transparent and Additional Codes for Bidirectional Protocol Data Communication
Ex.
The following example shows the data array when data is transmitted and received. (The transmission/reception portion of the response message is omitted.)
When ASCII-BIN conversion is not performed
C24 Target device
Head data
Arbitrary data
E
N
Q
Data length
D
L
E
L
05H 10H 02H
H
Data section
D
L
E
Sum check code
L H
00H 12H 10H 02H 3AH BCH 0CH 01H
Send
Receive
Buffer memory (transmission area/reception area)
(H) (L)
(0002H)
00H , 02H
(0212H)
02H , 12H
(BC3AH)
BCH , 3AH
Transmission data count/Receive data count
Transmission data/ receive data
(The data count is in word units)
(For 10H)
(For 02H)
Additional code
Transparent code
Ex.
When ASCII-BIN conversion is performed
Target device
Head data
Arbitrary data
E
N
Q
Data length Data section Sum check code
0
L
2
H
0 0
05H 30H 32H 30H 30H
1 2 0 2 3
D
L
E A B C
L H
31H 32H 30H 32H 33H 10H 41H 42H 43H 80H 02H
Send
Receive
(For 41H)
(For 10H)
Transpare nt code
Additional code
C24
Buffer memory (transmission area/reception area)
(H) (L)
(0002H)
00H , 02H
(0212H)
02H , 12H
(BC3AH)
BCH , 3AH
Transmission data count/Receive data count
Transmission data/ receive data
(The data count is in word units)
18
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.5 Handling Transparent and Additional Codes for Bidirectional Protocol Data Communication
373
18.6
Data Communication Using Bidirectional Protocol
This section shows examples of data communication using the bidirectional protocol when the settings/registrations are made with Engineering tool.
Parameter settings
For details for each setting item, refer to "Parameter". (
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Transparent code designation_Transparent code for sending specification (1st)
Transparent code
Additional code
Transparent code designation_Transparent code for sending specification (2nd)
Transparent code designation_Transparent code for receiving specification
Transparent code
Additional code
Transparent code
Additional code
Setting content
CH1
Bidirectional protocol
19200 bps
Set according to the target device
Enable
Enable
02H (STX)
10H (DLE)
03H (ETX)
10H (DLE)
02H (STX)
10H (DLE)
CH2
CH2 is not used
374
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.6 Data Communication Using Bidirectional Protocol
Example of data reception
The following example shows when receiving binary data including a transparent code from a target device.
Transparent code for receiving specification is enabled
Ex.
Transparent code designation: Additional code: 10H (DLE), Transparent code: 02H (STX)
Target device
Additional code (C24 deletes)
Transparent code
E
N
Q
Data length
(0004H)
Data portion
Sum check code
D
L
E
L H
(1102H) A B (1234H) C D
L H
05H 04H00H 10H 02H 11H 41H 42H 34H 12H 43H 44H 67H 01H
C24
A
C
K
06H
Reception data read request
CPU module
X3
Completion device
Status display device at completion
M0
M1
BIDIN
ON
ON
1 scan
(Receive data count):
Excluding additional codes
For word unit : 0004H
For byte unit : 0008H
Abnormal completion
Normal completion
Data length
Data area
The following diagram is for word unit
Un\G1536 00H , 04H
Un\G1537
Un\G1538
Un\G1539
Un\G1540
(1102H)
11H , 02H
(B) (A)
42H , 41H
(1234H)
12H , 34H
(D) (C)
44H, 43H
Buffer memory
D3 00H , 04H
D10
D11
D12
D13
(1102H)
11H , 02H
(B) (A)
42H , 41H
(1234H)
12H , 34H
(D) (C)
44H , 43H
Program device memory
■
Program example
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
Label to be defined Define the global label as shown below.
Description
Target module
CH1 Reception data read request
Device
X3
18
FB M+RJ71C24_BidirectionalInput Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.6 Data Communication Using Bidirectional Protocol
375
(0)
(8)
(54)
(56)
Set the reception channel to CH1.
Set the allowable number of data to be received to 6.
Set the reception direction.
Execute reception
Normal completion
Abnormal completion
When the transparent code for receiving specification is enabled, the codes for receivable arbitrary data portion and the codes for the received data which is stored in the receive area on the buffer memory are as shown below.
Type Receivable codes
Transparent code for receiving specification portion
Additional code
Transparent code
01H to FFH
00H to FFH
Codes stored in the receive area
(Delete)
00H to FFH
Data length, data portion
When the data length unit is in bytes and the data length is an odd byte, 00H is stored in the upper byte of the last data storage position in the receive area.
376
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.6 Data Communication Using Bidirectional Protocol
Example of data transmission
The following example shows when transmitting binary data including a transparent code to a target device.
Transparent code for sending specification is enabled
Ex.
Transparent code designation (1st): Additional code: 10H (DLE), Transparent code: 02H (STX)
Transparent code designation (2nd): Additional code: 10H (DLE), transparent code: 03H (ETX)
A
C
K
Target device
CPU module
Transparent code (2nd)
Additional code (2nd)
E
N
Q
Data length
Data area Sum check code
(0004H)
L H
D
L
E
D
L
E
C
R
L
F
L H
(1102H) A B (0003H)
05H 04H 00H 10H 02H 11H 41H 42H 10H 03H 00H 0DH0AH B4H00H
Transparent code (1st)
Additional code (1st)
06H
Transmission command
CPU module
X50
BIDOUT
Completion device
Status display device at completion
M0
M1
ON
ON
1 scan
Abnormal completion
Normal completion
Data length (transmission data count):
Excluding additional codes
For word unit : 0004H
For byte unit : 0008H
The following diagram is for word unit
Address
Transmission data
D3 00H , 04H Un\G1024 00H , 04H
D10
D11
D12
D13
(1102H)
11H , 02H
(B) (A)
42H , 41H
(0003H)
00H , 03H
(LF) (CR)
0AH , 0DH
Program Buffer memory device memory
Un\G1025
Un\G1026
Un\G1027
Un\G1028
(1102H)
11H , 02H
(B) (A)
42H , 41H
(0003H)
00H , 03H
(LF) (CR)
0AH , 0DH
Buffer memory
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
18
FB M+RJ71C24_BidirectionalOutput Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.6 Data Communication Using Bidirectional Protocol
377
(0)
(20)
(65)
(67)
Set the transmission channel to CH1.
Set the send data quantity to 4.
Set the data to be transmitted in D10 to D13.
Set the transmission direction.
Execute transmission.
Normal completion
Abnormal completion
378
18 TRANSPARENT CODES AND ADDITIONAL CODES
18.6 Data Communication Using Bidirectional Protocol
19
COMMUNICATING WITH ASCII CODE (ASCII-
BIN CONVERSION)
This chapter explains the ASCII-binary conversion in order to transmit/receive data in ASCII code to/from a target device.
19.1
ASCII-Binary Conversion
ASCII-BIN conversion is the data conversion function that converts all data communicated between C24 and a target device to ASCII code data.
The ASCII-BIN conversion of data to be sent/received is performed by C24 according to the parameter settings.
CPU module C24 Target device
With ASCII-BIN conversion
32
H
31
H
34
H
33
H
1234
H
19
37
H
38
H
35
H
36
H
5678
H
Without ASCII-BIN conversion
12
H
34
H
78
H
56
H
19.2
Settings for ASCII-BIN Conversion
In order to convert data to be sent/received with the nonprocedural protocol and bidirectional protocol from binary code to
ASCII code, it is necessary to configure the setting for C24 before performing data communication.
The settings for ASCII-BIN conversion are as shown below:
• The ASCII-BIN conversion settings can be configured for each interface.
• To enable ASCII-BIN conversion, set "ASCII-BIN conversion designation" to "ON".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.1 ASCII-Binary Conversion
379
19.3
ASCII-BIN Conversion for Data Communicated with Nonprocedural Protocol
This section explains the ASCII-BIN conversion of data to be communicated using the nonprocedural protocol.
Data range of transmit/receive processing
The range of data to be sent/received to which ASCII-BIN conversion is performed is as shown below:
Applicable data range at transmission Applicable data range at transmission
Message at transmission/ reception in arbitrary format
Arbitrary data
Message at transmission/ reception using user frames
User frame
(First frame)
Arbitrary data
User frame
(Last frame)
Applicable data range at reception
C24 performs the following processing when sending or receiving data.
Applicable data range at reception
■
At the time of data reception
• C24 receives data of which data code is in the range of 30H to 39H ('0' to '9') and 41H to 46H ('A' to 'F') as the data within the above conversion applicable range.
• C24 regards given data portion as ASCII code, and converts it to binary code to store in the buffer memory.
• The user frame portion is received in the data format corresponding to the registration to C24.
■
At the time of data transmission
• C24 transmits data of which data code is in the range of 30H to 39H ('0' to '9') and 41H to 46H ('A' to 'F') as the data within the above conversion applicable range.
• C24 regards data designated by the CPU module (given data portion in a transmission message) and user frame portions as binary code data, and converts to ASCII code to transmit them.
Target device (When communicated in an arbitrary format)
Head data
Arbitrary data
Send
1 2 0 2 3 A B C
31
H
32
H
30
H
32
H
33
H
41
H
42
H
43
H
Receive
Buffer memory (transmission area/reception area)
(H) (L)
(0002H)
00H , 02H
(0212H)
02H , 12H
(BC3AH)
BCH , 3AH
Transmission data count/
Receive data count
Transmission data/ receive data
(No. of data in word units)
380
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.3 ASCII-BIN Conversion for Data Communicated with Nonprocedural Protocol
At the time of data transmission with the user frame, it is possible to transmit data without converting the data in any user frame portion or send area on the buffer memory even if "Convert" is designated in the ASCII-BIN conversion designation area.
When sending data without ASCII-BIN conversion, specify the user frame number by the method shown below.
• Specify the number obtained by adding 4000H to the registered user frame No.
b15 b14 b13 to b0
Number of frames
0: Conversion enabled 1: Conversion disabled
0: Frame registered in Flash ROM 1: Frame registered in buffer memory
When sending data in the portions designated in 4001H to 44AFH, C000H to C01FH, the data is transmitted without conversion even when the following designations are enabled.
• Specifying an additional code by the transparent code for sending specification (
• Designating "Auto delete enabled" in the NULL character automatic removal designation area (
Character Removal to Send Data using Nonprocedural Protocol)
User frame No. to be sent
1H to 3E7H (1 to 999)
3E8H to 4AFH (1000 to 1199)
8000H to 801FH (-32768 to -32737)
Designated No. for the user frame when transmitting without ASCII-BIN conversion
(4000H added)
4001H to 43E7H (16385 to 17383)
43E8H to 44AFH (17384 to 17583)
C000H to C01FH (-16384 to -16353)
Processing order for data transmission/reception
The processing steps taken by C24 to transmit/receive data with ASCII-BIN conversion and transparent code designation enabled are explained in the section for transparent codes and additional codes. (
Page 360 Handling Transparent and
Additional Codes for Nonprocedural Protocol Data Communication)
• Data transmission/reception in arbitrary formats
• Data transmission/reception using user frames
19
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.3 ASCII-BIN Conversion for Data Communicated with Nonprocedural Protocol
381
19.4
Data Communication Using Nonprocedural
Protocol
This section shows examples of data communication using the nonprocedural protocol when the settings/registrations are made with Engineering tool.
Parameter settings
For details for each setting item, refer to the parameters. (
Setting item
Basic settings
Application settings
Various control specification
User frame specification
Setting content
Test mode setting
Communication protocol setting
Communication speed setting
CH1
Transmission setting
Send user frame designation
Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Conversion designation
Receiving end specification
ASCII-BIN conversion designation
Receive end data quantity designation
User frame specification for receiving
ON
3
Receive end code designation
User frame use enable/disable designation
0009H
Use
Start frame No. designation (1st) 03E8H
Start frame No. designation (2nd) 03E9H
Final frame No. designation (1st) 041BH
Final frame No. designation (2nd) 041BH
Output start pointer designation
Output quantity designation
0001H
0005H
Send frame No. designation (1st) 43F2H
Send frame No. designation (2nd) 43F3H
Send frame No. designation (3rd) C001H
Send frame No. designation (4th) 8000H
Nonprocedural protocol
Set according to the target device
Independent
Set according to the target device
Send frame No. designation (5th) 441BH
Remarks
CH2
CH2 is not used
Arbitrary registered data
1st
5th
Arbitrary registered data
Buffer memory designation
Arbitrary registered data
382
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
Example of data reception
Program example
The following shows an example of data reception.
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
Label to be defined Define the global label as shown below.
Description
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
Device
X3
X4
19
FB M+RJ71C24_Input Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(7)
(53)
(55)
Set the reception channel to CH1.
Set the allowable number of data to be received to 6.
Set the reception direction.
Execute reception.
Normal completion
Abnormal completion
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
383
Operation example of reception by the receive end code
When C24 receives data from the target device when ASCII-BIN conversion is enabled (Reception by the receive end code)
Ex.
End code: 9H (code after ASCII-BIN conversion)
Target device
Head data
0 1 2 3 4 5 A B C D E 9
Data corresponding to complete code
For word units
Number of bytes after
ASCII-BIN conversion:
((6)/2=3)
For byte units
Number of bytes after
ASCII-BIN conversion:
(6)
* Two bytes of received data is read to
C24 as one-byte data.
Transmit data from the target device so that the converted complete code data is arranged in an even-number-byte of data.
30H 31H 32H 33H 34H 35H 41H 42H 43H 44H 45H 39H
Set to even byte
C24
Reception data read request
CPU module
X3
INPUT
Store receive data count
ON
The following diagram is for word unit
Completion device M0
ON
Abnormal completion
Status display device at completion
M1
Normal completion
1 scan
Un\G1536 00H , 03H
Un\G1537 23H , 01H
Un\G1538 ABH , 45H
D2 00H , 03H
D10 23H , 01H
D11 ABH , 45H
Un\G1539 E9H , CDH D12 E9H , CDH
Buffer memory Program device memory
When ASCII-BIN conversion is enabled, the codes for the receivable data and the codes for the received data which is stored in the receive area on the buffer memory are as shown below.
Type Receivable codes
Arbitrary data portion (including end code) 30H to 39H, 41H to 46H
Codes stored in the receive area
0H to 9H, AH to FH
If data codes other than 30H to 39H and 41H to 46H are received for an arbitrary data portion, an error (7F20H) occurs after
ASCII-BIN conversion processing by C24.
To perform ASCII-BIN conversion, ensure the end code is the code after conversion.
384
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
Operation example of reception based on the receive end data quantity
Ex.
When C24 receives data from the target device when ASCII-BIN conversion is enabled (Reception based on the receive end data quantity)
Target device
Head data
0 1 2 3 4 5 A B C D E 9
For word units
Number of bytes after
ASCII-BIN conversion:
((6)/2=3)
For byte units
Number of bytes after
ASCII-BIN conversion:
(6)
* Two bytes of receive data is read to
C24 as one-byte data.
30H 31H 32H 33H 34H 35H 41H 42H 43H 44H 45H 39H
Set to even byte
C24
19
Reception data read request
CPU module
X3
Store receive data count
INPUT
ON
The following diagram is for word unit
Completion device M0
ON
Abnormal completion
Status display device
M1 at completion
Normal completion
Un\G1536 00H , 03H D2 00H , 03H
1 scan
Un\G1537 23H , 01H D10 23H , 01H
Un\G1538 ABH , 45H D11 ABH , 45H
Un\G1539
E9H , CDH
Buffer memory
D12 E9H , CDH
Program device memory
When the transparent code for receiving specification is disabled and ASCII-BIN conversion is enabled, the codes for the receivable data and the codes for the received data which is stored in the receive area on the buffer memory are as shown below.
Type Receivable codes
Arbitrary data portion (including end code) 30H to 39H, 41H to 46H
Codes stored in the receive area
0H to 9H, AH to FH
If data codes other than 30H to 39H and 41H to 46H are received for an arbitrary data portion, an error (7F20H) occurs after
ASCII-BIN conversion by C24.
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
385
Operation example of reception using user frames
Ex.
When C24 receives data from the target device when ASCII-BIN conversion is enabled (Reception using user frames)
Head data
S
T
X
Q
Receive data count
For word units
Number of bytes after ASCII-BIN conversion of
receive data excluding frames and additional codes: ((6)/2=3)
For byte unites
Number of bytes after ASCII-BIN conversion of receive data
excluding frames and additional codes: (6)
Target device
;
0 1 2 F 5 A B C D E F 9
E
T
X
The following diagram is for word unit
02H 51H 00H 0AH 3BH 30H 31H 32H46H 35H 41H 42H 43H 44H 45H 46H 39H 03H DEH
C24
Reception data read request
CPU module
X3
Completion device M0
Status display device at completion
M1
First frame
(corresponds to registration number 3E8H)
INPUT
Arbitrary data
ON
ON
1 scan
Last frame(corresponds to registration number 41BH)
Abnormal completion
Normal completion
Un\G173
Un\G174
2H
3E8H
User frame enable/ disable designation
First frame No. designation
(1st)
Un\G175 3E9H
(2nd)
Un\G176 3EAH
(3rd)
Un\G177
(No designation)
0H
Un\G178 41BH
(4th)
Last frame No. designation
(1st)
Un\G179 41BH
(2nd)
Un\G180
(No designation)
0H
Un\G181
(No designation)
0H
Un\G288
(Designation) (No designation)
Un\G289
1002H/ 0H
(Convert)
1H
Un\G603 1H
(3rd)
(4th)
Receive transparent code designation
ASCII-BIN conversion designation
Receive user frame ( th) to D0
Un\G1536
Un\G1537
00H , 03H
2FH , 01H
Receive data count
Receive data
(arbitrary data) to D3
Un\G1538 BCH , 5AH
D10 to
D12
Un\G1539 F9H , DEH
Buffer memory
386
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
Example of data transmission
The following shows an example of data transmission.
Transmission of arbitrary data
When C24 transmits data to the target device with ASCII-BIN conversion used (Transmitting given data with OUTPUT dedicated instruction)
Ex.
Target device
C24
(arbitrary data)
3 4 1 2 A B 5 6
33H 34H 31H 32H 41H 42H 35H 36H
* Eight characters of data in the transmission area are sent in two characters per byte through
ASCII-BIN conversion.
19
Transmission command
CPU module
X50
Completion device
Status display device at completion
M0
M1
OUTPUT
ON
ON
1 scan
Abnormal completion
Normal completion
Un\G289
(Convert)
1H
Un\G1024
*1 Un\G1025
Un\G1026
00H , 02H
(1234H)
12H , 34H
(56ABH)
56H , ABH
Buffer memory
ASCII-BIN conversion designation
Transmission area
(Designation of no. of data sent)
(Transmission data)
*1 0004H in byte units
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_Output Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
387
(0)
(10)
(55)
(57)
Set the transmission channel to CH1.
Set the send data quantity to 2.
Set the data to be transmitted in D10 to D11.
Set the transmission direction.
Execute transmission.
Normal completion
Abnormal completion
388
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
Transmission using user frame
When C24 transmits data to the target device with ASCII-BIN conversion used (Transmitting given data and user frame combined with PRR dedicated instruction)
Ex.
Target device
C24
S
T
X
Q ; T O T A L
;
(Total number)
Data in transmission area
(arbitrary data)
E
T
X
02H 51H 0AH 00H 3BH 54H4FH 54H 41H 4CH 3BH
(012 DH)
DH 01H
3 4 1 2 A B 5 6
33H 34H 31H 32H 41H 42H 35H 36H 03H A7H
* Eight characters of data in the transmission area are sent in two characters per byte through
ASCII-BIN conversion.
registration No. of corresponding user frame
Transmission command
CPU module
X50
Completion device M0
Status display device
M1 at completion
Corresponds to 3F2H
(for first designated frame)
Corresponds to 3F3H
(for second designated frame)
Corresponds to
8001H (for third designated frame)
8000H
(for fourth designated frame)
Corresponds to 41BH
(for fifth designated frame)
PRR
ON
ON Abnormal completion
Normal completion
Un\G182
(Not sent)(Sending)
0H/Other than 0H
Un\G183
(Do not send)
0H
Un\G184
(1st)
1H
User frame No. being transmitted
CR/LF output designation
Output head pointer designation
Un\G185 5H Output count designation
Un\G186
Un\G187
43F2H
43F3H
Transmission frame no. designation (1st)
(2nd)
1 scan
C001H Un\G188
Un\G189 8000H
(3rd)
(4th)
Un\G190 441BH (5th)
*1
Un\G191
Un\G289
Un\G1024
0H
(Convert)
1H
00H , 02H
(6th)
ASCII-BIN conversion designation
Transmission area
(Designation of no. of data sent)
Un\G1025
Un\G1026
(1234H)
12H , 34H
(56ABH)
56H , ABH
Buffer memory
(Transmission data)
*1 0004H in byte units
■
Program example
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.wnSet_TransmissionData_D[0]
C24_1.wnForUserRegistrationNo8001H_D[0]
C24_1.wnForUserRegistrationNo8001H_D[1]
Label to be defined Define the global label as shown below.
Description
Target module
CH1_Send data specification
For user registration number 8001H [0]
For user registration number 8001H [1]
Device
U0\G1025
U0\G6912
U0\G6913
19
FB M+RJ71C24_SendUserFrame Sends data using the nonprocedural protocol communication and the user frame according to the setting of the user frame specification area for sending data.
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
389
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
(0)
(41)
(88)
(90)
Set the transmission channel to CH1.
Set CR/LF to "Do not send".
Set the send pointer to 1.
Set the output quantity to 5.
Set the send data length to 2WORD.
Set an arbitrary send data.
Set an arbitrary transmitted data in send buffer.
Set the data to be transmitted to user frame 8001H.
Set the transmission direction.
Execute user frame transmission.
Normal completion
Abnormal completion
390
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.4 Data Communication Using Nonprocedural Protocol
19.5
ASCII-BIN Conversion for Data Communicated with Bidirectional Protocol
This section explains the ASCII-BIN conversion of data to be communicated using the bidirectional protocol.
Transmitted/received data range for ASCII-BIN conversion
The range of data to be sent/received to which ASCII-BIN conversion is performed is as shown below:
Ex.
Message at data transmission/reception
Applicable data range at transmission/reception
E
N
Q
(Arbitrary data)
Data length
Data section
Sum check code
Applicable data range at transmission/reception
N
A
K Error code Response message
A
C
K
C24 performs the following processing when sending or receiving data.
■
At the time of data reception
Processing flow when a message is received during data reception
• C24 converts a received data length (4-digit ASCII code data (hexadecimal)) to 2-byte binary code data and stores it in the receive data quantity storage area.
• C24 converts each two characters of a received data portion (2-digit ASCII code data (hexadecimal)) to 1-byte binary code data and stores it in the receive data storage area.
• C24 calculates a sum check code using the received data length and data portion prior to ASCII-BIN conversion, then checks the head of the received sum check code using the code as a lower byte.
Processing flow when a response message is received
• C24 converts the first 2 digits of a received error code (4-digit ASCII code data (hexadecimal)) to 2-byte binary code data as the lower byte, and stores it in the transmission result storage area. (When '1234' is received, it is converted to 3412H and stored.)
■
At the time of data transmission
Processing flow when a message is transmitted during data transmission
• C24 converts a data length (send data quantity) to 4-digit ASCII code data (hexadecimal), and sends it beginning with the lowest byte (L).
• C24 converts a data portion (send data) for one address to 4-digit ASCII code data (hexadecimal), and sends it beginning with the lowest byte (L).
• C24 calculates a sum check code using the data length and data portion after ASCII-BIN conversion, and adds it to the transmission message.
Processing flow when a response message is transmitted
• C24 converts an error code for a detected error to 4-digit ASCII code data (hexadecimal), then sends it beginning with the lowest byte (L).
(For 3412H, it is converted to '3412' and sent beginning with '12'.)
19
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.5 ASCII-BIN Conversion for Data Communicated with Bidirectional Protocol
391
Ex.
Calculation of sum check code
(When word units are used)
E
N
Q
Data length
(0002)
Message
Data portion
*1
Sum check code
L
0 2
05
H
30
H
32
H
H
0 0
30
H
30
H
1 2 3
31
H
32
H
33
H
4 5 A
34
H
35
H
41
H
L H
B C
42
H
43
H
87
H
02
H
Buffer memory
(H) (L)
00H , 02H
34H , 12H
BCH , 5AH
Transmission data count/Receive data count
Transmission data/ receive data
ASCII-BIN conversion
*1 Calculation of sum check code
30H+32H+30H+30H+31H+32H+33H+34H+35H+41H+42H+43H=0287H
(H)(L)
Processing order for data transmission/reception
The processing steps taken by C24 to transmit/receive data with ASCII-BIN conversion and transparent code designation enabled are explained in the section for transparent codes and additional codes. (
Page 371 Handling Transparent and
Additional Codes for Bidirectional Protocol Data Communication)
C24 Target device
Head data
E
N
Q
Data length
Arbitrary data
Data section
(Data communication)
Send
Sum check code
L
05
H
0 2
30
H
32
H
H
0 0
30
H
30
H
1 2 0 2
31
H
32
H
30
H
32
H
L H
3 A
33
H
41
H
B C
42
H
43
H
80
H
02
H
Receive
Head data
N
A
K
Error code
A
C
K
(Communication of response massage)
Receive or
L
3 4
15
H
33
H
34
H
1
H
2
31
H
32
H
06
H
Send
Buffer memory (transmission area/reception area)
(H) (L)
(0002H)
00H , 02H
(0212H)
02H , 12H
(BC3AH)
BCH , 3AH
Transmission data count/Receive data count
Transmission data/receive data
At normal completion : 0000H
At abnormal completion : 1234H
Transmission result/reception result
392
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.5 ASCII-BIN Conversion for Data Communicated with Bidirectional Protocol
19.6
Data Communication Using Bidirectional Protocol
This section shows examples of data communication using the bidirectional protocol when the settings/registrations are made with Engineering tool.
Parameter settings
For details for each setting item, refer to the parameter. (
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Setting content
CH1
Bidirectional protocol
Set according to the target device.
Independent
Set according to the target device.
Station number setting (CH1, 2 in common: 0 to 31)
Conversion designation ASCII-BIN conversion designation
ON
CH2
CH2 is not used
19
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.6 Data Communication Using Bidirectional Protocol
393
Example of data reception
Data reception example (ASCII-BIN conversion is enabled)
The following shows an example of data reception when ASCII-BIN conversion is enabled.
Ex.
Target device
E
N
Q
Data length
(0004H)
Data area Sum check code
0
L
4 0
H
0 1 2 3 4 5 A B C D E F 0 0 D 0 A
L H
05H 30H 34H 30H 30H 31H 32H 33H 34H 35H 41H 42H 43H 44H 45H 46H 30H 30H 44H 30H 41H 6DH 04H
Set to even byte except for additional code
A
C
K
C24
Reception data read request
CPU module
X3
Completion device M0
Status display device
M1 at completion
■
Program example
Category Label name/FB name
Module label C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
Label to be defined Define the global label as shown below.
BIDIN
ON
ON
1 scan
Abnormal completion
Normal completion
Data length
*
06H
Two bytes of reception data is read to the C24
as one-byte data (excluding additional code).
Data length (receive data count): Excluding additional codes
Word units
Number of bytes after ASCII-BIN conversion: (8)/2=4
Byte units
Number of bytes after ASCII-BIN conversion: (8)
The following diagram is for word unit
Data area
Un\G1536 00H , 04H
Un\G1537 34H , 12H
Un\G1538 BCH , 5AH
Un\G1539 F0H , DEH
Un\G1540 0AH , 0DH
Buffer memory
D3
D10
00H , 04H
34H , 12H
D11 BCH , 5AH
D12 F0H , DEH
D13 0AH , 0DH
Program device memory
Description
Target module
CH1 Reception data read request
Device
X3
FB M+RJ71C24_BidirectionalInput Reads the received data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
394
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.6 Data Communication Using Bidirectional Protocol
(0)
(6)
(52)
(54)
Set the reception channel to CH1.
Set the allowable number of data to be received to 6.
Set the reception direction.
Execute reception.
Normal completion
Abnormal completion
When ASCII-BIN conversion is enabled, the codes for receivable arbitrary data portion and the codes for the received data that is stored in the receive area on the buffer memory are as follows:
Type Receivable codes
Data length, data portion 30H to 39H, 41H to 46H
Codes stored in the receive area
0H to 9H, AH to FH
19
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.6 Data Communication Using Bidirectional Protocol
395
Example of data transmission
Data transmission example (ASCII-BIN conversion is enabled)
The following shows an example of data transmission with ASCII-BIN conversion used.
Ex.
A
C
K
Target device
06H
C24
E
N
Q
Data length
(0004)
Data area Sum check code
L H
0 4 0 0 1 2 3 4 5 A B C D E F 0 0 D 0 A
L H
05H 30H 34H 30H 30H 31H 32H 33H 34H 35H 41H 42H 43H 44H 45H 46H 30H 30H 44H 30H 41H 6DH 04H
Transmission command
CPU module
Completion device
Status display device at completion
X50
M0
M1
BIDOUT
ON
ON
Data length (Number of data transmitted): Excluding additional code
Word units
Number of bytes after ASCII-BIN conversion: (8)/2=4
Byte units
Number of bytes after ASCII-BIN conversion: (8)
Abnormal completion
Normal completion
The following diagram is for word unit
1 scan
D3
00H , 04H
D10
34H , 12H
D11
BCH , 5AH
D12
F0H , DEH
Transmission data
D13
0AH , 0DH
Program device memory
Un\G1024
00H , 04H
Un\G1025
34H , 12H
Un\G1026
BCH , 5AH
Un\G1027
F0H , DEH
Un\G1028
0AH , 0DH
Buffer memory
For data designated by the CPU module, data for one word is converted to 4-byte data ('0' to '9' and 'A' to 'F') and transmitted.
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_BidirectionalOutput Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
396
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.6 Data Communication Using Bidirectional Protocol
(0)
(20)
(65)
(67)
Set the transmission channel to CH1.
Set the send data quantity to 4.
Set arbitrary data to be transmitted in D10 to D13.
Set the instruction execution.
Execute transmission.
Normal completion
Abnormal completion
19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
19.6 Data Communication Using Bidirectional Protocol
397
19
20
DATA COMMUNICATIONS BETWEEN TARGET
DEVICE AND CPU MODULE IN M:N BASIS
Always read this chapter when communicating data by the multidrop connection in the system configuration that the target device and CPU module are connected on an m:n basis.
This section explains data communications between the target devices and the CPU module by the multidrop connection of multiple target devices (m stations) and C24s (n stations). (The total number of 'm' and 'n' is up to 32 stations.)
With this m:n multidrop communication, only MC protocol data communications by command transmission from the target devices can be performed.
20.1
Considerations on Data Communications
Concurrent data communication with multiple target devices
When communicating data in m:n system configuration, more than one target devices cannot communicate data with the CPU module at the same time.
Configure interlock among the target devices so that the target device can communicate data with the CPU module in a 1:1 basis.
For details on arrangement and method for interlock among target devices, refer to the following sections.
Page 400 Arrangement for Interlock among Target Devices
Page 403 Examples of Procedure for Data Communications with CPU Module
Data communication method
Data communication between target devices and the CPU module can be performed by the following methods only:
• Data communication with the full-duplex communication method (The m:n data communications is impossible with halfduplex communications)
• Data communications by command transmission from target device using the MC protocol excluding the format 3 and format 5 control procedure (Data communications using the format 3 and format 5 control procedure and data transmission from sequence program using the on-demand function cannot be performed.)
Data transmitted from any of target devices
Data transmitted by one target device is received by all the other target devices, including the target device that transmitted the data. The sent data from the CPU module is also received by all the target devices.
Therefore, devices that received data not addressed to their own stations (by judging by the station number in a message) are required to ignore the received data.
At the CPU module side, C24 also ignores the received data not addressed to it.
398
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.1 Considerations on Data Communications
Numbers designated for "Station No." and "Self-station No."
Designate the numbers below for "Station No." and "Self-station No." in the command message transmitted from the target device for data communications in the m:n system configuration.
■
When accessing to C24
Item Communications with 2C/3C/4C frame
Station No.
Self-station No.
Station number of C24 to be passed through
Station number of access source target device
Communications with 1C frame
No designation necessary (No "Self-station No." item)
■
When accessing to other device (communications for interlock)
Item
Station No.
Self-station No.
Communications with 2C/3C/4C frame
Station number of access destination device
Station number of access source device
Communications with 1C frame
No designation necessary (No "Self-station No." item)
*1 The number which has not been set to the respective C24s on the CPU module side is used within the range of "0" to "31" (00H to 1FH) as the number for the target device side in "Station No." and "Self-station No." in the message.
Select and designate the number of each target device.
The designation method is as shown in 'Contents of the data designation items' of each frame.
( MELSEC Communication Protocol Reference Manual)
Station No.: Designate the number of the transmit destination device.
Self-station No.: Designate the number of the transmit source device. (No designation necessary when 1C frame is used.)
20
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.1 Considerations on Data Communications
399
20.2
Arrangement for Interlock among Target Devices
When using the multidrop connection to communicate data between target devices and the CPU module in a m:n basis, the interlocks need to be configured among the target devices to prevent more than one target devices from communicating data with the CPU module at the same time.
The arrangements necessary for providing the interlocks among the target devices in order for one of the target devices to communicate data with the CPU module are as shown below.
(Arrangements for priority use of the line (obtaining line ownership) from the start to the end of data communications with the
CPU module.)
Maximum communication time per target device station
Determine the maximum time for each target device to communicate data with the CPU module once it obtained the line ownership.
This prevents loss of data communications between other devices and the CPU module in such cases as the target device, which obtained the line ownership, went down.
Ex.
Time
Target device 1
Target device 2
Target device 5
: Indicates the range within which the target device cannot obtain line ownership.
: Indicates the range within which the target device can obtain line ownership and can have data communication with the CPU module.
Start of data communications
• The maximum data communication time per target device station must be the maximum time required by the respective devices to communicate data with the CPU module.
• The device which obtained the line ownership must complete data communication with the CPU module within the maximum data communication time after the system started. (If data communications cannot be completed within the time, initialize the C24 transmission sequence by transmitting the EOT/CL code to the target CPU module within the maximum communication time. ( MELSEC Communication Protocol
Reference Manual))
• While a target device and the CPU module are communicating data, have the other devices check for timeout so that they do not transmit data during this time.
400
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.2 Arrangement for Interlock among Target Devices
Message structure when communicating data among target devices
Determine the message structure to communicate data among target devices by any of the following.
This is determined to provide interlocks among the other target devices so that each of them can communicate data with CPU module on a 1:1 basis.
Same message structure as control procedure format frame
■
Use an unset number for "Station No." and "Self-station No." in a message.
The number which has not been set to the respective C24s on the CPU module side is used within the range of "0" to "31"
(00H to 1FH) as the number for the target device side in "Station No." and "Self-station No." in the message.
■
Select and designate the target device numbers.
The designation method is as shown in 'Contents of the data designation items' of each frame. ( MELSEC Communication
Protocol Reference Manual)
• Station No. : Designate the number of the transmission destination device.
• Self-station No.: Designate the number of the transmission source device. (No designation necessary when 1C frame is used.)
Ex.
When the m:n configuration is 5:27
The values in ( ) indicate the respective station number of the target device and C24. (decimal: hexadecimal)
(27: 1BH)
Target device
-1-
(28: 1CH)
Target device
-2-
(31: 1FH)
Target device
-5-
20
(0: 00H)
CPU C24
(1: 01H)
CPU C24
(2: 02H)
CPU C24
(3: 03H)
CPU C24
(26: 1AH)
CPU C24
The above C24 includes Q series C24, L series C24, QC24(N), and UC24.
(3C frame format 1)
E
N
Q
H
F
L
9
H
1
L
C
H
0
L
0
H
F
L
F
H
1
L
B
05H 46H 39H 31H 43H 30H 30H 46H 46H 31H 42H
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.2 Arrangement for Interlock among Target Devices
401
Different message structure from control procedure format frame
■
Change the head data of each message to other arbitrary data.
• When format 1, format 2, or format 4 is selected for communication using ASCII code, change ENQ (05H).
■
Use arbitrary data array after the head data of each message according to the user specifications.
Ex.
Head data
Arbitrary contents
Target device 1
(station No.
1BH)
(;) (1C) (1B) (ZZ) (2) (CD)
3BH 31H 43H 31H 42H 5AH 5AH 32H 43H 44H
Target device 2
(station No.
1CH)
(:)
3AH
(1C) (1B)
Arbitrary contents
Head data
For the message structure for general report to all of the other devices except the CPU module station, use an unused station number or a massage structure different from the C24 control procedure format.
402
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.2 Arrangement for Interlock among Target Devices
20.3
Examples of Procedure for Data Communications with CPU Module
This section shows examples of procedures to communicate data with the CPU module by configuring interlocks among the target devices.
Sequential data communications between target devices and the
CPU module
Each target device obtains the line ownership in turns according to the station number to communicate with the CPU module.
Ex.
Time
Station No.
1BH target device
Transmission to transfer the line ownership
Response
Station No.
1CH target device
Data communications with the CPU module
Station No. (m-1) target device
Ex.
The example below shows the procedures for each target device to communicate data with the CPU module.
20
Target device
(Station No.:1BH)
Ò
When communicating data with the station
No. 1H CPU module
Ó a
CPU
(Station No.:0H)
C24 CPU
(Station No.:1H)
C24
Target device
(Station No.:1CH)
CPU
Ô
(Station No.:2H)
C24
Target device
(Station No.:1DH)
Ô
Target device
(Station No.:1EH)
Ô
(Station No.:15H)
CPU C24
: Target device that obtained the line ownership
The above C24 includes Q series C24, L series C24, QC24(N), and UC24.
When the system starts, the target device with the lowest station number (1BH) obtains the line ownership.
• When format 1, format 2, or format 4 is selected for communication using ASCII code, change ENQ (05H).
The target device that obtained the line ownership,
• Begins the processing from after communicating data with the CPU module within the maximum data communication time arranged among the target devices, when communicating data with the CPU module.
• Immediately begins the processing from , when not communicating data with the CPU module.
The target devices that have not obtained the line ownership check the line usage time of the target device that obtained the line ownership and ignore the received data not addressed to their own station.
When the line usage time exceeds the maximum data communication time, each target device performs the processing of .
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.3 Examples of Procedure for Data Communications with CPU Module
403
Ex.
Target device
(Station No.:1BH)
(Station No.:0H)
CPU C24
Õ
(Before
Ö
) (Before
Ö
)
Target device Target device Target device
(Station No.:1H)
(Station No.:1CH)
Ö ×
Data communications with arbitrary
CPU module
(Station No.:2H)
CPU C24 CPU C24
(Station No.:1DH) (Station No.:1EH)
(Station No.:15H)
CPU C24
: Target device that obtained the line ownership
The above C24 includes Q series C24, L series C24, QC24(N), and UC24.
The target device that has communicated data with the CPU module, or a target device that does not need to communicate data with the CPU module transmits the data for transferring the line ownership to the target device with the next station number. A message structure example is shown in .
When a response message (refer to in this section) is not received from the next target device to which the line ownership to be passed, data transmission for transferring the line ownership to the target device with the next station number is repeated until the line ownership is transferred.
The target device that receives the line ownership transmits a response message to the target device that passes it the line ownership.
Ex.
Message of
Õ
above
*1
Target device that
(1BH) transfers line ownership
(;) (1C) (1B) (ZZ) (2) (CD)
3BH 31H 43H 31H 42H 5AH 5AH 32H 43H 44H
Target device passed line ownership
(1CH)
(:) (1C) (1B)
3AH 31H 43H 31H 42H
Message of Ö
*1 Command "ZZ" is a command for description purpose. Determine the command to transfer/obtain the line ownership at the user side.
The target device that accepted the line ownership by transmitting the response message performs the processing from
.
When the line usage time of the target device that currently has the line ownership exceeds the maximum data communications time,
• The target device, which has the next station number, transmits all of the other devices excluding the CPU module station the general report data and obtains the line ownership and performs the processing .
404
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.3 Examples of Procedure for Data Communications with CPU Module
Ex.
*1 *2
Target device that obtains the line ownership
(1CH) (;) (1F) (1C) (ZZ) (0) (0A)
3BH 31H 46H 31H 43H 5AH 5AH 30H 30H 41H
*1 It is a station number for general report to all of the other devices.
*2 Command "ZZ" is a command for description purpose. Determine the command to transfer/obtain the line ownership at the user side.
• The other target devices check if the general report data was received.
If the data was received, the target device performs the processing .
If the data was not received, the next target device transmits general report data and obtains the line ownership and performs the processing . The other target devices checks if the general report data has been received.
20
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.3 Examples of Procedure for Data Communications with CPU Module
405
Data communications between target devices and CPU module by designating a master station and slave stations
One of the target devices becomes the master station and the other target devices communicate data with the CPU module after obtaining permission from the master station.
Ex.
Time
Master station target device
Communications request
Slave station target device 1
Slave station target device 2
Permission granted response
Communications complete report
Respo nse
Communications request
Permission granted response
General report to start and end data communications between master station and
CPU module
Communications request
Permission granted response
Start End
Communications complete report
Response
Slave station target device m-1
Data communications with CPU module
Data communications with CPU module
Data communications with CPU module
The example below shows the procedures for each target device to communicate data with the CPU module.
In this example, after the start of data communications between a target device and the CPU module, each device checks for timeout of the maximum data communication time. In addition, devices on the slave station, which are not communicating data with the CPU module, check if the target device that completed data communications with the CPU module transmitted a communication complete report.
In the following descriptions, the target device with the lowest station number(1BH) is the master station and the other target devices are slave stations.
Ex.
Master station (Before Ó ) (after
Ó
)
Target device Target device Target device Target device
(Station No.:1BH) (Station No.:1CH) (Station No.:1DH) (Station No.:1EH)
Ó
(Station No.:0H)
CPU C24
(Station No.:1H)
CPU C24
Ò
(Station No.:2H)
CPU C24
(Station No.:15H)
CPU C24
Target device that obtained the line ownership
The above C24 includes Q series C24, L series C24, QC24(N), and UC24.
A slave station that wants to communicate data with the CPU module sends a communications request to the master station to obtain the line ownership. A message structure example is shown in .
406
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.3 Examples of Procedure for Data Communications with CPU Module
The master station transmits a permission response to the slave station that issued the communications request.
Ex.
Target device of slave station that wants to obtain the line ownership
(1CH)
Massage of Ò *1
(;) (1B) (1C) (ZX) (2) (CB)
3BH 31H 42H 31H 43H 5AH 58H 32H 43H 42H
*1 Command "ZX" is a communications request command for description purpose.
The user should select the command that requests communications.
Master station target device
(1BH)
Master station
(Before
×
)
Õ
Target device
(Station No.:1BH)
×
(Station No.:0H)
CPU C24
(Station No.:1H)
CPU C24
Ö
(:) (1B) (1C) (Y)
3AH 31H 42H 31H 43H 59H
Massage of Ó
(After
×
)
Target device
(Station No.:1CH)
Ô
(Station No.:2H)
CPU C24
Target device
Õ
(Station No.:1DH)
Target device
(Station No.:1EH)
Õ
(Station No.:15H)
CPU C24
20
Target device that obtained the line ownership
The above C24 includes Q series C24, L series C24, QC24(N), and UC24.
The slave station that received the permission response performs the processing from after communicating data with the CPU module within the maximum data communication time arranged among the target devices.
The master station that transmitted the permission response and the slave stations that does not obtain line ownership check the line usage time of the slave station that obtained the line ownership, and ignore the received data not addressed to their own station.
If the line usage time exceeds the maximum communication time, each target device performs the processing .
The slave station that has communicated data with the CPU module transmits a communication complete report to the master station after data communications completed. A message structure example is shown in .
Slave stations that do not communicate data with the CPU module check if a communications complete report was transmitted, and do not communicate data with the master station during that time.
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.3 Examples of Procedure for Data Communications with CPU Module
407
The master station that received the communication complete report transmits a response to the slave station that transmitted the communication complete report.
Ex.
Massage of
Ö
*1
*1 Command "ZY" is a communications complete report command for description purpose.
The user should select the communications complete report command.
Target device of slave station to perform the communications complete report (1CH)
(;) (1B) (1C) (ZY) (2) (CC)
3BH 31H 42H 31H 43H 5AH 59H 32H 43H 43H
Master station target device (1BH)
(:) (1B) (1C)
3AH 31H 42H 31H 43H
Massage of ×
After the completion of above, or when the line usage time of the slave station that obtained the line ownership exceeds the maximum data communication time,
• The master station waits for a communication request from a slave station.
When the master station receives a communication request, it performs processing from .
• The slave stations do not communicate data with the master station until data communication with the CPU module is required.
When data communications with the CPU module is required, they perform the processing from .
When the master station itself communicates data with the CPU module, it transmits all devices excluding the CPU module station a general report data and obtains the line ownership before communicating data with the CPU module while slave stations do not have the line ownership.
After data communications with the CPU module were completed, the master station transmits general report data to inform the slave stations that data communications with the CPU module are completed.
During this time, the slave stations do not communicate data with the master station until master station data communications have been completed.
Ex.
*1 *2
Target device of master station that obtained the line ownership (1BH)
(;) (1F) (1B) (ZX) (0) (07)
3BH 31H 46H 31H 42H 5AH 58H 30H 30H 37H
*1 *2
*1
*2
Station No. for all target devices general report.
Commands "ZX" and "ZY" are commands for description purposes.
The user should select the command when the master station communicates data with slave stations.
Target device of master station that transmits communications complete report
(1BH) (;) (1F) (1B) (ZY) (0) (08)
3BH 31H 46H 31H 42H 5AH 59H 30H 30H 38H
408
20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
20.3 Examples of Procedure for Data Communications with CPU Module
21
SWITCHING THE MODE AFTER STARTING
This function forcefully switches the current communication protocol and transmission specifications of a designated interface from a target device and by program after C24 starts up.
C24 starts operating with the setting values in "Module Parameter" of Engineering tool at the time of the startup.
This function is used to change the communication protocol and transmission specification of the designated interface and continue data communications without restarting the CPU module. For mode switching by using the dedicated instruction (UINI instruction) or the module FB (InitialUnit instruction), refer to the following section.
Page 580 Dedicated Instructions
MELSEC iQ-R Serial Communication Module Function Block Reference
Mode switching from target device
• Mode switching can be performed when the communication protocol of an interface connected to the target device is the
MC protocol.
• The communication protocol can be changed from the MC protocol as shown below.
MC protocol
(Formats 1 to 5)
(Format switching)
MC protocol
(Formats 1 to 5)
Nonprocedural protocol
Bidirectional protocol
Predefined protocol
21
MELSOFT connection
• The transmission specifications set with the parameter setting of Engineering tool can be changed.
• When switching the mode to MODBUS (slave function), use a C24 the firmware version of which is '13' or later.
• The mode cannot be switched to the simple CPU communication.
21 SWITCHING THE MODE AFTER STARTING
409
Mode switching by program
• Regardless of the current communication protocol of an interface connected to the target device, mode switching can be performed by program.
• The communication protocol can be changed by program as shown below.
Current communication protocol Communication protocol after switching
MC protocol
(Formats 1 to 5)
(Format switching)
MC protocol
(Formats 1 to 5)
Nonprocedural protocol
Bidirectional protocol
Predefined protocol
MODBUS slave (RTU/ASCII)
Nonprocedural protocol
Bidirectional protocol
Predefined protocol
MODBUS slave (RTU/ASCII)
MELSOFT connection *1 MELSOFT connection *1
*1 Change from MELSOFT connection to MELSOFT connection is not available.
• The transmission specifications set with the parameter setting of Engineering tool can be changed.
• The mode cannot be switched from/to the simple CPU communication.
When using the mode switching function, set "Setting change" of the Engineering tool parameter settings (by selecting [Basic settings] [Various control specification] [Transmission Setting]) to "Enable".
410
21 SWITCHING THE MODE AFTER STARTING
21.1
Mode Switching Operation and Contents that can be Changed
This section describes the settings that can be changed with the mode switching function and the operation of C24 after mode switching.
Settings that can be changed with mode switching
The settings that can be changed with mode switching are as shown below.
Switching the communication protocol
• The communication protocol setting of each interface can be switched.
• The communication protocol after mode switching is specified with the 'Switching mode No. designation' (Un\G144/304) in the area for designation of mode switching on the buffer memory.
Switching the transmission specifications
• The transmission setting of each interface can be switched.
• The transmission setting after mode switching is specified with the 'Transmission specifications after switching designation'
(Un\G145/305) in the area for designation of mode switching on the buffer memory.
21
With the mode switching function, the settings corresponding to "Communication protocol setting" and
"Transmission setting" in the parameter settings of Engineering tool can be changed.
Operation for mode switching
The following describes C24 operation for mode switching.
Processing currently in execution
• When a mode switching request is issued, the mode switching process starts immediately.
• If any of the following processing is performed when a mode switching request is issued, the processing will be terminated.
Processing in execution Operation for mode switching
Data communication using the MC protocol • Receiving command messages and sending response messages or on-demand data are all terminated.
• The transmission completion signal for a transmission request of on-demand data does not turn ON.
Data communication using the nonprocedural protocol, bidirectional protocol, and predefined protocol
Data communication using the MODBUS slave function
• Transmission processing and reception processing are all terminated.
• All input signals from a CPU module related to transmission processing and reception processing turn OFF.
• While received data from the target device was being stored to C24, the received data up to that point is ignored and the data is processed with the current receive data quantity treated as "0".
Receiving command messages and sending response messages are all terminated.
Modification of buffer memory stored value
• Special applications area (Un\G594 to 595, Un\G610 to 611)
The communication protocol status and transmission specifications after mode switching has been completed are stored.
The values stored to areas other than the above are not changed. The contents before mode switching are preserved.
• User setting area (Un\G1024 to 6911, Un\G9728 to 16383)
The stored values are not changed. The contents before mode switching are preserved.
• User setting area for MODBUS (Un\G49152 to 53247)
The stored values are not changed. The contents before mode switching are preserved.
21 SWITCHING THE MODE AFTER STARTING
21.1 Mode Switching Operation and Contents that can be Changed
411
21.2
Considerations for Mode Switching
Modification of buffer memory stored value
Determine the following items between the target device and the CPU module to prevent mode switching during data communications.
• How to perform mode switching - from the target device or by program
• Timing for each mode switching pattern (
Page 411 Operation for mode switching)
• Interlocking of all connected devices for mode switching
Method to configure interlock when informing all of the connected stations the mode switching execution
Method and message structure when informing all of the connected stations the mode switching completion
Device number and meaning of the value when a CPU module word device is used
Transmission specifications for each communication protocol
The transmission specifications must be changed depending on the communication protocol when switching the mode.
For the transmission specifications for each communication protocol, refer to the following section.
Page 456 Various control specification
Mode switching from target device
• Once the mode has been switched to a mode other than MC protocol (Formats 1 to 5), it cannot be changed from the target device.
In this case, switch the mode by program.
• Mode switching from the target device can be performed to only C24 connected to a target device (including connected stations by multidrop connection).
It is not available for C24s on the other stations via network system. ( MELSEC Communication Protocol Reference
Manual)
It is recommended to perform mode switching by program.
Mode switching of the MODBUS slave function
When switching the mode to the MODBUS slave, set values for the following buffer memories in advance.
• MODBUS device assignment parameter (Un\G30976 to 31359)
• Setting area for MODBUS (Un\G28680 to 28689)
When using a C24 the firmware version of which is '12' or earlier, mode switching to/from the MODBUS slave can be performed only by using I/O signals for handshake with a CPU module.
■
Switching by using the dedicated instruction or MC protocol
When switching the mode by using the dedicated instruction (UINI) or MC protocol, use a C24 the firmware version of which is
'13' or later.
Data communications after mode switching
While the mode switching is being executed, data communications between C24 and the target device cannot be performed, including the processing time to store the setting value to the special applications area on the buffer memory.
Mode switching processing
Mode switching in progress signal
X6/XD
Mode switching related to interlink operation
Do not switch the mode when the two interfaces of C24 are in the interlink operation. Also, do not switch the mode for the interlink operation.
412
21 SWITCHING THE MODE AFTER STARTING
21.2 Considerations for Mode Switching
21.3
I/O Signals for Handshake with CPU Module and
Buffer Memory
This section explains the I/O signals for handshake and the buffer memories used when mode switching is performed.
I/O signals for handshake with CPU module
Type
Mode switching
I/O signal
CH1
X6
Y2
CH2
XD
Y9
Signal name
Switching mode
Mode switching request
Device turned ON/
OFF
C24
CPU
Timing
X6/XD
Y2/Y9
(Switching)
Complete
The following signals can also be used as I/O signals, in addition to the above.
• Module READY signal (X1E): Turns ON when C24 can be accessed from the CPU module.
• Watchdog timer error signal (X(n+1)F): Turns ON when C24 does not operate normally.
• 'CH1 Error occurrence' (XE): Turns ON when error occurred on the CH1 side.
• 'CH2 Error occurrence' (XF): Turns ON when error occurred on the CH2 side.
For details on the CPU module I/O signals, refer to the following section.
(
Page 545 Input/Output Signal List)
Buffer memory
Address (DEC
(HEX))
Name
CH1 CH2
144 (90H) 304 (130H) For designation of mode switching
145 (91H) 305 (131H)
Switching mode No. designation (
413 Switching mode No. designation
Transmission specifications after switching designation(
Page 414 Transmission specifications after switching designation
Parameter setting error and mode switching error status
Setting value/Stored value
0001H: MC protocol (Format 1) to
00FFH: MELSOFT connection
0000H : Match the setting in MELSOFT.
8000H to 8FFFH: Match the setting to that of this area
515 (203H) For confirmation of parameter setting and mode switching
0: No error
Other than 0: Parameter setting error, mode switching error
(
■
Switching mode No. designation (Un\G144/304)
Designate a mode number after mode switching.
• 0000H (default): Match the setting in MELSOFT.
• 0001H: MC protocol (format 1)
• 0002H: MC protocol (format 2)
• 0003H: MC protocol (format 3)
• 0004H: MC protocol (format 4)
• 0005H: MC protocol (format 5)
• 0006H: Nonprocedural protocol
• 0007H: Bidirectional protocol
• 0009H: Predefined protocol
• 000AH: MODBUS slave (RTU)
• 000BH: MODBUS slave (ASCII)
• 00FFH: MELSOFT connection
*1
*1 Specify "00H" for the communication protocol setting when specifying the MELSOFT connection mode with the parameter settings of
Engineering tool.
21 SWITCHING THE MODE AFTER STARTING
21.3 I/O Signals for Handshake with CPU Module and Buffer Memory
413
21
■
Transmission specifications after switching designation (Un\G145/305)
Specify the transmission specifications after mode switching.
Write "0000H" when returning to the settings configured with Engineering tool.
When setting arbitrary transmission specifications (other than the transmission specification set with Engineering tool), write the value corresponding to ON/OFF of the relevant bit. The relevant bit 1 (ON)/0 (OFF) is specified as the same as the transmission setting of Engineering tool.
• For C24
15 to b8 b7 b6 b5 b4 b3 b2 b1 b0
0
CH1 side *1
CH2 side *1
Bit b0 b1 b2 b3 b4 b5 b6 b7
Description
Operation setting
Data bit
Parity bit
Odd/Even parity
Stop bit
Sum check code
Online change
Setting modifications
Description Bit b8 to b15
Communication rate
OFF(0)
Independent
7
No
Odd
1
None
Disable
Disable
Set value
ON(1)
Link
8
Yes
Even
2
Exist
Enable
Enable
Remarks
Be sure to set the CH1 side to OFF(0).
Parity bit is not included.
Vertical parity
Valid only when parity bit is set to Exist.
Refer to *2
Remarks
*1 On the side of interface to which "MELSOFT connection" is set for the switching mode No. designation, set all items to the OFF side.
C24 operates with the setting values set with Engineering tool.
Transmission setting
Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Engineering tool side setting
Independent
8
Yes
Odd
1
Yes
Enable
Enable
*2 It indicates the setting value for the communication speed.
Set "80H" to the interface to which "MELSOFT connection" is set for the switching mode No. designation. The communication speed set on the Engineering tool side is applied.
Communication speed
(units: bps)
1200
2400
4800
9600
14400
Bit position b15 to b8
82H
83H
84H
85H
86H
Communication speed
(units: bps)
-
38400
57600
115200
230400
Bit position b15 to b8
-
89H
8AH
8BH
8CH
Remarks
Decrease the communication speed when data cannot be communicated normally due to overrun error, framing error, etc. in communication with the target device.
Precautions
The following I/O signals for handshake and buffer memories need to be considered on the CPU module side at the time of mode switching from the target device.
• 'CH switching mode' (X6/XD)
• 'Parameter setting error, mode switching error status' (Un\G515)
414
21 SWITCHING THE MODE AFTER STARTING
21.3 I/O Signals for Handshake with CPU Module and Buffer Memory
21.4
Mode Switching Method by Program
This section shows how to switch the C24 mode by program.
Mode switching procedure
The procedures for switching C24 mode by program are as shown below.
*1
Mode switching request Y2/Y9
Mode switching in progress X6/XD
Module READY X1E
Mode switching area
(Un\G144 to 145/304 to 305)
Parameter setting error, mode switching error storage area (Un\G515)
Buffer memory special applications area
Data communications initialization setting area
Un\G147 to 292/307 to 452
TO
*2
FROM
(Only when normal)
TO
Default value change
(Performed only when necessary)
Data communications impossible
*3
Data communications possible
Data communications possible
*1 Inform in advance all the connected device that data communications cannot be performed due to mode switching.
*2 When an error occurs after checking 'Parameter setting error, mode switching error status' (Un\G515), take the corresponding actions.
(
Checking of mode switching designation contents for buffer memory mode switching area and writing of mode switching designation contents within the range that can be designated
Re-execution of mode switching
*3 After confirming that mode switching was completed normally, inform all the connected devices that data communications are possible, and restart data communications.
To check C24 mode (communication protocol, transmission specifications) after mode switching, read the buffer memory (Un\G594 to
595/610 to 611). (
Page 489 Current operation status reading method)
21
21 SWITCHING THE MODE AFTER STARTING
21.4 Mode Switching Method by Program
415
■
Program example
The following shows an example of program for mode switching of the CH1 side interface.
Category
Module label
Label name
C24_1
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.stnCH1.bSts_ModeSwitchingProcessing
C24_1.stnCH1.bSet_Req_ModeSwitching
C24_1.stnCH1.uSet_SwitchingModeNum
C24_1.uSts_ModeSwitching_ParameterSetting_D
Description
Target module
CH1 Reception data read request
CH1 Reception abnormal detection
CH1 Switching mode
CH1 Mode switching request
CH1_Switching mode No. designation
Parameter setting error, mode switching error status
Label to be defined Define the global label as shown below.
Device
X3
X4
X6
Y2
U0\G144
U0\G515
(0)
(17)
(28)
(31)
Change the operation mode to MC protocol format 1.
Set the transmission specifications.
Write the mode switching designation contents to the buffer memory.
Set the mode switching request.
Reset the mode switching request signal.
Read the mode switching request contents.
Mode switching completes.
Change the setting value of the communication protocol according to the communication specification.
Mode switching complete reset
Clear the mode switching request with the clear direction.
416
21 SWITCHING THE MODE AFTER STARTING
21.4 Mode Switching Method by Program
21.5
How to Switch Mode from Target Device
This section shows how to switch the C24 mode from the target device.
Mode switching procedure
The procedures for switching C24 mode from the target device.
Target device
*1 Mode switching command message
*For the message format, refer to the MELSEC Communication Protocol Reference Manual.
CPU module
Mode switching response message
Mode switching in progress X6/XD
*2
CH ERR. communication error XE/XF
Module READY X1E
Parameter setting error, mode switching error storage area (Un\G515)
Buffer memory special applications area
Data communications initialization setting area
Un\G147 to 292/307 to 452
*3
FROM
*3
(Only when normal)
TO
Default value modification
(Performed only when necessary)
Data communications impossible
*4
Data communications possible
Data communications possible
*1 Inform in advance all the connected device that data communications cannot be performed due to mode switching.
*2 When 'CH Error occurrence' (XE, XF) turns ON, check the error contents and take the corresponding actions. (
Checking of mode switching designation contents for buffer memory mode switching area and writing of mode switching designation contents within the range that can be designated
Re-execution of mode switching
*3 When mode switching is performed from the target device, perform the read/write operation from/to the special applications area on the buffer memory shown below from the CPU module after mode switching is completed.
'Parameter setting error, mode switching error status' (Un\G515)
Initial setting areas for data communication (Un\G147 to 289/307 to 449) (
Page 550 Buffer memory list)
*4 After confirming that mode switching was completed normally, inform all the connected devices that data communications are possible, and restart data communications.
To check C24 mode (communication protocol, transmission specifications) after mode switching, read the buffer memory (Un\G594 to 595/610 to 611). (Read the buffer memory with the MC protocol buffer memory read function when checking by the target device.) ( MELSEC Communication Protocol Reference
Manual)
21
21 SWITCHING THE MODE AFTER STARTING
21.5 How to Switch Mode from Target Device
417
■
Program example
The following shows an example of program on the CPU module side for mode switching of the CH1 side interface from the target device.
Category
Module label
Label name
C24_1
C24_1.stnCH1.bSts_ModeSwitchingProcessing
C24_1.uSts_ModeSwitching_ParameterSetting_D
Description
Target module
CH1 Switching mode
Parameter setting error, mode switching error status
Device
X6
U0/G515
Label to be defined Define the global label as shown below.
(0)
(10)
Read the mode switching request contents.
Mode switching is completed.
Change the setting value of the communication protocol according to the communication specification.
Mode switching complete reset
418
21 SWITCHING THE MODE AFTER STARTING
21.5 How to Switch Mode from Target Device
22
USING SEND/RECEIVE DATA MONITORING
FUNCTION
The following describes C24 send/receive data monitoring function.
22.1
Send/receive Data Monitoring Function
Overview
The send/receive data monitoring function is a function to monitor send/receive data between the C24 and a target device on communication lines.
The system startup phase can be shortened by analyzing the send/receive data on the communication lines when debugging the program.
The two methods below are available for the send/receive data monitoring method.
This chapter explains the send/receive data monitoring by the program.
Send/receive data monitoring by program
Monitoring is performed by writing the monitor start instruction to the send/receive data monitoring designation area of the buffer memory.
Send/receive data monitoring by Engineering tool
Monitoring (circuit trace) is performed by using the circuit trace function of Engineering tool (
22
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.1 Send/receive Data Monitoring Function
419
Send/receive data monitoring operation
The following describes the send/receive data monitoring operation.
• When using the send/receive data monitoring function, the total transmission speed of the two interfaces should not exceed 230400 bps.
Start monitoring
• Write the monitor start instruction "0001H" to the send/receive data monitoring designation (Un\G8216/8472). (Set by user)
• By the monitor start instruction, the monitor data pointer/monitor data size area are cleared to '0' and "0002H" is written in the send/receive data monitoring designation area to start monitoring. (Set by C24)
Monitor data area (Un\G9730 to 13055/13058 to 16383 (default)) is not cleared to '0'.
• When a monitor setting error occurs, "100FH" is written to the send/receive data monitoring designation area. (Set by C24)
Review the monitor buffer start address and the monitor buffer size setting range and perform monitoring again.
During monitoring
• Once monitoring starts, data of reception, transmission, data reception error, and signal change are stored from the start address of the monitor data area in the order of occurrence.
• When the monitored data exceeds the monitor data area size, monitoring is continued by writing new data over the oldest data.
However, monitoring may automatically stop according to the settings of the 'Monitor option specification' (Un\G8217/
8473). (
Page 423 Monitor option specification (Un\G8217/8473))
(CH1 side)
Un\G9728
Un\G9729
Un\G9730
Un\G9731
Un\G9732
Un\G9733
Un\G9734
Buffer memory
0003H
0CFEH
Oldest data
+0
+1
+2
+3
Monitor data pointer storage area
Monitor data count storage area
Monitor data area to
Un\G13055
(Default value)
• Each data is stored in the monitor data area at the timing shown below.
Data classification
Receive data
Send data
Reception error data
RS-232 line RS (RTS), ER (DTR) signals
CS (CTS), DR (DSR), CD (DCD) signals
Data storage timing
When data is received
When data is transmitted
When a reception error is detected
When the RS (RTS), ER (DTR) signals change
When signal changes are detected during the periodic processing (operation interval: 1 to 19 ms) and at the each timing described above (Monitoring is not performed to changes during the periodic processing)
420
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.1 Send/receive Data Monitoring Function
Stop monitoring
Monitoring stops when any of the following conditions is satisfied.
• For monitor stop by user instructions
Monitoring stops when "0000H" is written in the send/receive data monitoring designation area of the buffer memory. (Set by user)
• For monitor stop by the system when the monitor data area is full.
The stop at buffer full specification (bit 0) of the monitor option specification area of the buffer memory is set to "ON".
When the monitor data area is full (monitor buffer size), monitoring is automatically stopped and "1002H" is written in the send/receive data monitoring designation area. (Set by C24)
• For monitor stop by the system when the timer 0 error occurs
The 0 timer error outbreak stop designation (bit 2) of the monitor option specification area of the buffer memory is set to
"ON".
When the timer 0 error (error code 7F40H) occurs, monitoring is automatically stopped and "1002H" is written in the send/ receive data monitoring designation area. (Set by C24)
Part of the data immediately after the occurrence of a timer 0 error may be entered in the monitor data area.
22
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.1 Send/receive Data Monitoring Function
421
22.2
Send/receive Data Monitoring Function Settings
This section explains how to configure the settings for the send/receive data monitoring function.
The settings are configured with Engineering tool or by program.
Setting with Engineering tool
The setting items for the send/receive data monitoring function are listed below.
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
■
Parameter settings
Parameter setting item
Basic settings
Various control specificati on
Send/receive data monitoring function specification
Description
Send/receive data monitoring function specification
Select "monitor start instruction" for constant monitoring.
Stop at buffer full specification Select "ON" to stop monitoring when the monitor data area is full.
0 timer error outbreak stop designation Select "ON" to stop monitoring when a timer 0 error occurs.
Monitor buffer start address designation
Monitor buffer size designation
Designate the value to change the monitor buffer address. (Default:
2600H/3300H)
Designate the value to change the monitor buffer size (Default: 0D00H)
422
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.2 Send/receive Data Monitoring Function Settings
Buffer memory for send/receive data monitoring function
Send/receive data monitoring designation (Un\G8216/8472)
Designate the start/stop of the send/receive data monitoring function.
For details on the send/receive data monitoring designation operation, refer to the following section.
Page 420 Send/receive data monitoring operation
Buffer memory address Un\G8216/8472 b15 to b0
(Default: 0000H)
Set the monitor start/stop.
0000H: No monitor/Monitor stop
0001H: Monitor start
0002H: Monitoring (Set by C24)
1002H: Monitor stop (Set by C24)
100FH: Monitor setting error (Set by C24)
Monitor option specification (Un\G8217/8473)
Designate the options of the send/receive data monitoring function.
Buffer memory address Un\G8217/8473 b15 to
0 b3 b2 b1
1/0 0 b0
1/0 (Default: 0000H)
Stop by buffer full
0H: OFF
1H: ON
Stop by timer 0 error
0H: OFF
1H: ON
■
Stop at buffer full specification (bit 0)
• When the stop at buffer full specification is OFF
When the monitored data exceeds the monitor data area size, monitoring is continued by writing new data over the oldest data.
• When stop at buffer full specification is ON
When the monitor data area is full (monitor buffer size), monitoring is automatically stopped and "1002H" is written in the send/receive data monitoring designation area. (Set by C24)
■
0 timer error outbreak stop designation (bit 2)
• When the o timer error outbreak stop designation is OFF
Monitoring continues even if the timer 0 error (error code 7F40H) occurs.
• When the 0 timer error outbreak stop designation is ON
When the timer 0 error (error code 7F40H) occurs, monitoring is automatically stopped and "1002H" is written in the send/ receive data monitoring designation area. (Set by C24)
Monitor buffer start address designation (Un\G8218/8474)
Designate the start address of the storage area (monitor data area) for the monitored data within the range of the user setting area of the buffer memory.
Setting range: 0400H to 1AFDH, 2600H to 3FFDH (Default: 9728/13056 (2600H/3300H))
Monitor buffer size designation (Un\G8219/8475)
Designate the size of the monitor data area.
Setting range: 0003H to 1A00H (Default: 0D00H)
22
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.2 Send/receive Data Monitoring Function Settings
423
Monitor data pointer storage area (Un\G9728/13056 (default))
■
The oldest data position of the monitor data area is stored using the offset value from the start address of the monitor data area.
0 to (monitor buffer size designation (default: 0D00H) - 3): the oldest data position
■
When the monitored data exceeds the monitor buffer size, the new data is written over the oldest data. (Ring buffer type)
The oldest data position of the monitor data area can be confirmed from this area.
Ex.
"Un\G9745" becomes the oldest data when "000FH" is the monitor data pointer using "Un\G9730" as the start address of the monitor data area.
+7
+8
+9
+A
+B
+C
+D
+E
+F
+0
+1
+2
+3
+4
+5
+6
Monitor data quantity storage area (Un\G9729/13057(default))
The number of monitor data stored in the monitor data area is stored.
0 to (monitor buffer size designation (default: 0D00H) - 2): number of monitor data
Monitor data pointer storage area
Monitor data size storage area
Oldest data in the monitor data area
424
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.2 Send/receive Data Monitoring Function Settings
Monitor data area (Un\G9730 to 13055/13058 to 16383(default))
The monitor data is stored in one-word units in the configuration below.
For an example of the send/receive data monitoring, refer to the following section.
Page 426 Send/receive Data Monitoring Example
b15 b14 b13 b12
0 0 0 0 b11 b10 b9 b8
CD
(DCD)
CS
(CTS)
DR
(DSR) b7 b6 b5 b4 b3 b2 b1 b0
Received data When receiving data
0
0
0
0
0
0
0
1
0
1
1
0
1
0
1
0
CD
(DCD)
CS
(CTS)
DR
(DSR)
CD
(DCD)
CS
(CTS)
DR
(DSR)
CD
(DCD)
CS
(CTS)
DR
(DSR)
CD
(DCD)
CS
(CTS)
DR
(DSR)
Transmitted data
0
0
0
When transmitting data
FE
RS
(RTS)
ER
(DTR)
When the RS(RTS)/ER(DTR) signal is changed
OVR PE When a reception error occurs
(*1)
When detecting a CD(DCD) to
DR(DSR) signal change
Data classification (b12 to b15)
0: When receiving data
Signal condition (b8 to b11)
* System area
1: When transmitting data
2: When the RS(RTS)/ER(DTR)signal is changed
3: When a reception error occurs
4: When detecting a CD(DCD) to DR(DSR)signal change
*1 FE : Framing error
OVR : Overrun error
PE : Parity error
22
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.2 Send/receive Data Monitoring Function Settings
425
22.3
Send/receive Data Monitoring Example
The following shows an example of the send/receive data monitoring for communication using the nonprocedural protocol.
System configuration
The system configuration for the program example is as shown below.
The CH used for operation of this sample program is CH1 only.
CH1: Transmission channel
CH2: Reception channel
Engineering tool RJ71C24
Program example for send/receive data monitoring
■
Parameter settings
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
■
Program example
Category
Module label
Label name
C24_1
C24_1.stnCH1.uSet_DataMonitoring_D
C24_1.stnCH1.uSet_MonitoringDataOptional_D
Label to be defined Define the global label as shown below.
Description
Target module
CH1_Send/receive data monitoring designation
CH1_Monitor option specification
Setting content
CH1
Nonprocedural protocol
19200 bps
Independent
8
None
Odd
1
None
Enable
Enable
0
CH2
CH2: Not used
Device
U0\G8216
U0\G8217
426
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.3 Send/receive Data Monitoring Example
(9)
(24)
(46)
(52)
(61)
Clear the monitor data area to '0'.
During monitor start instruction
During monitoring (002H)
Monitor setting error (100FH)
During monitor stop (1002H)
During monitor stop instruction
Monitor stopped (0000H)
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.3 Send/receive Data Monitoring Example
427
22
Confirming monitor data with Engineering tool
Monitor the monitor data area on the CH1 side (Un\G9730 to 13055) with the Device/Buffer Memory Batch Monitor function of
Engineering tool.
For the data configuration of the monitor data area, refer to the following section.
Page 425 Monitor data area (Un\G9730 to 13055/13058 to 16383(default))
Ex.
Monitoring example when the following data is transmitted from CH1 for data communication using the nonprocedural protocol.
Send data; "ABCDEFGH" + 0D0AH (5-word) b15 b14 b13 b12 b11 b10 b9
0 0 0 1 0 0 1 b8
1 b7
0 b6
1 b5 b4
0 0 b3
0 b2
0 b1 b0
0 1 When transmitting data
* System area
* CD CS DR
(DCD) (CTS) (DSR)
Transmission data
428
22 USING SEND/RECEIVE DATA MONITORING FUNCTION
22.3 Send/receive Data Monitoring Example
23
INDEPENDENT/LINKED OPERATION OF
INTERFACE
This chapter explains the independent/linked operation of C24.
23.1
Setting and Data Flow of Independent Operation
Setting
For the independent operation of two interfaces on C24, configure the parameter setting as shown below.
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Setting content
CH1
Set according to the target device.
Independent
Set according to the target device.
CH2
Set according to the target device.
Independent
Set according to the target device.
Set arbitrary value for data communication using the MC protocol or for multidrop connection when MELSOFT connection is selected.
Data flow in independent operation
Two interfaces operate independently according to the settings in the parameter settings "Basic Settings".
C24 (data flow in independent operation)
CH1
CH2
Transmits only to a designated
CH side.
CH1
CH2
23
23 INDEPENDENT/LINKED OPERATION OF INTERFACE
23.1 Setting and Data Flow of Independent Operation
429
23.2
Setting and Data Flow of Interlink Operation
During the interlink operation, all data received from either one of the two interfaces is transmitted to the other interface.
When two interfaces are in the interlink operation, the transmission time for one character becomes equal to the H/W gate OFF time.
Setting
For the interlink operation of two interfaces on C24, configure the parameter setting as shown below.
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Setting content
CH1
Set according to the target device.
Communication speed setting
Independent
Set CH1 and CH2 to the same specifications.
CH2
The setting is configured automatically. (No changing necessary)
Set according to the target device.
Interlink
Set CH1 and CH2 to the same specifications.
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
MODBUS station number setting
Set arbitrary value for data communication using the MC protocol or for multidrop connection when MELSOFT connection is selected.
1 to 247 The setting is configured automatically. (Same value as CH1)
Data flow in interlink operation
The two interfaces operate interconnectedly using the functions configured in "Communication protocol setting" from "Basic
Settings" "CH2 side" in the module parameter (MC protocol (same format), MODBUS slave (RTU), MODBUS slave
(ASCII), or nonprocedural protocol) within the transmission specifications set in the respective transmission settings.
C24 (data flow in linked operation)
CH1 CH1
CH2 CH2
Transmits only to a designated
CH side.
CH1
CH2
430
23 INDEPENDENT/LINKED OPERATION OF INTERFACE
23.2 Setting and Data Flow of Interlink Operation
Precautions
■
When setting to nonprocedural protocol
Exclusive control of the received data is necessary when data is communicated using the nonprocedural protocol since all of the connected stations receive the data.
■
When setting to MC protocol
When data communication is performed using the MC protocol, only the C24, of which station number is specified in the massage, performs the process designated by the command.
Furthermore, when data communication is performed with 2C/3C/4C frame of the MC protocol, the header information for interlink operation is added to messages directed to other stations linked by multidrop connection.
● Processing performed by C24 connected to a target device
• C24 adds the header information to the command massages directed to other stations, which was received from the target device, and transmits them to the other stations through the other interface.
• C24 deletes the header information from the response messages received from the other stations, and transmits them to the target device through the other interface. (The header information is also sent during the multidrop connection using the interlink operation setting.)
● Operation of the accessed station
• The accessed station processes the request contained in a command message, adds the header information to a response message, and sends it using the interface that received the command message.
The header information for the interlink operation, which is added by C24 to a message is as shown below.
• When communicating with ASCII code (Formats 1 to 4)
The following 13- or 15-character header information is added immediately before the control code (ENQ/
STX/ACK/NAK) at the head of each message (13 characters for Formats 1, 3 and 4; 15 characters for
Format 2).
• When communicating in binary mode (Format 5)
The following 10-byte header information is added immediately before the control code (DLE + STX) at the head of each message.
"STX" in Format 3
(In ASCII code communication)
Existence in Format 2
(In binary code communication)
E
N
Q
E
N
Q
D
E
L
S
T
X
D
E
L
S
T
X
23
H L H L H L H L H L H L
Header information (13/15 characters)
H L H L L H L H
Header information (10 byte)
L H
23 INDEPENDENT/LINKED OPERATION OF INTERFACE
23.2 Setting and Data Flow of Interlink Operation
431
■
When performing the interlink operation on a MODBUS slave
• For the interlink operation of a MODBUS slave, use a C24 the firmware version of which is '13' or later.
• A MODBUS master device cannot be connected to CH2 of a C24 when performing the interlink operation. Connect it to
CH1.
• When a request message to a C24 is received from a MODBUS master, the C24 does not relay the request message to
CH2 and sends a response message as a MODBUS slave.
(2)
(1) CPU RJ71C24
CH1
(2) (2)
Request message
Response message
(1) MODBUS master
(2) MODBUS slave
• When a request message to a slave station other than a C24 is received from a MODBUS master, the C24 sends and receives the message via CH1 and CH2.
(2)
(1) CPU RJ71C24
CH1
(2) (2)
Request message
Response message
(1) MODBUS master
(2) MODBUS slave
Do not use the above settings for the following cases because the interlink operation cannot be performed.
• When using RJ71C24-R2.
• When a target device is not connected to either of the interfaces.
• When communicating data using the predefined or bidirectional protocol.
• When communicating data using the modem function.
432
23 INDEPENDENT/LINKED OPERATION OF INTERFACE
23.2 Setting and Data Flow of Interlink Operation
Setting example for MELSOFT connection via C24
Examples of the parameter settings for MELSOFT connection via C24 are as shown below.
RS-232 RS-485
Station 0
• Setting at station No.0
Setting item
Station 1
Basic settings
Transmission setting
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
• Setting at station No.1
Setting item
Basic settings
Transmission setting
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Setting content
CH1
MELSOFT Connection
115200 bps
Independent
8
Yes
Odd
1
Yes
Enable
Enable
0
CH2
115200 bps
Interlink
8
Yes
Odd
1
Yes
Enable
Enable
Setting content
CH1
Set depending on the use
CH2
Yes
Odd
1
Yes
MC protocol (format 5)
115200 bps
Independent
8
Enable
Enable
1
23
23 INDEPENDENT/LINKED OPERATION OF INTERFACE
23.2 Setting and Data Flow of Interlink Operation
433
24
PARAMETER REGISTRATION TO CPU
MODULE
C24 enables the parameter settings to be saved in the CPU module.
It reduces man-hours for any recovery works since the parameter resetting is not necessary at the time of replacement of
C24.
The parameters controlled by the CPU module are as shown below.
Parameters name Storage location of parameters File name
Module parameter
Module extended parameter
CPU built-in memory (data memory)
Select from the following for each file.
• CPU built-in memory (data memory)
• SD memory card installed in the CPU
• Built-in memory of Intelligent function module (in the flash ROM of C24)
UNIT.PRM
*1 It indicates a file name to store the parameters in CPU built-in memory or SD memory card.
*2 To mount C24 on the redundant extension base unit in the redundant system, store module extended parameters to the built-in memory of intelligent function module (in the flash ROM of C24).
*3 The value indicating the head input/output number of the module 10H (3 digits in hexadecimal) is entered in 'mmm'.
*4 The sequential serial number of each module, 00 is entered in 'nn'.
For more details on parameters controlled by CPU modules, refer to the following manual.
MELSEC iQ-R CPU Module User's Manual (Application)
The parameters controlled by C24 parameter corresponding to CPU module are as shown below.
Parameter of C24 Remarks Corresponding parameter controlled by
CPU module
Module parameter Basic settings Various control specification
Application settings
User frame specification
Modem function setting
"User frame contents" is stored in the module extended parameter.
"Modem initialization data" and "Modem connection data" are stored in the module extended parameters.
Module extended parameter
Programmable controller CPU monitoring function designation
Interrupt settings
MODBUS slave setting
Refresh setting
User frame contents
Modem initialization data
Modem connection data
Simple CPU communication setting
Protocol setting data
File name: UEXmmmnn.PRM
File name: UEXmmm00.PPR
This is set with the Predefined protocol support function of Engineering tool.
Each file of module extended parameters held in the CPU module is given priority over the one in the flash ROM of C24.
The contents in flash ROM of C24 is replaced with the contents of module extended parameters registered in the CPU module by powering OFF ON or switching the CPU module STOP RUN after the module extended parameters were registered in the CPU built-in memory or SD memory card.
434
24 PARAMETER REGISTRATION TO CPU MODULE
Deleting module extended parameters
The following explains how to delete each file of module extended parameters.
■
Deleting module extended parameter "UEXmmmnn.PRM"
It can be deleted by the following procedure.
1.
Place the CPU module in the STOP state.
2.
On the "Module extended parameter setting " screen for RJ71C24(-R2/4) of Engineering tool, restore the default setting value of module extended parameter.
3.
Select [Online] [Write to PLC].
4.
On the "Online Data Operation" screen, select the checkbox of the corresponding Intelligent function module (C24), and perform the write operation. At this point, the content in the flash ROM of C24 is deleted.
5.
On the "Online Data Operation" screen, select the [Delete] tab. When there are module extended parameters on the
CPU module, "Module extended parameter: mmmm
*1
" is displayed on the [Parameter] in the tree. Select the checkbox and perform the delete operation. By performing this operation, the module extended parameter on the CPU module is deleted.
6.
Return the CPU module to the RUN state as necessary.
*1 The 'mmmm' indicates the head input/output number of the module.
■
Deleting module extended parameter "UEXmmm00.PPR"
It can be deleted by the following procedure.
1.
Place the CPU module in the STOP state.
2.
Start the Predefined protocol support function from the [Tool] menu of Engineering tool.
3.
Select [Write to Module] from the [Online] menu without adding protocol.
4.
On the "Module Write" screen, select "Intelligent Function Module" as the target memory, and perform the write operation. At this point, the content in the flash ROM of C24 is deleted.
5.
After the step 4 above, select [Online] [User Data] [Delete] of Engineering tool. The "User Data Operation" screen is displayed.
6.
When there are module extended parameters on the CPU module, user data "UEXmmm00.PPR
*1
" is displayed. Select the checkbox and perform the delete operation. By performing this operation, the module extended parameter on the
CPU module is deleted.
7.
Return the CPU module to the RUN state as necessary.
*1 The value indicating the head input/output number of the module 10H (3 digits in hexadecimal) is entered in 'mmm'.
24
24 PARAMETER REGISTRATION TO CPU MODULE
435
25
RS-422/485 INTERFACE ECHO BACK ENABLE/
PROHIBIT SPECIFICATION
This chapter explains the echo back enable/prohibit specification.
This function can be used for the both interfaces on RJ71C24(-R4).
The echo back function is a function that transmitted data is also sent to RDA or RDB on the host station when data communication is performed through RS-458 (2-wire type) from RS-422/485 interface.
Whether to receive the returned data or not (discard) can be specified.
Data transmission
C24 Target device
SDA SDA
SDB SDB
RDA
RDB
Receives or not receive
(discards) the data.
RDA
RDB
Application
• Disabling the echo back will eliminate the processing to ignore unnecessary data, which has been programmed for nonprocedural protocol communication.
• When the same message format is used for a request (command) and a response of the target device protocol during data communication using the predefined protocol, communication with the target device can be performed by specifying "Echo back enable."
Setting method
• Setting by engineering tool
Set "Echo back enable/prohibit specification" to "Echo back enable" or "Echo back prohibit".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
• Setting by a program
In the 'RS-422/485 interface echo back enable/prohibit specification' (Un\G290/450), store either of the following values.
(Default: 0)
Setting value
0: Echo back enable
1: Echo back prohibit
Description
When C24 transmits data, it also receives the transmitted data with its own RDA or RDB.
When C24 transmits data, it does not receive the transmitted data with its own RDA or RDB. (The data is discarded.)
Precautions
The setting for the echo back enable/prohibit specification must be configured before sending data. Any setting changed during transmission does not take effect.
436
25 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT SPECIFICATION
MEMO
25
25 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT SPECIFICATION
437
26
ERRONEOUS NOISE SIGNAL RECEPTION
PREVENTION FUNCTION
This chapter explains the erroneous noise signal reception prevention function of C24.
26.1
Erroneous Noise Signal Reception Prevention
Function
Depending on the device to be connected to C24, noise signals may be added on the line when turning ON the power or connecting cables of the device.
When noise signals are added, C24 falsely recognizes it has received improper data, and discards the data resulting in abnormal detection.
Using this function avoids erroneous noise signal reception.
This function is set in the module parameter and the 'Communication data reception enable/disable designation' (Un\G292/
452).
Configure the setting to disable the reception with the parameter settings of Engineering tool, and set the buffer memory to
'Receive enable' (0) at a certain time before starting data reception after powering ON.
Set the erroneous reception prevention designation area to disable reception until the serial line is settled.
Set to disable reception with module parameter.
Data is discarded.
Noise generated
Power
ON
Set the erroneous reception prevention designation area to enable reception once the serial line has been settled.
Data is received normally.
438
26 ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION FUNCTION
26.1 Erroneous Noise Signal Reception Prevention Function
26.2
Setting for the Erroneous Noise Signal Reception
Prevention Function
The setting procedure to use the erroneous noise signal reception prevention function is shown below.
1.
Setting to disable the reception with Engineering tool
Set "Communication data reception enable/disable designation" to "Receive disable".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
2.
Setting to enable the reception by a program
Set the following buffer memory to 'Receive enable' (0) with a program at the timing when the serial line is settled.
Channel
CH1
CH2
Address
Un\G292
Un\G452
Setting value
0: Receive enable
1: Receive disable
Precautions
• Once the erroneous reception prevention designation area of noise signal is set to 'Receive disable' (1), normal data is not received as well.
Set the erroneous reception prevention designation area of noise signal to 'Receive enable' (0) promptly after the serial line has been settled.
• Once it is set to 'Receive enable', it cannot be set to 'Receive disable' unless powering ON again or resetting the CPU module.
26
26 ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION FUNCTION
26.2 Setting for the Erroneous Noise Signal Reception Prevention Function
439
27
AUTOMATIC REMOVAL OF NULL
CHARACTERS INCLUDED IN SEND DATA
This chapter explains the automatic removal of NULL characters in data transmission of C24.
27.1
Automatic Removal of NULL Characters during
Data Transmission
The automatic removal of NULL characters during data transmission is a function to automatically delete NULL characters included in data transmitted to a target device from C24.
CPU module C24 Target device
NULL characters automatic deletion disabled
00
H
45
H
44
H
43
H
42
H
41
H
0045
H
4443
H
4241
H
NULL characters automatic deletion enables
45
H
44
H
43
H
42
H
41
H
27.2
Setting for NULL Character Automatic Removal
Function
The setting to C24 is required before data transmission in order to enable the NULL character automatic removal function for data to be transmitted using the nonprocedural protocol and the bidirectional protocol.
The settings to delete NULL characters automatically are shown below.
• The settings for automatic removal of NULL characters can be configured for each interface.
• To perform the NULL characters automatic removal function, set "NULL character automatic removal designation" to "Auto delete enabled".
Navigation window [Parameter] [Module Information] "Module Name" [Module Parameter] "Basic Settings"
"Various control specification"
440
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.1 Automatic Removal of NULL Characters during Data Transmission
27.3
NULL Character Removal to Send Data using
Nonprocedural Protocol
This section explains automatic removal of NULL characters to data to be transmitted using the nonprocedural protocol.
Target range of automatic removal of NULL characters
The send data range to which automatic removal of NULL characters is performed is as shown below:
• Transmitting data in arbitrary format
Target range of NULL characters automatic deletion
27
Arbitrary data
• Transmitting data with user frame
Target range of NULL characters automatic deletion
User frame
(first frame)
Arbitrary data
User frame
(last frame)
When data is transmitted, C24 performs the processing as follows:
C24 deletes NULL characters (data code: 00H) included in the data specified by the CPU module (arbitrary data portion in a transmission message) or a user frame portion, and transmits data.
NULL characters (00H) included in the send data in the buffer memory (send area) are deleted from the actual data to be transmitted.
When transmitting data in arbitrary format Target device
Buffer memory (transmission area)
(H) (L)
Transmission data count
Transmission data
(0004
H
)
00
H
04
H
(3231
H
)
32
H
00
H
31
H
(0033
H
)
33
H
(4241
H
)
42
H
41
H
(0043
H
)
00
H
43
H
(The data count is in word units)
Send
Head data
Arbitrary data
C B A 3 2 1
43
H
42
H
41
H
33
H
32
H
31
H
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.3 NULL Character Removal to Send Data using Nonprocedural Protocol
441
To transmit data without removing NULL characters included in arbitrary user frame portion or the send area on the buffer memory when 0001H (Auto delete enabled) is set for NULL character automatic removal designation for transmitting data for data transmission with a user frame, designate the user frame number as shown below.
• Specify the number obtained by adding 4000H to the registered user frame No.
b15 b14 b13 to b0
Frame No.
0: Conversion enable 1: Conversion disable
0: Frame registered in Flash ROM 1: Frame registered in buffer memory
When sending data in the portions designated in 4001H to 44AFH, C000H to C01FH, the data is transmitted without conversion even when the following designations are enabled.
• Specifying an additional code by the transparent code for sending specification (
• Designating "Enable" in the ASCII-BIN conversion designation area (
Page 379 COMMUNICATING WITH ASCII CODE
User frame number to be transmitted User frame designation number to transmit data without removing NULL characters
(4000H added)
1H to 3E7H (1 to 999)
3E8H to 4AFH (1000 to 1199)
8000H to 801FH (-32768 to -32737)
4001H to 43E7H (16385 to 17383)
43E8H to 44AFH (17384 to 17583)
C000H to C01FH (-16384 to -16353)
442
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.3 NULL Character Removal to Send Data using Nonprocedural Protocol
27.4
Program Example
This examples of data communication using the nonprocedural protocol are shown below.
Program example of data communication using the nonprocedural protocol
This section shows program examples of data communication using the nonprocedural protocol when the settings/ registrations are made with Engineering tool.
Parameter setting
For details for each setting item, refer to the parameters. (
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Setting content
CH1 CH2
Nonprocedural protocol
Set according to the target device
Independent
Set according to the target device
Remarks
CH2 is not used
Applicatio n settings
User frame specification
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Communication control specification NULL character automatic removal designation
Send user frame designation Send frame No. designation (1st)
Send frame No. designation (2nd)
Send frame No. designation (3rd)
Send frame No. designation (4th)
Send frame No. designation (5th)
Auto delete enabled
43F2H
43F3H
C001H
8000H
441BH
Arbitrary registered data
Buffer memory designation
Arbitrary registered data
27
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.4 Program Example
443
Example of arbitrary data transmission
C24 transmits a string data using the NULL character automatic removal function to the target device.
Ex.
Transmitting given data with OUTPUT dedicated instruction
Target device
C24
1 2
(Arbitrary data)
3 A B C
31H 32H 33H 41H 42H 43H
Transmission command
CPU module
X50
Completion device M0
Status display device at completion
M1
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
OUTPUT
ON
ON
1 scan
Abnormal completion
Normal completion
Buffer memory (transmission area)
Transmission data count
Transmission data
(H) (L)
(0004
H
)
00
H
04
H
(3231
H
)
32
H ,
31
H
(0033
H
)
00
H ,
33
H
(4241
H
)
42
H ,
41
H
(0043
H
)
00
H ,
43
H
(The data count is in word units)
Description
Target module
Device
FB M+RJ71C24_Output Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
444
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.4 Program Example
(0)
(65)
(67)
Set the transmission channel to CH1.
Set the send data quantity to 4.
Set the data to be transmitted.
Set the transmission direction.
Normal completion
Abnormal completion
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.4 Program Example
445
27
Example of transmission using user frame
C24 transmits a string data using the NULL character automatic removal function to the target device.
Ex.
Transmitting given data in combination with a user frame with PRR dedicated instruction
Target device
C24
Registration No. of the corresponding user frame
S
T
X
02
H
Q
51
H
0A
H
00
H
; T O T A L ; (Total number)
(012D
H
) 1
Data in transmission area
(arbitrary data portion)
2 3 A B C
E
T
X
3B
H
54
H
4F
H
54
H
41
H
4C
H
3B
H
2D
H
01
H
31
H
32
H
33
H
41
H
42
H
43
H
03
H
A7
H
Corresponds to 3F2H
(for first designated frame)
Corresponds to 3F3H (for second designated frame)
Corresponds to
8001H (for third designated frame)
Corresponds to 8000H
(for fourth designated frame)
Corresponds to 41BH
(for fifth designated frame)
Transmission command
CPU module
X50
Completion device
Status display device at completion
M0
M1
PRR
ON
ON
1 scan
Abnormal completion
Normal completion
User frame being transmitted
For transmit user frame designation
Buffer memory (frame designation)
(Not sent)(Sending)
0H/Other than 0H
(Do not send)
0
H
(1st)
1
H
User frame being transmitted
CR/LF output designation
Output head pointer designation
Output count designation
5
H
Transmission frame no. designation (1st)
43F2
H
(*1)
43F3
H
(*1)
Transmission frame no. designation (2nd)
C001
H
(*1)
Transmission frame no. designation (3rd)
8000
H
Transmission frame no. designation (4th)
Transmission frame no. designation (5th)
441B
H
(*1)
0
H
Transmission frame no. designation (6th)
Transmission data count
Transmission data
(*1): NULL characters deletion is not performed since b14 for transmission frame No. designation is 'ON'.
Buffer memory (transmission area)
(H) (L)
(0004
H
)
00
H
, 04
H
(3231
H
)
32
H , 31 H
(0033
H
)
00
H
, 33
H
(4241
H
)
42
H , 41 H
(0043
H
)
00
H , 43 H
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_SendUserFrame Sends data using the nonprocedural protocol communication and the user frame according to the setting of the user frame specification area for sending data.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
446
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.4 Program Example
(0)
(91)
(93)
Set the transmission channel to CH1.
Set CR/LF to "Do not send".
Set the send pointer to 1.
Set the output quantity to 5.
Set the send data quantity to 4.
Set the data to be transmitted from D11.
Set an arbitrary send data in send buffer.
Set the transmission direction.
Normal completion
Abnormal completion
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.4 Program Example
447
27
27.5
NULL Characters Removal for Send Data using
Bidirectional Protocol
This section explains automatic removal of NULL characters to data to be transmitted using the bidirectional protocol.
Target range of automatic removal of NULL characters
The send data range to which automatic removal of NULL characters is performed is as shown below. However, the automatic removal of NULL characters is not performed when a response message is transmitted.
Target range of NULL characters automatic deletion
Message for data transmission
E
N
Q Data length
(Arbitrary data)
Data portion
Sum check code
*NULL characters automatic deletion is disabled when transmitting a response message.
When data is transmitted, C24 performs the processing as follows:
• Range of automatic removal of NULL characters
C24 performs the automatic removal of NULL characters to an arbitrary data portion of a message (data length is not included).
• Automatic removal of NULL characters in data portion
C24 deletes NULL characters included in send data, and then transmits data.
• Handling of sum check code
The results of adding the data portion after automatic removal of NULL characters as binary code data are added to the transmission message as sum check code.
(When byte units are used)
E
N
Q
Data length
(0003)
Message
Data portion
(*1)
Sum check code
05
H
L H
06
H
00
H
1
31
H
2
32
H
3
33
H
A
41
H
B C
42
H
43
H
L H
62
H
01
H
Sum check code is calculated from the data portion/data length after NULL characters automatic deletion, and added.
Buffer memory (transmission area)
(H) (L)
NULL characters automatic deletion
00
H
(0008
H
)
08
H
32
H
(3231
H
)
31
H
00
H
(0033
H
)
33
H
42
H
(4241
H
)
41
H
00
H
(0043
H
)
43
H
(The data count is in word units)
Transmission data count
Transmission data
Data length after NULL characters automatic deletion is added.
*1 Calculation of sum check code is shown below:
06H+00H+31H+32H+33H+41H+42H+43H=0162H
(H) (L)
Precautions
When the automatic removal of NULL characters is performed to data transmitted using the bidirectional protocol, always specify the "Word/byte units designation" to "Byte units".
448
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.5 NULL Characters Removal for Send Data using Bidirectional Protocol
Ex.
Example of data transmission after automatic removal of NULL characters using the bidirectional protocol
Target device
Head data Arbitrary data (Data transmission)
E
N
Q
Data length
Data portion
Sum check code
Send
L
05
H
06
H
H
00
H
1
31
H
2
32
H
L H
3
33
H
A
41
H
B
42
H
C
43
H
62
H
01
H
N
A
K
Head data
Error code or
A
C
K
(Transmitting a response message)
Send
L H
15
H
34
H
12
H
06
H
C24
Buffer memory (transmission area/reception area)
(H) (L)
NULL characters automatic deletion
00
H
32
H
00
H
42
H
00
H
(0008H)
08
H
(3231H)
31
H
(0033H)
33
H
(4241H)
41
H
(0043H)
43
H
Transmission data count
Transmission data
When normal:000H
When abnormal: 1234H
Reception result
27
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.5 NULL Characters Removal for Send Data using Bidirectional Protocol
449
27.6
Program Example
The examples of data communication using the bidirectional protocol are shown below.
Program example of data communication using the bidirectional protocol
This section shows program examples data communication using the bidirectional protocol when the settings/registrations are made with Engineering tool.
parameter setting
For details for each setting item, refer to the parameters. (
Setting item
Basic settings
Various control specification
Test mode setting
Communication protocol setting
Communication speed setting
Setting content
CH1
Bidirectional protocol
Set according to the target device
Independent
Set according to the target device
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
Communication control specification NULL character automatic removal designation
Word/byte units designation
Auto delete enabled
Byte unit
CH2
CH2 is not used
450
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.6 Program Example
Example of data transmission
C24 transmits a string data using the NULL character automatic removal function to the target device.
Ex.
Transmitting given data with BIDOUT dedicated instruction
A
C
K
Target device
C24
06 H
E
N
Q
Data length
(0006)
Data area Sum check code
L H
05 H 06 H 00 H
1
31 H
2
32 H
3
33 H
A
41 H
B
42 H
L H
C
43 H 62 H 01 H
Transmission command
CPU module
X50
BIDOUT
ON
Completion device M0
Status display device at completion
M1
ON
Abnormal completion
Normal completion
Transmission data
1 scan
D3
D10
D11
D12
D13
(H) (L)
(0008 H )
00 H , 08 H
(3231 H )
32 H , 31 H
(0033 H )
00 H , 33 H
(4241 H )
42 H , 41 H
(0043 H )
00 H , 43 H
Program device memory
(The data count is in byte units)
(H) (L)
(0008 H )
00 H , 08 H
(3231 H )
32 H , 31 H
(0033 H )
00 H , 33 H
(4241 H )
42 H , 41 H
(0043 H )
00 H , 43 H
Buffer memory
(transmission area)
Transmission data count
Transmission data
■
Program example
Category Label name/FB name
Module label C24_1
Label to be defined Define the global label as shown below.
Description
Target module
Device
27
FB M+RJ71C24_BidirectionalOutput Sends data for specified data points.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.6 Program Example
451
(0)
(65)
(67)
Set the transmission channel to CH1.
Set the send data quantity to 8.
Set the data to be transmitted.
Set the transmission direction.
Normal completion
Abnormal completion
452
27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
27.6 Program Example
PART 3 PARAMETER SETTINGS
AND
TROUBLESHOOTING
This part explains parameters and troubleshooting of C24.
453
28
PARAMETER SETTING
This section explains parameter settings necessary for data communication between C24 and a target device.
28.1
Parameter Setting Procedure
This section explains the parameter setting procedure to use RJ71C24.
1.
Add C24 to Engineering tool.
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
2.
Module parameters and module extended parameters are included in parameters. There are four types of module parameters: basic settings, application settings, interrupt settings, and refresh setting, and three types of module extended parameters: user frame contents, modem initialization data, and modem connection data, which are selected from the tree in the screen below.
Navigation window [Parameter] [Module Information] RJ71C24 [Module Parameter]/[Module Extended
Parameter]
3.
Write the settings to the CPU module with Engineering tool after the parameter setting is completed.
[Online] [Write to PLC]
4.
The settings are reflected by resetting the CPU module or turning the power OFF ON.
454
28 PARAMETER SETTING
28.1 Parameter Setting Procedure
28.2
Module Parameters
Set the module parameters. The module parameter includes the following four types: basic settings, application settings, interrupt settings, and refresh setting, which is selected from the tree in the screen below.
Navigation window [Parameters] [Module Information] Module name [Module Parameter]
Basic settings
Configure the settings to operate the basic functions of C24.
Window
28
28 PARAMETER SETTING
28.2 Module Parameters
455
Various control specification
Specify the various controls.
Item
Test mode setting
Communication protocol setting
Communication speed setting
Transmission setting
Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting (CH1, 2 in common: 0 to 31)
MODBUS station number setting
Description
Sets the test mode.
When a problem occurs during data communication with a target device, check whether or not there is any problem in the operation of the C24.
Sets a protocol for communicating with a target device.
Sets a communication rate.
Configures an operation settings of two interfaces.
Sets a bit length for one character in data to be transmitted/received to/from a target device.
Set whether or not a parity bit (vertical parity) is added for one character of data to be transmitted/received.
Sets which parity bit is used, odd parity or even parity, when a parity bit is added.
(This will be enabled only when the parity bit is set to "Yes".)
Sets a stop bit length for one character in data to be transmitted/received to/from a target device.
Sets whether or not a sum check code is added to transmission message and reception message.
Sets whether or not data is written to a CPU module during RUN when writing data from a target device to the CPU module.
Sets whether or not the following processing is allowed after the startup.
• Data communication function of each interface, changing of transmission specification, changing of communication protocol
• Writing data to flash ROM
Sets the host station number during multidrop communication.
Sets the station number of a MODBUS slave station.
Setting range
• No specification (other than test mode)
• Hardware test
• Self-loopback test
(Default: No specification (other than test mode))
• MELSOFT Connection
• MC Protocol (Format 1)
• MC Protocol (Format 2)
• MC Protocol (Format 3)
• MC Protocol (Format 4)
• MC Protocol (Format 5)
• Nonprocedural protocol
• Bidirectional protocol
• Predefined protocol
• MODBUS Slave (RTU)
• MODBUS Slave (ASCII)
• Simple PLC Communication
(Default: MELSOFT Connection)
• 1200 bps
• 2400 bps
• 4800 bps
• 9600 bps
• 14400 bps
• 19200 bps
• 28800 bps
• 38400 bps
• 57600 bps
• 115200 bps
• 230400 bps
(Default: Automatically set)
• Independent
• Interlink
(Default: Independent)
• 7
• 8
(Default: 7)
• None
• Yes
(Default: None)
• Odd
• Even
(Default: Odd)
• 1
• 2
(Default: 1)
• None
• Yes
(Default: None)
• Disable
• Enable
(Default: Disable)
• Disable
• Enable
(Default: Disable)
0 to 31
(Default: 0)
1 to 247
(Default: 1)
456
28 PARAMETER SETTING
28.2 Module Parameters
Item
Signal specification RTS (RS) signal status designation
Transmission control specification
Communication control specification
DTR (ER) signal status designation
Transmission control
DC1/DC3 control
DC2/DC4 control
DC1 code
DC3 code
DC2 code
DC4 code
Transmission control start free space designation
Transmission control end free space designation
Nonprocedural no-reception monitoring time method designation
Word/byte units designation
CD terminal check designation
Communication method designation
Echo back enable/prohibit specification
NULL character automatic removal designation
Communication data reception enable/ disable designation
Receive data enable/disable
Send data enable/disable
Description
Sets the ON/OFF state of RTS(RS) signal.
Sets the ON/OFF state of DTR (ER) signal.
Sets which controls data communication with a target device, transmission control signal or DC code.
Sets whether or not DC1/DC3 control is enabled.
Sets whether or not DC2/DC4 control is enabled.
Sets the control data to inform a target device that C24 can receive data.
Sets the control data to inform a target device that C24 cannot receive data.
Sets the control data to inform a target device the start of a valid data.
Sets the control data to inform a target device the end of a valid data.
Designates a free capacity in the OS area that informs data cannot be received.
Designates a free capacity in the OS area that informs data can be received.
Sets the format to use the no-reception monitoring time
(timer 0).
Sets the unit of data length (data count).
Checks the state of the CD (DCD) signal.
Sets the communication method.
Sets whether or not the returned data is received.
Sets whether or not NULL character is automatically deleted.
Setting range
• OFF
• ON
(Default: ON)
• OFF
• ON
(Default: ON)
• DTR/DSR control
• DC code control
(Default: DTR/DSR control)
• Control disabled
• Control enabled
(Default: Control disabled)
• Control disabled
• Control enabled
(Default: Control disabled)
00H to FFH
(Default: 11H)
00H to FFH
(Default: 12H)
00H to FFH
(Default: 13H)
00H to FFH
(Default: 14H)
64 to 4095
(Default: 64)
263 to 4096
(Default: 263)
• Method 0
• Method 1
(Default: Method 0)
• Word unit
• Byte unit
(Default: Word unit)
• Check
• Do not check
(Default: Do not check)
• Full-duplex communication
• Half-duplex communication
(Default: Full-duplex communication)
• Echo back enable
• Echo back prohibit
(Echo back prohibit)
• Auto delete disabled
• Auto delete enabled
(Default: Auto delete disabled)
• Receive enable
• Receive disable
(Default: Receive enable)
Sets this if noise signals are added on the line when turning
ON the power of the target device or connecting the communication cable. Setting to "Receive enable", improper data due to noise signal addition can be discarded.
Set this designation to "Receive enable" by a program after the serial line has been settled. While this designation is set to "Receive disable", the normal data also is discarded.
Sets whether data received simultaneously is valid or invalid.
Sets whether data transmitted simultaneously is valid or invalid.
• Enable
• Disable
(Default: Enable)
• Enable
• Disable
(Default: Enable)
28
28 PARAMETER SETTING
28.2 Module Parameters
457
Item
Half-duplex communication control specification
Data communication time monitoring specification
Send wait time specification
Send/receive data monitoring function specification
On-demand function specification
Send area specification
Description
Simultaneous transmission priority/nonpriority designation
Retransmission time transmission method designation
No-reception monitoring time (timer 0) designation
Sets whether the transmission from C24 is continued or discontinued when C24 and a target device stat data transmission at the same time.
0.0: Priority
0.1 to 25.5: Non-priority
(Transmission wait time : unit: s)
Sets whether the discontinued message is transmitted from the beginning or it is transmitted from the part disconnected when C24 restarts transmission following the discontinuation at the time of simultaneous transmission.
Sets a monitoring time for the no-reception monitoring time
(timer 0).
0: Unlimited wait
40 to 4000: Monitoring designation
(Unit: byte)
Response monitoring time (timer 1) designation
Send monitoring time (timer 2) designation
Set a monitoring time for the response monitoring time
(timer 1).
0: Unlimited wait
0.1 to 300.0: Monitoring designation
(Unit: s)
Set the monitoring time for transmission monitoring time
(timer 2).
0: Unlimited wait
0.1 to 300.0: Monitoring designation
(Unit: s)
Transmission wait time designation Set a wait time to transmit a response message to a message received from a target device.
0: No wait time
10 to 150: Monitoring designation (multiples of ten)
(Unit: ms)
Send/receive data monitoring designation Set the start/stop communication data monitoring.
Stop at buffer full specification
0 timer error outbreak stop designation
Monitor buffer start address designation
Monitor buffer size designation
Sets whether the monitor is stopped when the monitor data area is full (buffer full).
Set whether the monitor is stopped when the timer 0 error occurs.
Set the start address of the storage area for the monitored data.
Set a monitor data area size.
Buffer memory start address designation Set the start address of the buffer memory used with the ondemand function.
Data length designation
Send buffer memory start address designation
Send buffer memory size specification
Set a data length to be transmitted using the on-demand function.
Set the start address of the area used as the send area.
Set the size of the area used as the send area.
Setting range
0.0 to 25.5
(Default: 0.0: Priority)
• Do not resend
• Resend
(Default: Do not resend)
0, 40 to 4000
(Default: 0: Unlimited wait)
0, 0.1 to 300.0
(Default: 0.5)
0, 0.1 to 300.0
(Default: 180.0)
0, 10 to 150 (multiples of ten)
(Default: 0: No wait time)
• No monitor/stop instruction
• Monitor start instruction
(Default: No monitor/stop instruction)
• OFF
• ON
(Default: OFF)
• OFF
• ON
(Default: OFF)
1024 to 6909 (400H to
1AFDH),
9728 to 16381 (2600H to
3FFDH)
(Default (CH1): 9728
(2600H))
(Default (CH2): 13056
(3300H))
3 to 6656 (3H to 1A00H)
(Default: 3328(D00H))
1024 to 6911 (400H to
1AFFH),
9728 to 16383 (2600H to
3FFFH)
(Default (CH1): 1024 (400H))
(Default (CH2): 2048 (800H))
0 to 13312 (0H to 3400H)
(Default: 0 (0H))
1024 to 6911 (400H to
1AFFH),
9728 to 16383 (2600H to
3FFFH)
(Default (CH1): 1024 (400H))
(Default (CH2): 2048 (800H))
1 to 6656 (1H to 1A00H)
(Default: 512 (200H))
458
28 PARAMETER SETTING
28.2 Module Parameters
Item
Receiving area specification
Conversion designation
Transparent code designation_Trans parent code for sending specification (nth)
Transparent code designation_Trans parent code for receiving specification
Receiving buffer memory start address designation
Receiving buffer memory size specification
ASCII-binary conversion designation
Transparent code
Additional code
Transparent code
Additional code
Description Setting range
Set the start address of the area used as the receive area.
1024 to 6911 (400H to
1AFFH),
9728 to 16383 (2600H to
3FFFH)
(Default (CH1): 1536 (600H))
(Default (CH2): 2560 (A00H))
Set the size of the area used as the receive area.
Set whether or not data to be communicated to a target device is communicated with ASCII code.
1 to 6656 (1H to 1A00H)
(Default: 512 (200H))
• Do not convert
• Convert
(Default: Do not convert)
Set one-byte data for transmission control.
Set '0' for both the transparent code and additional code when the transparent code for sending is not specified.
Set one-byte data added immediately before the transparent code and additional code data.
Set the additional code within the range of 01H to FFH when the transparent code for sending is specified.
Set '0' for both the transparent code and additional code when it is not specified.
Set one-byte data for transmission control.
Set '0' for both the transparent code and additional code when the transparent code for receiving is not specified.
00H to FFH
(Default: 00H: Do not designate (The transparent code and the additional code are both 0.))
00H to FFH
(Default: 00H: Do not designate (The transparent code and the additional code are both 0.))
Set one-byte data to be deleted at the data reception. (The immediately succeeding one-byte data is processed for reception.)
Set the additional code within the range of 01H to FFH when the transparent code for receiving is specified.
Set '0' for both the transparent code and additional code when it is not specified.
00H to FFH
(Default: 00H: Do not designate (The transparent code and the additional code are both 0.))
00H to FFH
(Default: 00H: Do not designate (The transparent code and the additional code are both 0.))
Receiving end specification
Receive end data quantity designation
Receive end code designation
Protocol execution history specification option
Simple PLC Communication Setting
Set the receive end data quantity.
Set a receive end code.
0D0AH: CR, LF
00H to FFH: Arbitrary receive end code
FFFFH: No designation
Set whether execution logs of all protocol are stored or whether execution logs of only abnormally completed protocol are stored.
Set whether to use simple CPU communication.
1 to 13310
(Default: 511)
0000H to 00FFH, 0D0AH,
FFFFH
(Default: 0D0AH: CR, LF)
• Only protocol that completed abnormally
• All protocol execution status and execution history
(Default: Only protocol that completed abnormally)
Enable
(Default: Enable)
*1 It can be set only on the CH1 side. When the test mode is selected, the communication protocol setting on the CH1 side and the setting on the CH2 side cannot be configured (will be invalid).
*2 It will be enabled only when "MELSOFT Connection" is selected for the communication protocol setting.
*3 It can be set on the CH2 side only. (Since the linked operation is not available for RJ71C24-R2, it is fixed to "Independent".)
When it is set to "Interlink", the communication protocol setting for the CH2 side cannot be configured.
*4 Set '8' for data communication using MC protocol (format 5), bidirectional protocol, or MODBUS slave (RTU).
For data communication using simple CPU communication, it differs depending on the device type of a communication destination.
*5 It can be set when "MODBUS Slave (RTU)" or "MODBUS Slave (ASCII)" is selected for the communication protocol setting.
*6 n: 1 to 10
*7 It will be enabled when "Simple PLC Communication" is selected for the communication protocol setting.
28
28 PARAMETER SETTING
28.2 Module Parameters
459
Application settings
Configure the settings such as the user frame specification.
Window
Setting data
Item
User frame specification
Modem function setting
Programmable controller
CPU monitoring function setting
Description
Sets the system setting value for data communication using a user frame.
Sets the system setting value for data communication using the modem function.
Sets the system setting value to use the programmable controller CPU monitoring function.
Reference
Page 461 User frame specification
Page 462 Modem function setting
Page 463 Programmable controller CPU monitoring function setting
460
28 PARAMETER SETTING
28.2 Module Parameters
User frame specification
Set the system setting value for data communication using a user frame.
Item
On-demand user frame specification
User frame specification for receiving
Send user frame designation
User frame receiving method designation
Start frame No. designation (nth)
Final frame No. designation (nth)
User frame use enable/disable designation
Start frame No. designation (nth)
Final frame No. designation (nth)
CR/LF output designation
Description
Sets the user frame number to be used.
Sets the user frame number to be used.
Sets whether or not a user frame is used for data communication.
Sets the user frame number to be used.
Sets the user frame number to be used.
Sets whether or not CR/LF is transmitted.
Output start pointer designation
Output quantity designation
Send frame No. designation (nth)
User frame receiving method designation (nth)
Method 1 dedicated receive end data quantity designation
(nth)
Sets the head position in the transmission frame number designation area to which the registration number of the user frame to be transmitted is written.
Sets the number of user frame to be transmitted from the designated position in the output start pointer designation area.
Sets the user frame number to be transmitted from the designated position in the output start pointer designation area in the order of output.
Sets the receive format of a user frame.
Sets the number of word/byte in the arbitrary data portion at the time of data reception using the user frame receive method 1.
Setting range
0000H to 801FH
(Default: 0000H)
0000H to 801FH
(Default: 0000H)
• Not use
• Use
(Default: Not use)
0000H to 801FH
(Default: 0000H)
0000H to 801FH
(Default: 0000H)
• Do not send
• Send
(Default: Do not send)
0 to 100
(Default: 0)
0 to 100
(Default: 0)
0000H to FFFFH
(Default: 0000H)
• Method 0
• Method 1
(Default: Method 0)
0000H to FFFFH
(Default: 0000H)
28
28 PARAMETER SETTING
28.2 Module Parameters
461
Modem function setting
Set the system setting value for data communication using the modem function.
Item
Modem function specification 1
Modem function specification 2
Modem function specification 3
Remote password function
Modem connection
CH specification
Connection re-try count designation
Connection retry interval designation
Initialization/ connection timeout designation
RS/CS control enable/disable designation
Auto modem initialization designation
Description
Sets a channel to connecting a modem/TA
Sets a number of retries for the connection request.
Sets an interval of the retry processing for the connection request.
(Unit: s)
Sets the wait time below.
• Wait time until the modem/TA initialization is complete.
• Wait time per one connection request
(Unit: s)
Sets a number of initialization retries to the modem.
Setting range
• None
• CH1
• CH2
(Default: None)
1 to 5
(Default: 5)
90 to 300
(Default: 180)
1 to 60
(Default: 60)
Number of initialization retries designation
Data No. for initialization designation
Data No. for connection designation
No-communication interval time designation
1 to 5
(Default: 3)
Sets the data number to be transmitted by the initialization request to the modem.
Sets the data number for connection to be used for the processing to connect to a target device for data transmission.
Sets the wait time before the line is closed when data communications with a target device is ceased after the line has been connected.
0: Infinite wait
1 to 120 (unit: minute)
Sets whether or not the control to notify the reception capability of the host station to the target side with RS/CS signal is performed during data communication between C24 and a modem/TA.
Sets whether or not the modem is automatically initialized.
0000H,
07D0H to 07DDH (2000 to
2013),
09C4H to 09E1H (2500 to
2529)
8001H to 801FH (32769 to
32799)
(Default: 0000H: No designation)
0000H,
0BB8H to 0BD5H (3000 to
3029)
8001H to 801FH (32769 to
32799)
(Default: 0000H: No designation)
0: Infinite wait
1 to 120
(0: Infinite wait)
• Control disabled
• Control enabled
(Default: Control enabled)
• Do not automatically initialize
• Automatically initialize
(Default: Do not automatically initialize)
• DR signal enabled
• DR signal disabled
(Default: DR signal disabled)
Modem initialization
DR (DSR) signal enable/disable designation
Line disconnection wait time specification (PLC
CPU monitor)
Remote password mismatch notification count designation
Remote password mismatch notification accumulated count designation
Sets how to treat DR signal when initializing a modem.
Sets the time until data transmission from a modem on the host station side to the target device side is completed for data communication with the programmable controller CPU monitoring function.
Sets the number of times to notify the CPU module that a remote password mismatch occurred during the unlock processing by a target device after the modem line has been connected.
Set the accumulated number of times to notify the CPU module that a remote password mismatch occurred during the unlock processing by a target device after C24 has started up.
0000H to FFFFH
(Default: 0000H)
0000H to FFFFH
(Default: 0000H: No designation)
0000H to FFFFH
(Default: 0000H: No designation)
462
28 PARAMETER SETTING
28.2 Module Parameters
Programmable controller CPU monitoring function setting
Set the system setting value to use the programmable controller CPU monitoring function.
Item
Programmable controller CPU monitoring function designation
Cycle time units designation
Cycle time designation (programmable controller CPU monitoring interval time)
Send pointer designation
Output quantity designation
Block monitoring device
Description
Sets the timing to transmit the programmable controller
CPU monitoring results to a target device.
Set a cycle time.
(The unit depends on the cycle time units designation.)
Sets the pointer position of the user frame to be transmitted.
Sets the number of user frame to be transmitted.
Registered word block quantity designation Sets the number of registered word blocks.
Registered bit block quantity designation
CPU error monitoring designation n-th block monitoring device
Monitoring device designation
Start device No. specification
Sets the unit of the cycle time.
Sets the number of registered bit blocks.
Sets whether or not the monitoring for abnormality on
CPU module is performed.
Sets the device code to be monitored.
Sets the start number of device to be monitored.
Number of read points specification
Monitoring condition specification
(judgment condition specification)
Sets the read point.
Sets the judgment conditions for the monitoring condition value.
Setting range
• Do not use the function
• Fixed cycle send
• Condition match send
(Default: Do not use the function)
• 100 ms
• Second
• Minute
(Default: Minute)
1 to 65535
(Default: 5)
0 to 100
(Default: 0: No designation)
0 to 100
(Default: 0: No designation)
0 to 10
(Default: 0: No designation)
0 to 10
(Default: 0: No designation)
• Do not monitor
• Monitor
(Default: Do not monitor)
(Default: Do not designate)
(Default: 0)
0000H to FFFFH
(Default: 0000H)
• Do not designate
• =(Edge)
• <>(Edge)
• <=(Unsigned, Edge)
• <(Unsigned, Edge)
• >=(Unsigned, Edge)
• >(Unsigned, Edge)
• <=(Signed, Edge)
• <(Signed, Edge)
• >=(Signed, Edge)
• >(Signed, Edge)
• =(Level)
• <>(Level)
• <=(Unsigned, Level)
• <(Unsigned, Level)
• >=(Unsigned, Level)
• >(Unsigned, Level)
• <=(Signed, Level)
• <(Signed, Level)
• >=(Signed, Level)
• >(Signed, Level)
(Default: Do not designate)
28
28 PARAMETER SETTING
28.2 Module Parameters
463
Item
Block monitoring device
CPU error monitoring designation n-th block monitoring device
Monitoring condition value designation
Description
Sets the condition and numeric value for the monitoring condition.
Send pointer designation
Output quantity designation
Send pointer designation
Output quantity designation
Sets the pointer position of the user frame to be transmitted.
Sets the number of user frame to be transmitted.
Sets the pointer position of the user frame to be transmitted.
Sets the number of user frame to be transmitted.
Setting range
■ When the monitoring device is a word device
0000H to FFFFH
■ When the monitoring device is a bit device
• 0000H: OFF
• 0001H: ON
(Default: 0000H)
0 to 100
(Default: 0: No designation)
0 to 100
(Default: 0: No designation)
0 to 100
(Default: 0: No designation)
0 to 100
(Default: 0: No designation)
*1 n: 1 to 10
464
28 PARAMETER SETTING
28.2 Module Parameters
MODBUS slave settings
Configure the settings for communication using the MODBUS slave function.
This can be set when "MODBUS Slave (RTU)" or "MODBUS Slave (ASCII)" is selected for the communication protocol setting.
Window
28
Setting data
Setting item
MODBUS device allocation parameter
Allocation 1 to 16
Description
Set parameters to associate MODBUS devices with device memories of a CPU module.
Page 467 MODBUS device assignment parameters
Setting range
28 PARAMETER SETTING
28.2 Module Parameters
465
Setting item
MODBUS device allocation parameter
(common)
Specifying the error status
Specifying the error status device code
Error status read head device specification
Buffer Memory for
Error Status
CC-Link IEF
Remote
Head Module
Access target
CPU Response monitoring timer
Description
Specify data read as an error status by a slave (C24) when the read exception status (FC: 07) is received from a
MODBUS master device.
• For device designation: Designate a device code and a device number.
• For buffer memory setting: Specify 'H' for the device code.
Specify '0' and a buffer memory setting value (0 to 255) for the device number and "Buffer Memory for Error Status" respectively.
Setting range
• TS
• TC
• STS
• STC
• CS
• CC
• LCS
• LCC
• L
• F
• V
• B
• SM
• X
• Y
• M
• SB
• S
• DX
• DY
• H
(Default: H)
• H device: 0
• Devices other than H: Follow the device settings of the CPU parameter.
(Default: 0)
0 to 255
(Default: 0)
Specify the setting value of a specified buffer memory when specifying the buffer memory for the specifying the error status device code.
It is enabled only "H0" is entered for the specifying the error status device code and the number specification.
Specify an access target when a C24 is connected to a CC-
Link IE Field Network remote head module.
Set a response monitoring time from a CPU module.
If there is no response from the CPU module within a set time after a request message is received from a MODBUS master device, the response waiting state of a C24 is released.
• Remote Head
• Master Station
(Default: Remote Head)
• 0: 5s
• 1 to 12000: Setting time (unit:
100 ms)
(Default: 50)
466
28 PARAMETER SETTING
28.2 Module Parameters
MODBUS device assignment parameters
MODBUS device assignment parameters are used for associating MODBUS devices with device memories of a CPU module.
By using them, direct access from a MODBUS master device to device memories of a CPU module is available.
The range of devices to be assigned must be set so that it does not exceed the range of devices that can be used for a CPU module.
The following items can be set for each allocation 1 to 16.
Item
Device code
Start device number
Start MODBUS device number
Allocation points
Description
Set a device of a CPU module to be assigned to a MODBUS device.
Specify the start device number in hexadecimal regardless of the device type.
Set 'H' for the device code when using the buffer memory. Set an address of 'User setting area for MODBUS' (Un\G49152 to Un\G53247) in hexadecimal (C000H to CFFFH) for the start device number.
Set the start number of a MODBUS device to which a device of a CPU module is assigned.
A setting value of the start MODBUS device number can be calculated with the following formula:
• Start MODBUS device number = Last five digits of the setting target MODBUS device number - 1
Set the number of device points of a CPU module assigned to a MODBUS device.
Setting range
• For using the buffer memory:
HC000 to HCFFF
• Devices other than the buffer memory (H): Follow the device settings of the CPU parameter.
(Default:
Page 470 Default assignment parameters)
0 to 65535
(Default:
Page 470 Default assignment parameters)
The following shows the schematic diagram of the MODBUS device assignment parameter setting.
MODBUS device allocation parameter setting example
CPU module device memory
Internal relay (M)
M0
M1201
3500
M4700
M8191
Output (Y)
Y0
3500
MODBUS device
Coil
000001
003500
004000
8192
Allocation 2 (Coil)
Device code
Start device number
Start MODBUS device number
Allocation points
Y
0
3999
8192
8192
012191
Allocation 1 (Coil)
Device code
Start device number
Start MODBUS device number
Allocation points
M
1201
0
3500
Y1FFF
L0
L4
Latch relay (L) 5
5
065000
065004
065536
Allocation 3 (Coil)
Device code
Start device number
Start MODBUS device number
Allocation points
L
0
64999
5
L8191
SD0
SD2047
Special register (SD)
2048
D0
D999
Data register (D)
1000
Holding register
1000
2048
400001
401000
402000
404047
Allocation 1 (Holding register)
Device code
Start device number
Start MODBUS device number
Allocation points
SD
0
1999
2048
D6000
6288
Allocation 2 (Holding register)
Device code
Start device number
Start MODBUS device number
Allocation points
D
0
0
1000
6288
430000
D12287
436287
465536
Allocation 3 (Holding register)
Device code
Start device number
Start MODBUS device number
Allocation points
D
6000
29999
6288
28
28 PARAMETER SETTING
28.2 Module Parameters
467
■
Available devices
The following table lists the devices of a CPU module that can be set for MODBUS devices.
Device
Device name
Special relay
Special register
Input
Output
Internal relay
Latch relay
Annunciator
Edge relay
Link relay
Data register
Link register
Timer
Long timer
Retentive timer
Contact
Coil
Current value
Current value
Contact
Coil
Current value
Current value Long retentive timer
Counter
Long counter
Contact
Coil
Current value
Contact
Coil
Current value
Link special relay
Link special register
Step relay
Direct access input
Direct access output
Index register
File register
Index register
Long index register
Block switching method
Serial number access method
Refresh data register
Buffer memory
Z
LZ
R
SW
S
DX
DY
CS
CC
CN
LCS
LCC
LCN
SB
Symbol Device code
W
TS
TC
TN
B
D
F
V
M
L
X
Y
SM
SD
LTN
STS
STC
STN
LSTN
0004H
0005H
0014H
0020H
0030H
0041H
0040H
0042H
0002H
0021H
0010H
0011H
0001H
0003H
0052H
0049H
0048H
004AH
005AH
ZR
RD
H
0031H
0008H
0016H
0017H
0060H
0062H
0027H
0045H
0044H
0046H
0055H
0054H
0056H
0015H
0028H
002CH
00A7H
Type
Bit
Word
Bit
Word
Bit
Word
Double word
Bit
Word
Double word
Bit
Word
Bit
Double word
Bit
Word
Bit
Bit
Word
Double word
Word
Word
Word
MODBUS device ( : Assignable, : Not assignable)
Coil
Input
Input register
Holding register
Extended file register
*1 When setting a bit type device for an input register and output register, set the number of assigned points to a multiple of 16.
*2 Two points of MODBUS devices are used.
*3 Fixed to the file register (ZR).
*4 The long timer (current value) and long retentive timer (current value) use four points of MODBUS devices. (
Page 469 Reading of the long timer and long retentive timer)
*5 The step relay is read-only. An attempt of writing will cause an error.
468
28 PARAMETER SETTING
28.2 Module Parameters
■
Reading of the long timer and long retentive timer
When reading the long timer and long retentive timer, note that the following devices cannot be set:
• Long timer (contact)
• Long timer (coil)
• Long retentive timer (contact)
• Long retentive timer (coil)
When, however, the current value of the long timer or long retentive timer is set in units of four words, the contact and coil will be read simultaneously.
Response data
1st word
2nd word
3rd word
Description
The current value is stored.
4th word
• b0: The value of a coil is stored.
• b1: The value of a contact is stored.
• b2 to b15: Used by the system.
Used by the system.
As shown above, the long timer and long retentive timer use the data configuration of four words per device. Consequently, specify the number of device points in units of four points.
■
Writing of the long timer and long retentive timer
Note that the long timer and long retentive timer cannot be set.
■
MODBUS extended file register assignment
The assignment of the MODBUS extended file register to the CPU module is fixed to the file register (ZR).
The following shows the assignment to the file register of the CPU module. (The number of points for the file register shows the maximum size that can be set in the CPU module (when the R120CPU + NZ2MC-16MBS are mounted)).
CPU module file register (ZR)
MODBUS extended file register
ZR0
600000
10000 File number 0
ZR9999
ZR10000
609999
600000
10000 File number 1
ZR19999
ZR20000
609999
600000
10000 File number 2
ZR29999
ZR30000
609999
28
ZR10019999
ZR10020000
600000
7008 File number 1002
ZR10027007 607007
■
Size of a MODBUS extended file register
The size of a MODBUS extended file register depends on that of the file register (ZR) set in a CPU module.
For details, refer to the following manual.
MELSEC iQ-R CPU Module User's Manual (Application)
28 PARAMETER SETTING
28.2 Module Parameters
469
Default assignment parameters
The MODBUS device assignment parameters include default assignment parameters as initial values.
The following diagram shows the MODBUS device assignment using the default assignment parameters.
Input register
(300001 to 365536)
Holding register
(400001 to 465536)
Coil
(000001 to 065536)
000001
8192
Y
(0 to 1FFF)
Allocation 1 008192
008193
8192
M
(0 to 8191)
Allocation 2 016384
2048
(Empty)
SM
(0 to 2047)
Allocation 3
020481
022528
022529
8192
L
(0 to 8191)
Allocation 4 030720
030721
8192
B
(0 to 1FFF)
2048
2048
2048
Allocation 5
F
(0 to 2047)
Allocation 6
SB
(0 to 7FF)
Allocation 7
038912
038913
040960
040961
043008
043009
V
(0 to 2047)
Allocation 8 045056
(Empty)
1024
TC
(0 to 1023)
Allocation 9
053249
054272
(Empty)
1024
TS
(0 to 1023)
Allocation 10
055297
056320
512
(Empty)
CC
(0 to 511)
Allocation 11
061441
061952
512
(Empty)
CS
(0 to 511)
Allocation 12
063489
064000
(Empty)
065536
Input
(100001 to 165536)
100001
8192
X
(0 to 1FFF)
Allocation 1 108192
(Empty)
165536
(Empty)
300001
365536
12288
D
(0 to 12287)
(Empty)
2048
4096
SD
(0 to 2047)
Allocation 2
420481
422528
422529
RJ71C24 user free area
H
(C000H to CFFFH)
Allocation 3 426624
(Empty)
430721
8192
W
(0 to 1FFF)
Allocation 4 438912
(Empty)
2048
SW
(0 to 7FF)
Allocation 5
440961
443008
(Empty)
400001
Allocation 1 412288
1024
TN
(0 to 1023)
Allocation 6
453249
454272
(Empty)
512
CN
(0 to 511)
Allocation 7
461441
461952
(Empty)
465536
• In the MODBUS device assignment parameters, the 'Start MODBUS device number' is the 'Last five digits of the setting target MODBUS device number - 1.'
• If a CC-Link IE Field Network remote head module is set as an access target, default values set for the
MODBUS device assignment parameters cannot be used.
470
28 PARAMETER SETTING
28.2 Module Parameters
Interrupt settings
Configure the settings to receive data with an interrupt program.
Window
Setting data
Item
Interrupt factor
Interrupt pointer
Description
Sets the condition for interruption occurrence.
Sets the interrupt pointer to be used by the program.
Setting range
• No specification
• BUFRCVS instruction data reception
(Default: No specification)
MELSEC iQ-R CPU
Module User's Manual
(Application)
28
28 PARAMETER SETTING
28.2 Module Parameters
471
Refresh setting
With this refresh settings, the read and write processing by a program is not necessary.
Set a device/module label of the CPU module which transfers data alternately with the buffer memory on C24.
The device/module label to be transmitted is selected from the following from "Target".
• Module label
• Refresh Data Register (RD)
• Device
Module label
The contents are transferred alternatively between the module label corresponding to each buffer memory and the buffer memory. Set "Valid" for the item to be transferred using module labels and "Invalid" for the item not to be transferred. By enabling "Send data_send area", the other transfer destinations will be set to "Valid".
Refresh data register (RD)
The contents are transferred alternatively between the refresh data register (RD) of a CPU module and the buffer memory. By setting the refresh data register (RD) to be transferred in "Top Device Name", the other transfer destinations will be automatically set.
Device
The contents are transferred alternatively between the designated device of a CPU module and the buffer memory. The devices that can be designated are X, Y, M, L, B, T, C, ST, D, W, R, ZR, and RD. When bit devices, X, Y, M, L, or B are used a number that can be divided by 16 points (for example, X10, Y120, M16, etc.) should be set. The buffer memory data is stored in the equivalent of 16 points from the designated device number.
(For example, when X10 is set, data is stored from X10 to X1F.)
472
28 PARAMETER SETTING
28.2 Module Parameters
Setting item
Item
Transfer to intelligent function module
Transfer to CPU
Refresh group
Refresh Timing (I/O)
Send data_send area
LED lighting status, communication error status
Transmission control status
Control signal status
Communication result
For receive data
Refresh group
Program group No.
Refresh timing
Description
A refresh setting for the send data storage area.
A refresh setting for confirmation of LED lighting status and communication error status
A refresh setting for confirmation of transmission control status
A refresh setting for confirmation of control signal status
A refresh setting for confirmation of communication result
A refresh setting for the receive data storage area
Predefined protocol execution status
A refresh setting for confirmation of predefined protocol execution states
Sending user frame
For user frame confirmation
For modem function confirmation
A refresh setting for confirmation of user frame being transmitted
A refresh setting for confirmation of user frame
A refresh setting for confirmation of modem function
For remote password function A refresh setting for the remote password function
Programmable controller CPU monitoring function
A refresh setting for the programmable controller CPU monitoring function
For flash ROM (user frame) access
Transmission setting, for mode switching confirmation
A refresh setting for the flash ROM (user frame) access
Reference
Page 483 Checking error status
Page 489 Current operation status reading method
Page 487 RS-232 control signal status reading method
Page 488 Data communication status
(transmission sequence status) reading method
Page 57 Receiving Data from Target Device
Page 90 Receiving Data from Target Device
Page 347 Settings of send user frames
Page 193 Details of the buffer memory (for modern function)
Page 197 Details of buffer memory (for the remote password function)
A refresh setting for confirmation of the transmission setting and the mode switching
A setting for the refresh group
• At the Execution Time of END Instruction
• At the Execution Time of Specified Program
Designate the number which will be enabled when selecting
'At the Execution Time of Specified Program' for Refresh group.
Sets the timing to transmit the I/O device data.
• It follows the refresh timing (buffer memory).
28
28 PARAMETER SETTING
28.2 Module Parameters
473
Refresh processing time
A refresh processing time ( s) is a constituent of the scan time of CPU module. For details on the scan time, refer to the following manual.
MELSEC iQ-R CPU Module User's Manual (Application)
The refresh processing time ( s) , which is taken for the refresh, is given by:
• Refresh processing time ( s) = Refresh read time (time for transferring refresh data to the CPU module) + Refresh write time (time for transferring refresh data to the Intelligent function module)
The refresh read time and refresh write time vary depending on the settings of "Target".
■
When "Target" is "Module Label" or "Refresh Data Register (RD)"
The following table shows the refresh read time and refresh write time with an R CPU used.
Classification
Refresh read time
Refresh write time
Refresh processing time
80.80 s
20.48 s
■
When "Target" is "Device"
Calculate the refresh read time and refresh write time according to the number of items and the number of their transfer data
(in units of word) that are set to be refreshed. For the calculation method, refer to the following manual.
MELSEC iQ-R CPU Module User's Manual (Application)
In addition, substitute the following values in the calculation formula to calculate the refresh processing time.
Item
Number of refresh settings
Refresh time (A) of each of the 1st to nth set items
Refresh time (B) of each of the 1st to nth set items
Description
Number of items that are set to be refreshed
0.05
0.01
*1 This value is the time with an R CPU used.
Ex.
When all the 48 items (1068 words in total) are set in the refresh read settings
48 0.98 + 0.05 1068 + 11.6 = 112.04 s
The refresh read time, therefore, is 112.04 s.
Ex.
When all the 2 items (1022 words in total ) are set in the refresh write settings
2 0.58 + 0.01 1022 + 9.10 = 20.48 s
The refresh write time, therefore, is 20.48 s.
474
28 PARAMETER SETTING
28.2 Module Parameters
28.3
Module Extended Parameter
Set a module extended parameter. The module extended parameter includes user frame contents, modem initialization data, modem connection data, and simple CPU communication setting which are selected from the tree on the following screen.
Navigation window [Parameters] [Module Information] Module Name [Module Extended Parameter]
User frame contents
Register the user frame which is used for the on-demand function using the MC protocol and the data transmit/receive function using nonprocedural protocol.
In the user frame contents, the setting value for each frame of the registration frame No. 1000 to 1199 is set.
Window
28
Setting data
Item
User frame
Description
Sets the setting value for a user frame.
Setting range
80 (maximum number of characters that can be entered)
28 PARAMETER SETTING
28.3 Module Extended Parameter
475
Modem initialization data
In the modem initialization data, the data for initialization of the data number from 2500 to 2529 is set.
Window
Setting data
Item
Initialization command
User control data
Description
Sets a data code for initialization command.
Sets an arbitrary data for a user to control the data to be registered.
Setting range
78 (maximum number of characters that can be entered)
0 to FFFF
476
28 PARAMETER SETTING
28.3 Module Extended Parameter
Modem connection data
In the modem connection data, the data for connection of data number from 3000 to 3029 is set.
Window
Setting data
Item
External line outgoing number
Line type
Telephone number
Comment
Description
Sets an external line outgoing number of the C24 side for line connection to the side of target device for data transmission.
Sets a line type between the target device for data communication.
Sets a telephone number between the target device for data communication.
Sets an arbitrary comment.
Setting range
• 255: No external transmission
• 0: 0
• 1: 1
• 2: 2
• 3: 3
• 4: 4
• 5: 5
• 6: 6
• 7: 7
• 8: 8
• 9: 9
• 10: *
• 11: #
• 0: Pulse
• 1: Tone
• 2: ISDN
62 (maximum number of characters that can be entered)
254 (maximum number of characters that can be entered)
28 PARAMETER SETTING
28.3 Module Extended Parameter
477
28
Simple CPU communication setting
Set the following items when using the simple CPU communication function for a C24.
Window
Setting data
Item
CPU Response Monitoring Timer
Unit
Latency Time
Simple PLC Communication Setting
No.
*1 : 1 to 512
Description
Set the time for monitoring the response from the CPU module.
If there is no response from the CPU module within a set time, the response waiting state is released.
Select the unit of a CPU response monitoring timer.
Set a time to start communication after the CPU module is started.
(Unit: s)
Configure the settings to perform simple CPU communication.
Set a communication pattern, communication destination, and devices to be sent and received.
Setting range
Unit: s
• 1 to 16383
Unit: ms
• 100 to 16383000
• s
• ms
Page 479 Simple CPU communication setting
"Simple PLC Communication Setting" can be set up to 512 with an engineering tool; however, when setting as a communication destination, up to 1 (RS-232) and 32 (RS-422/485) can be set for each channel.
In GX Works3, if a project satisfies all the following conditions, the values in the simple CPU communication setting may become incorrect when opening the setting in version 1.072A or earlier.
• A serial communication module was placed in a project in version 1.072A or earlier.
• The above project was opened in version 1.075D or later, and the simple CPU communication setting was configured.
In this case, upgrade the version to 1.075D or later, then open the simple CPU communication setting.
478
28 PARAMETER SETTING
28.3 Module Extended Parameter
Simple CPU communication setting
Set the following items to perform simple CPU communication.
A setting screen appears by double-clicking any one of "Simple PLC Communication Setting No.1" to "Simple PLC
Communication Setting No.512" in the "Simple PLC Communication Setting" screen.
Displayed items
28
Setting data
Item
Latency Time
Setting No.
Communication Pattern
Communication Setting:
Execution Interval (ms)
Communication Destination
(Host Station Channel No.)
Target PLC No.
Communic ation
Setting
Execution
Interval
Source
Destinatio n
Description
Set the time required to start communications after completion of the CPU module startup.
This setting is common to all the setting numbers and cannot be changed for each setting number.
(Unit: s)
Setting No. 1 to 512 are available.
Any setting number can be set. (A number that is not a sequential number can also be set.)
Set whether to read or write data.
Setting range
0 to 255
(Default: 0)
Set the data communication timing.
Set the execution interval of communications when "Fixed Interval" is set for the communication setting.
(Unit: ms)
Set the transfer source.
When selecting "Write" for the communication pattern, the host station is displayed.
Set the transfer destination.
When selecting "Read" for the communication pattern, the host station is displayed.
Specify the PLC number of a communication destination.
It will be the connected station when "Not Specified" is selected.
• Read
• Write
(Default: Blank)
• Fixed Interval
• On Request
(Default: Fixed Interval)
10 to 65535
(Default: 100)
Communication destination setting
Not Specified (fixed)
28 PARAMETER SETTING
28.3 Module Extended Parameter
479
Item
Bit Device
Word Device
Points
Type
Start
End
Points
Type
Start
End
Communication Time-out Period (ms)
Description
Set the type, start number, and end number of a bit device for "Source," and the type and start number of a bit device for "Destination." The number of points is automatically displayed after entering these items.
Set the type, start number, and end number of a word device for "Source," and the type and start number of a word device for "Destination." The number of points is automatically displayed after entering these items.
Setting range
Differs depending on the communication destination.
(
Communication Retry Count
Monitoring Time At Error (s)
Comment
Set the time to start a retry after an error response is received from a communication destination, to regard the state as an error, or to wait for a response from a communication destination.
Set it as follows: (Communication time-out period) (Execution interval)
For details on the communication time-out period, refer to the following section.
• When selecting "Fixed Interval" for the communication setting:
Operation when an error occurs
• When selecting "On Request" for the communication setting:
Operation when an error occurs
(Unit: ms)
Set the number of times to repeat a waiting operation in the communication time-out period if there is an error response or no response from a communication destination.
For details on the communication retry count, refer to the following section.
• When selecting "Fixed Interval" for the communication setting:
Operation when an error occurs
• When selecting "On Request" for the communication setting:
Operation when an error occurs
Set the communication time after a communication error occurs.
For details on the monitoring time at error, refer to the following section.
Page 125 Operation in an abnormal state
(Unit: s)
Enter a comment for each setting number.
10 to 65535
(Default: 5000)
0 to 255
(Default: 3)
1 to 300
(Default: 30)
Up to 32 characters
(Default: Blank)
• The actual execution interval is affected by a communication destination and communication speed; therefore, it may become longer than the set execution interval.
• When setting "Latency Time," a data communication is performed after a latency time elapses.
■
Latency time
A timing to start communication can be delayed by setting a latency time for the following cases:
• To avoid an error due to the concentrated communication and overlapped timing to start communication
• To start communication after the communication destination become available to communicate
During a latency time, '1' (preparing) is stored in 'Communication status' for each setting number.
During a latency time, a communication at an execution interval set to "Fixed Interval" is ignored.
480
28 PARAMETER SETTING
28.3 Module Extended Parameter
Communication destination setting
The following table lists the communication destination settings specified for simple CPU communication.
■
Host station channel number, station number
Item
Host Station Channel No.
Description
Set the channel number of the host station.
Setting range
• CH1 (RS-232)
• CH2 (RS-232)
• CH1 (RS-422/485)
• CH2 (RS-422/485)
0 to 247 Station No.
Set the station number when a communication destination is a MODBUScompatible device.
• 0: Broadcast (A request message is sent to all slave stations.)
• 1 to 247: Station number of a slave to be communicated
Cannot be set when a communication destination is a CPU module.
*1 Displayed in the name of a communication destination.
When setting "Station No." to '0' (broadcast), configure the settings as follows:
• "Communication Pattern": "Write"
• "Bit Device" and "Word Device": Cannot be set together. Select either one for each setting.
• "Communication Time-out Period": Set the value as the broadcast delay.
Broadcast is sent to all slave devices; therefore, consider each processing time of all slave devices and set the sufficient time for communication time-out period (broadcast delay).
If there is a slave device the communication time-out period of which is set insufficiently, an error may occur for another request to the slave device.
■
Device type
Configure the setting of a communication destination for devices (transfer source and transfer destination).
Item
Device Type
Option 1
Option 2
Description
Specify the device type of a communication destination.
Cannot be set.
Cannot be set.
Setting range
• MELSEC-A/AnS (CPU COM)
• MODBUS (RTU)-compatible device
• MODBUS (ASCII)-compatible device
The following shows compatible devices for each device type.
Device type Communication destination
MELSEC-A/AnS (CPU COM) A0J2HCPU, A0J2HCPU-DC24V, A0J2HCPUP21, A0J2HCPUR21, A1NCPU, A1NCPUP21, A1NCPUP21-S3,
A1NCPUR21, A1SCPUC24-R2, A1SHCPU, A1SJHCPU, A2ACPU, A2ACPU-S1, A2ACPUP21, A2ACPUP21-S1,
A2ACPUP21-S3, A2ACPUP21-S4, A2ACPUR21, A2ACPUR21-S1, A2CCPU, A2CCPUC24, A2CCPUC24-PRF,
A2CCPUP21, A2CCPUR21, A2CJCPU-S3, A2NCPU, A2NCPU-S1, A2NCPUP21, A2NCPUP21-S1, A2NCPUP21-
S3, A2NCPUP21-S4, A2NCPUR21, A2NCPUR21-S1, A2SHCPU, A2UCPU, A2UCPU-S1, A2USCPU, A2USHCPU-
S1, A3ACPU, A3ACPUP21, A3ACPUP21-S3, A3ACPUR21, A3NCPU, A3NCPUP21, A3NCPUP21-S3, A3NCPUR21,
A3UCPU, A4UCPU
MODBUS (RTU)-compatible device MODBUS slave (RTU)-compatible device
MODBUS (ASCII)-compatible device MODBUS slave (ASCII)-compatible device
28
28 PARAMETER SETTING
28.3 Module Extended Parameter
481
29
TROUBLESHOOTING
This chapter explains the errors which may occur when using C24 and the corrective actions.
29.1
Checking Module Status
The following functions can be used in the "Module Diagnostics" screen of C24.
Function
Error Information
Module Information List
Description
Contents of error currently occurs are displayed.
Errors detected on C24 and history of operation performed to the module can be checked by clicking the [Event History] button.
Various status information of C24 is displayed.
Error information
Check the content of error currently occurs and the corrective actions.
Window
Displayed items
Item
Detailed Information
Cause
Corrective Action
Description
Up to three detail information of each error is displayed.
Detail reasons for error is displayed.
Corrective actions for an error is displayed.
482
29 TROUBLESHOOTING
29.1 Checking Module Status
Module information list
Check each status information of C24 by switching to the [Module Information List] tab.
Checking error status
The transmission status and the communication error status for C24 can be checked with Engineering tool. (Contents of the
'CH side LED lighting status and communication error status' (Un\G513/514) are displayed.)
When a communication error occurs, refer to the following section and take corrective action.
Page 500 Troubleshooting by Symptom
Each communications error status of SIO, PRO., P/S, and C/N turns ON when an error occurs.
To turn them OFF by clearing the communication error status, turn 'Error initialization request' (YE) ON.
Window 29
29 TROUBLESHOOTING
29.1 Checking Module Status
483
Displayed items
■
Buffer memory area for the display contents
b15 to b8 b7
1/0 b6 b5
1/0 1/0 b4
1/0 b3
1/0 b2
1/0 b1
1/0 b0
1/0 (Information on the CH1 side) Un\G513
Buffer memory address
Un\G514 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 (Information on the CH2 side)
For system
SD WAIT
SIO
PRO.
P/S
C/N
NAK
ACK.
NEU.
1: LED ON, error
0: LED OFF, no error
■
SD WAIT
SD WAIT indicates "Transmission wait status".
Value
0001 (ON)
Status
Waiting for data transmission
Description
C24 got into a state in which data cannot be sent to a target device (waiting for data transmission) by the transmission control of C24.
• The transmission cannot be started.
• A transmission terminate request (receiving DC3/DR(DSR) signal OFF) is received from the target device during data transmission.
The transmission became available, and the data transmission is started/resumed.
0000 (OFF)
Value
0001 (ON)
Data transmission available
■
SIO
SIO indicates "SIO error status".
Status
Overrun or framing error occurred
OS area is full.
Description
Overrun or framing error occurred.
Keeps the ON-status even after the communication returns to normal. Initialize the error information as necessary.
No free space is available in the OS area, and the received data was discarded.
Keeps the ON-status even after the communication returns to normal. Initialize the error information as necessary.
0000 (OFF) Normal
■
PRO.
PRO. indicates "Character error status".
Value
0001(ON)
Status
Error occurred
Description
Character error occurred.
Keeps the ON-status even after the communication returns to normal. Initialize the error information as necessary.
0000(OFF) Normal
■
P/S
P/S indicates "Status of parity error or sum check error".
Value
0001(ON)
0000(OFF)
Status
Error occurred
Normal
Description
Parity error or sum check error occurred.
Keeps the ON-status even after the communication returns to normal. Initialize the error information as necessary.
484
29 TROUBLESHOOTING
29.1 Checking Module Status
■
C/N
C/N indicates 'Access status with the CPU module'.
Value
0001(ON)
Status
Error occurred
0000(OFF) Normal
Description
• The target device issued a data write request to the CPU module when online change is set to 'Disable' in the parameter settings with Engineering tool.
For functions that cannot be used when online change is set to 'Disable', refer to the explanation section in each command list in the following manual.
( MELSEC Communication Protocol Reference Manual)
• An error occurred during the access between C24 and the CPU module.
Keeps the ON-status even after the communication returns to normal. Initialize the error information as necessary.
■
NAK
NAK indicates "Abnormal completion status".
Value
0001(ON)
Status
Abnormal completion transmission
0000(OFF) Normal completion transmission or before data communication
Description
C24 that could not receive data normally sent a response message (NAK message) to the target device to notice the abnormal completion.
• C24 that could receive data normally sent a response message (ACK message) to the target device to notice the normal completion.
• Before data is communicated.
■
ACK.
ACK. indicates "Normal completion status".
Value
0001(ON)
0000(OFF)
Status
Normal completion transmission
Abnormal completion transmission or before data communication
Description
C24 that could receive data normally sent a response message (ACK message) to the target device to notice the normal completion.
• C24 that could not receive data normally sent a response message (NAK message) to the target device to notice the abnormal completion.
• Before data is communicated.
■
NEU.
NEU. indicates "Command message to be received/command message in processing".
NEU. is valid only when MC protocol (format 1 to 5), MODBUS slave (RTU), or MODBUS slave (ASCII) is set in the communication protocol setting.
This is in the OFF-status when an item other than MC protocol (format 1 to 5), MODBUS slave (RTU), or MODBUS slave
(ASCII) is set.
Value
0001(ON)
0000(OFF)
Status
Neutral
Command reception
Description
Waiting for command message to be received.
Command message is in process.
29
29 TROUBLESHOOTING
29.1 Checking Module Status
485
Checking transmission setting
Details of transmission settings can be monitored.
Window
Displayed items
Item
Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Test mode setting
Communication speed setting
Communication protocol
Station number setting
MODBUS station number
Description
Independent, Interlink
7, 8
None, Yes
Odd, Even
1, 2
None, Yes
Disable, Enable
Disable, Enable
No specification, Hardware test, Self-loopback test
1200, 2400, 4800, 9600 ,14400 ,19200 ,28800 ,38400, 57600, 115200, 230400 (bps)
MELSOFT Connection, MC protocol (format 1 to 5), Predefined protocol, Nonprocedural protocol, Bidirectional protocol, For interlink operation setting, MODBUS Slave (RTU), MODBUS Slave (ASCII), Simple CPU
Communication
The communication protocol is valid when the test mode setting is set to "No specification".
0 to 31
1 to 247
The MODBUS station number is valid when the communication protocol is set to "MODBUS Slave."
If it is invalid, '0' is displayed.
486
29 TROUBLESHOOTING
29.1 Checking Module Status
Intelligent function module monitor
Check the status information of C24 on the "Intelligent Function Module Monitor" screen.
For details of the "Intelligent Function Module Monitor" screen, refer to the following manual.
GX Works3 Operating Manual
RS-232 control signal status reading method
The following shows how to read the control signal status stored in the buffer memory during communication using RS-232 interface.
This is a read operation to check the signal ON/OFF status of the RS-232 interface when a transmission problem occurs.
■
RS-232 control signal status (Un\G596/612)
The RS-232 control signal status is stored as follows:
Buffer memory a address
Un\G593 b15
Un\G612 to
0
0 b6 b5
1/0 b4 b3
1/0 1/0 b2
1/0 b1
1/0 b0
1/0 (Information on the CH1 side)
1/0 1/0 1/0 1/0 1/0 1/0 (Information on the CH2 side)
1: ON
0: OFF
RS(RTS)
DR(DSR)
ER(DTR)
CD(DCD)
CS(CTS)
CI(RI)
• Remarks
For details on signals for RS-232, refer to the following section.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
Signals output from the C24 side (RS(RTS) and ER(DTR)) are controlled by the system (operating system) of C24. They cannot be directly controlled by the program.
A lag of 100 ms at maximum occurs in the signal status stored in the buffer memory above.
29
29 TROUBLESHOOTING
29.1 Checking Module Status
487
Data communication status (transmission sequence status) reading method
The following shows how to read the current data communication status using the MC protocol stored in the buffer memory.
This read processing is for checking the data communication status using the MC protocol when a transmission problem occurs.
■
Transmission sequence status (Un\G597/613)
The status of data communication using the MC protocol is stored as a numeric value as shown below.
b15 to b6
Buffer memory address
Un\G597
0 to 9
0 to 9
(Information on the CH1 side)
Un\G613 (Information on the CH2 side)
The following shows the correspondence between the numerical values in the transmission sequence status storage area and the data communication status.
Request from a target device
Target device
E
N
Q Station number
HL
Message wait
ACK or
NAK
Request to CPU
C24
Response from
CPU
"6" "1"..."6" is repeated afterward.
Stored value
0 1
2
3 4 5 6
Values 7 to 9 are stored when "mode switching" or "initialization of transmission sequence" is performed.
• Remarks
When the target interface is not set to use the MC protocol, '0' is stored in the 'Transmission sequence status' (Un\G597/613).
488
29 TROUBLESHOOTING
29.1 Checking Module Status
Current operation status reading method
The following shows how to read the current operation status of C24.
For details on the contents of each parameter setting, refer to the following manual.
■
Operation mode status storage area
The current operation status of C24 is stored in the following buffer memory areas.
• Station number (instruction setting) (Un\G591) b15
Buffer memory address Un\G591
• Communication protocol status (Un\G594/610) to
0 to 31
Buffer memory address
Un\G594
Un\G610 b15 to
0 to B
0 to 7,9 to B b0
(Station number) b0
(Information on the CH1 side)
(Information on the CH2 side)
Mode number currently operating
• Transmission setting status (Un\G595/611)
Buffer memory address
Un\G595
Un\G611 b15 to b12 b11 b10
1/0 1/0 b9
1/0 b8 b7
1/0 1/0 b6 b5
1/0 1/0 b4
1/0 b3
1/0 b2
1/0 b1
1/0 b0
1/0 (Information on the CH1 side)
1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 (Information on the CH2 side)
For system Communication rate setting
Operation setting
Data bit setting
Parity bit setting
Odd/even parity setting
Stop bit setting
Sum check code setting
Online change setting
Setting modification enable/disable setting
For the correspondence table for the communication speed setting, see the table below.
1: ON, 0: OFF b11 b10 b9 Communication speed setting
1200 bps
2400 bps
4800 bps
9600 bps
14400 bps
19200 bps
28800 bps
38400 bps
57600 bps
115200 bps
230400 bps
1
1
0
0
0
0
0
0
1
1
1
0
0
1
1
1
1
0
0
0
0
1
0
0
1
1
0
0
1
1
1
1
0
• MODBUS station number confirmation (Un\G31750) b8
0
1
0
1
0
1
0
1
0
1
0
Buffer memory address Un\G31750 b15 to
(Information on the CH2 side) b8 b7 to
(Information on the CH1 side) b0
0: The MODBUS slave function is not used.
1 to 247: MODBUS station numbers currently set
29
29 TROUBLESHOOTING
29.1 Checking Module Status
489
Check method for the communication status of the MODBUS slave function
The following explains the check method for the communication status of the MODBUS slave function.
When using the MODBUS slave function, the number of error occurrences during communication is stored in the buffer memory.
The communication status can be checked by reading the counter of the number of error occurrences by either of the following method:
• Checking in the "Intelligent Function Module Monitor" screen
• Accessing from a master device with any of the MODBUS standard functions (FC: 08H) (
Counter
Type
Bus message
Bus communication
Exception error count
Slave message count
Slave no-response count
Slave NAK count
Slave busy count
Character overrun count
Message discard count
Data discard count
Failed transmission count
Description
Counts the number of messages detected on the line.
Buffer memory MODBUS standard function
CH1 CH2 Function name
32512
(7F00H)
32513
(7F01H)
32576
(7F40H)
32577
(7F41H)
Return bus message count
Return bus communication error count
Counts the number of the following error messages detected on the line.
• CRC/LRC error message
• Overrun/parity error
• Short frame (less than 3 bytes)
• Character overrun (256 bytes or more)
Messages other than the above are counted by the bus message count.
Counts the number of exception error occurrences.
(Including broadcast messages)
Counts the number of times that messages addressed to the host were processed.
(Including when broadcast request messages were received)
Counts the number of times that broadcast request messages were received.
Refers to the number of times that NAK responses were received in a master device.
It is always '0' in RJ71C24s.
Refers to the number of times that busy responses were received in a master device.
It is always '0' in RJ71C24s.
Counts the number of times that the request message size exceeded the upper limit.
32522
(7F0AH)
32518
(7F06H)
32519
(7F07H)
32520
(7F08H)
32521
(7F09H)
32514
(7F02H)
32586
(7F4AH)
32582
(7F46H)
32583
(7F47H)
32584
(7F48H)
32585
(7F49H)
32578
(7F42H)
32579
(7F43H)
Return bus exception error count
Return slave message count
Return slave no response count
Return slave NAK count
(0000H is always returned.)
Return slave busy count
(0000H is always returned.)
Return bus character overrun count
Return IOP overrun error count
Counts the number of times that request messages were discarded when a request message was being processed by a slave or a request message to another station was received.
Counts the number of times that improper data (such as a request message the data structure of which does not comply with the frame specifications) was discarded.
Counts the number of times that transmission of response messages failed.
32515
(7F03H)
32516
(7F04H)
32517
(7F05H)
32580
(7F44H)
32581
(7F45H)
Code
08H (0BH)
08H (0CH)
08H (0DH)
08H (0EH)
08H (0FH)
08H (10H)
08H (11H)
08H (12H)
08H (13H)
*1 The bus message count is in an exclusive relationship with the bus communication error count.
490
29 TROUBLESHOOTING
29.1 Checking Module Status
■
Count range
0000H to FFFFH are counted.
The count is stopped if it has reached FFFFH. To continue, clear the counter.
■
Methods for clearing a counter
A counter can be cleared by any of the following methods:
• Turning the power OFF and ON
• Resetting a CPU module
• Clearing the buffer memory to '0' by using a sequence program
• Receiving any of the following MODBUS standard functions:
MODBUS standard function
Clear counters and diagnostic register
Restart communications option
Clear overrun counter and flag
Counter that can be cleared
08H (0AH) • Bus message count
08H (01H)
• Bus communication error count
• Exception error count
• Slave message count
• Slave no-response count
• Character overrun count
08H (14H) Character overrun count
Error information clear
This section explains the factors causing the ERR LED to be turned ON and the error code initialization (clear) for C24.
Factors causing ERR LED to turn ON
When any of the following errors occurs, its error code is stored in the buffer memory corresponding to the interface (CH) where the error occurred, and the ERR LED turns ON.
The meanings of abbreviations in the table are as follows:
• MC: MC protocol
• Non: Nonprocedural protocol
• Bi: Bidirectional protocol
• Pd: Predefined protocol
• MD: MODBUS (slave function)
• S: Simple CPU communication
Error factor Error code storage buffer memory
Address Name
CH1
Un\G515
CH2
Parameter setting error, mode switch error status
Applicable protocol
MC Non Bi Pd
MD S
Parameter setting error
Mode switching error
On-demand execution error
Data transmission error
Data reception error
Modern function error
MC protocol send error
Monitoring device error
Predefined protocol function error
MODBUS send/receive error
Un\G598
Un\G599
Un\G600
Un\G545
Un\G602
Un\G8709
Un\G16450
Un\G28674
Un\G614
Un\G615
Un\G616
Un\G618
Un\G8965
Un\G16466
Un\G28676
On-demand execution results
Data transmission result
Data reception result
Modern function error code
MC protocol send error code
Programmable controller CPU monitoring function execution result
Predefined protocol function error code
Exception code storage area
29
29 TROUBLESHOOTING
29.1 Checking Module Status
491
Factors causing ERR LED to flash
When any parameter error was detected, the ERR LED flashes, and the buffer memory address which is set out of the range of the parameter setting value is stored in the error address storage area (Un\G20224 to 20231).
Turning OFF the ERR LED and initializing the error codes
Turn 'Error initialization request' (YE) ON to turn the ERR LED OFF and initialize the error code.
• The buffer memory, which is a factor in turning the LED ON, is initialized.
• The protocol execution logs are not initialized.
Individual station test
When a problem occurs during data communication with a target device, perform an individual station test to check whether or not there is any problem in the operation of C24.
The individual station test consists of the following two tests:
• Hardware test
• Self-loopback test
Precautions
• To prevent any problems from occurring, set the CPU module in the STOP state during the individual station test.
• When either one of the interfaces needs to be tested, disregard the test result for the other interface.
• Cable removal and reconnection before and after the self-loopback test should be performed with the power to the station with C24 turned OFF.
• Before starting data communication with the target device after the individual station test, configure the respective setting and connect the cable by checking the specifications for the functions to be used.
• Do not execute the firmware update, when an individual station test is being performed.
• If an error occurs even though the settings have been configured correctly for C24 through an individual station test, please consult your local Mitsubishi representative, explaining a detailed description of the problem.
492
29 TROUBLESHOOTING
29.1 Checking Module Status
Hardware test
The hardware test is a test to check the memory of C24.
Perform the hardware test according to the procedure described below.
Operating procedure
1.
Test mode setting (
• Set the test mode setting to "Hardware test".
• Configure all of the transmission settings and communication speed setting for the two interfaces according to the transmission specifications for data communication with a target device.
• Set the CPU module to the STOP state, and write the parameters.
2.
Performing hardware test
By restarting or resetting the CPU module, the test starts automatically in approximately one second. The RUN LED flashes during the test. (Set the CPU module in the STOP state.)
3.
Checking results of hardware test
• When the result is normal
The RUN LED turns ON and the ERR LED turns OFF.
• When the result is abnormal
The RUN LED turns ON and the ERR LED turns ON.
4.
Completing hardware test
• When the result is normal
Perform an Self-loopback test. (
Page 494 Self-loopback test)
Start data communication with the target device according to the following procedure.
Configure the parameter settings with Engineering tool. (
Turn OFF the power for the station with C24, and connect the cable to communicate with the target device.
Turn ON the power for the station with C24.
• When the result is abnormal
Check error contents on the items below on the "Intelligent Function Module Monitor" screen of Engineering tool.
Check the error descriptions on the screens by bit-decoding the monitored value (16-bit integer). Each bit corresponds to the following error description.
Buffer memory to be monitored
Bit position Address b0 b1
CH1 side: Un\G513
SIO b2 b3
PRO
P/S
CH2 side: Un\G514
Description when corresponding bit is ON
When interlink operation is set
When independent operation is set
Transmission setting error
Protocol setting error
Transmission setting error
Protocol setting error
Corrective action
Check the parameter setting and perform the test again.
b4 b5 to b6 b7 b8 to b13 b14 b15
C/N
NEU
CH1 ERR
CH2 ERR
Test completed
RAM error
ROM error
Check the module installation status and
*1 When an error occurs even after performing the test again, please consult your local Mitsubishi representative.
29
29 TROUBLESHOOTING
29.1 Checking Module Status
493
Self-loopback test
The self-loopback test is a test to check the communication between C24 and the CPU module and the operation of the data transmit/receive function of C24.
Perform the self-loopback test according to the procedure below.
Operating procedure
1.
Connecting cable
• Connect cables to two interfaces as follows:
For the RS-232 interface, connect cables within the connector and install it to the interface.
For the RS-422/485 interface, connect cables on the terminal block.
RS-232 interface (D-Sub 9P female) RS-422/485 interface
Signal name
C24
Pin No.
Cable connection
C24
Cable connection
Signal name
CD(DCD) 1
SDA
RD(RXD) 2
SDB
SD(TXD) 3
ER(DTR)
4 RDA
SG 5
6
RDB
DR(DSR)
SG
RS(RTS) 7
SLD
CS(CTS)
8
CI(RI)
9 FG
2.
Test mode setting (
• Set the test mode setting to "Self-loopback test".
• Configure all of the transmission settings for the two interfaces according to the transmission specifications.
• Set the CPU module to the STOP state, and write the parameters.
3.
Performing the self-loopback test
• By restarting or resetting the CPU module, the test starts automatically in approximately one second. The RUN LED flashes during the test. (Set the CPU module in the STOP state.)
• C24 performs the following tests in sequence and repeat them (one test cycle takes approximately one second).
C24 ends the test when all test results become abnormal.
Test item
Checking communication with CPU module
Checking the transmit/receive function of interface
Description
Read and check the CPU module model.
Send and receive data by changing data.
LED flashes during the test
RUN LED
SD LED
RD LED
4.
Checking the results of self-loopback test
• When the result is normal
This test is performed repeatedly. When the ERR LED is OFF, C24 is operating normally.
• When the result is abnormal
The ERR LED turns ON.
494
29 TROUBLESHOOTING
29.1 Checking Module Status
5.
Completing self-loopback test
• When the result is normal
Start data communication with the target device.
Configure the parameter settings with Engineering tool. (
Turn OFF the power for the station with C24, and connect the cable to communicate with the target device.
Turn ON the power for the station with C24.
• When the result is abnormal
Check an error description on the "Intelligent Function Module Monitor" screen of Engineering tool.
Check the error descriptions on the screens by bit-decoding the monitored value (16-bit integer). Each bit corresponds to the following error description.
Buffer memory to be monitored
Bit position Address b0 to b3 b4
CH1 side: Un\G513
C/N
CH2 side: Un\G514
Description when corresponding bit is ON
Error occurred on the CPU module.
Corrective action b5 to b13 b14 b15
CH1 ERR
CH2 ERR
The power supply capacity is insufficient.
Module is not mounted correctly.
Error on the base unit, extension cable, CPU module, or C24 occurred.
CH2 side communication error
CH1 side communication error
Remove the cause of error in the CPU module.
Review the power supply capacity.
Mount the module properly.
Check for each module and remove the cause of the error.
Reconnect the cable correctly.
Mount the module properly.
Reconnect the cable correctly.
Review the test wiring connection.
29
29 TROUBLESHOOTING
29.1 Checking Module Status
495
Loopback test
A loopback test is a test to perform communication with the loopback test function of the MC protocol in order to check the connection between C24 and the target device, the communication function of each device, and the operation of the communication program of the target device.
Operating procedure
1.
Connecting C24 to a target device
Turn OFF the power for the station with C24 and connect a communication cable to communicate with the target device in order to perform data communication using the MC protocol.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
2.
Setting the parameter with Engineering tool
• Configure the parameter settings with Engineering tool, and write the parameters to the CPU module in order to perform data communication using the MC protocol.
• The following shows an example of the settings when performing the loopback test on the interface on the CH1 side.
Parameter setting item
Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Setting contents
MC protocol (Format 1)
9600 bps
Independent operation
7
Yes
Odd
1
Yes
Disable
Disable
0 Station number setting
3.
Performing loopback test
• By restarting or resetting the CPU module, the communication is enabled in approximately one second. (Set the CPU module in the STOP state.)
• Create a program for the loopback test on the target device side and send a command message as shown below to C24.
For communication test with 1C frame: TT command
For communication test with 2C/3C/4C frame
*1
: 0619 command
*1 When performing communication test with 2C/3C/4C frame, refer to the following manual.
MELSEC Communication Protocol Reference Manual
496
29 TROUBLESHOOTING
29.1 Checking Module Status
An example of control procedure when the TT command is used in the loopback test (station number: 00, sum check code:
Yes) is as shown below.
TT (ACPU common command)
Head data sent by the target device
Two characters (hexadecimal): Designate the number of characters (1 to 254) of return data to be sent immediately afterward.
Designate with a character string consisting of "0" to "9" and "A" to "F" (upper case)
(Data name)
Target device
(Example)
(Data name)
E
N
Q
Loopback data
The same data as those in Character length
Sum check code
(In the case of Format 1)
Two characters (hexadecimal)
H L H L H L
0 0 F F T T 0 0 5
H
A B C D E 7
05
H
30
H
30
H
46
H
46
H
54
H
54
H
30
H
30
H
35
H
41
H
42
H
43
H
44
H
45
H
37
H
Character part
L
8
38
H
S
T
X
Loopback data
The same data as those in character
A part
E
T
X
Sum check code
CPU module
The same data
(Example)
H L H L H L
0 0 F F 0 5 A B C D E
H
A
L
3
02 H 30 H 30 H 46 H 46 H 30 H 35 H 41 H 42 H 43 H 44 H 45 H 03 H 41 H 33 H
Head data to be sent by the CPU module side
Character part
4.
Checking loopback test result
Check for the target device side whether the data in the character area received from C24 in response to the data sent by the target device matches the data in the character area sent by the target device. (C24 sends back to the target device the received data, as is.)
• When the result is normal
The data in the character area that C24 sent back to the target device matches the one the target device had sent.
• When the result is abnormal
The data in the character area that C24 sent back to the target device does not match the one the target device had sent.
5.
Completing loopback test
• When the result is normal
Configure the parameter settings with Engineering tool in accordance with the function to be used, and turn ON the power for the station with C24 to start data communication.
• When the result is abnormal
Check the items below, and take corrective actions.
Item
Reviewing the wiring of the connection cable
Reviewing the parameter setting of
C24
Check the detected error of C24
Corrective action
Check if the connection cable is wired correctly.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
Check whether the C24 parameter settings (such as transmission setting and communication speed setting) match that of the target device.
Check the error contents and take the corrective actions.
29
29 TROUBLESHOOTING
29.1 Checking Module Status
497
29.2
How to Clear Programmable Controller CPU
Information
This section explains how to clear the programmable controller CPU information.
Programmable controller CPU information
• This is the information about the access target CPU module type used for communications using MC protocol and the
MODBUS slave function.
C24 obtains this information from the access target CPU module at the time of initial access, and stores it.
When accessing for the second time or later, the processing to access to the CPU module get faster in accordance with this information.
• The programmable controller CPU information is cleared in the following cases:
When the programmable controller is powered OFF ON, or when the CPU module is reset
When the programmable controller CPU information clear request is executed
If the programmable controller CPU information has not been correctly obtained
The following problems may occur:
• Accessible device range become narrowed. (Error code: 7140H)
• Some of commands and/or devices cannot be used. (Error code: 7142H, 714DH), etc.
In the above case, execute the programmable controller CPU information clear request.
If initial access is made at startup of the access target CPU module or while the network is unstable, the programmable controller CPU information may not be correctly acquired.
Operation of the programmable controller CPU information clear request
• Write "4C43H" to the 'Programmable controller CPU information clear request' (Un\G128). (Set by the user) b15 to b0
Buffer memory address Un\G128 (Default: 0000H)
Write 4C43H
0000H: No request (Set by C24)
4C43H: Requested
• The programmable controller CPU information clear processing of C24 is performed.
*1
• Upon completion of the clear processing, "0000H" is written to the 'Programmable controller CPU information clear request'
(Un\G128). (Set by the C24)
Clear request
Buffer memory address Un\G128 0000
H
4C43
H
Clear processing
*1 The 'Transmission sequence status' (Un\G597/613) is also initialized.
0000
H
498
29 TROUBLESHOOTING
29.2 How to Clear Programmable Controller CPU Information
Executing the programmable controller CPU information clear request
1.
In the "Intelligent Function Module Monitor" screen, set "4C43H" to the 'Programmable controller CPU information clear request' (Un\G128).
2.
Check the 'Programmable controller CPU information clear request' (Un\G128) turns to "0000H" with the Buffer Memory
Batch Monitor function.
Precautions
• Execute the programmable controller CPU information clear after communication with the target device is stopped. In addition, do not perform data communication with the target device during the programmable controller CPU information clear processing. (If any data are received from the target device during the programmable controller CPU information clear processing, the data will be discarded.)
• When a modem is connected, cut off the line linked with the target device before executing the programmable controller
CPU information clear. (The line is cut off at execution of the programmable controller CPU information clear.)
• Do not execute the UINI instruction during the programmable controller CPU information clear processing. If the programmable controller CPU information clear is attempted during execution of the UINI instruction, the clear processing will be executed after completion of the UINI instruction.
29
29 TROUBLESHOOTING
29.2 How to Clear Programmable Controller CPU Information
499
29.3
Troubleshooting by Symptom
The troubleshooting for any troubles generated during communication between C24 and the target device by trouble symptom are as shown below.
When any trouble occurs, check on the C24 condition at first, and check the relevant item in the table below.
Symptom Symptom description
Communication via modem
The programmable controller
CPU monitoring function does not operate in the specified cycle
Page 502 SD LED does not flash even after a send request was made
Page 502 RD LED does not flash even though the target device is transmitting a message
Page 508 The target device transmitted a message and the
RD LED flashes, but a time-out error (7A00H) occurs.
Communication error occurred
Page 511 Hardware information communication error "SIO" occurs *2
Page 512 Hardware information communication error "PRO." occurs *2
Page 513 Hardware information communication error "P/S" occurs *2
Page 513 Hardware information communication error "C/N" occurs
Page 514 Hardware information communication error "NAK" occurs *2
Page 514 Communication is intermittent
Page 515 Undecodable data are transmitted or received
Page 516 Whether the communication error is caused on
C24 or target device is unclear
Page 516 Communication is not established via modem
Page 517 Communication is not established with the ISDN sub-address when using a modem
Page 517 Fixed cycle send is not performed normally
Page 517 Condition match send is not performed normally
Page 517 Data cannot be received by an interrupt program
Data cannot be received by an interrupt program
The initial setting cannot be configured
Page 518 Data cannot be written to flash ROM
Protocol
MC Non
Bi
Pd
MD
S
*1 For details on LED status, refer to the following manual.
MELSEC iQ-R Serial Communication Module User's Manual(Startup)
*2 For details on how to check the hardware information communication error, refer to the following section.
Page 483 Checking error status
*3 If an error occurs while performing data communication using the modem function, first check the following items and determine whether or not the error is caused by the modem/TA connection.
If an error relating to the modem function occurred, take necessary corrective actions according to the reference sections shown below:
Check of the ON/OFF status of current input/output signals on C24
Check of the error code storage status for the modem function
Check of the ON/OFF status of the DR terminal on the modem/TA (Refer to the instruction manual for modem/TA.)
500
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
Precautions
The considerations for data communication with the target device via either of C24 interfaces are shown below:
• When powering up the C24 side or the target device side, data reception error may occur at the target device side being connected.
• When the connected target device side starts up during data transmission, the data reception error occurs at the target device side.
• When the ERR LED on C24 turns ON due to data reception error, turn OFF the LED as necessary. (
OFF the ERR LED and initializing the error codes)
Also, when a data reception error occurs on the target device side, take corrective actions in accordance with the instruction manuals for the target device.
■
Error occurred on the C24 side
Handle the error as shown below when data reception error occurs on C24 side.
• For communications using the MC protocol
C24 will disregard the received data or return a response message indicating an abnormal completion if it detects a data reception error after receiving the head data of the command message in the set format.
If the data reception error is detected before the head data of the command message in the set format is received, the received data will be disregarded.
• When communicating using the predefined protocol
C24 will store the error code in the 'Data reception result' (Un\G600/616) when a data reception error occurs.
Reception error can be also checked with the send/receive data monitoring function.
Take appropriate measures such as detecting a data reception error or clearing the received data, if necessary.
For more details on the send/receive data monitoring function, refer to the following section.
(
Page 419 USING SEND/RECEIVE DATA MONITORING FUNCTION)
• When communicating using nonprocedural protocol
C24 will turns ON the reception abnormal detection (X4/XB) when it detects a data reception error.
Take appropriate measures such as detecting a data reception error or clearing the received data, if necessary.
(
Page 68 Reception error detection and check methods,
• For communications using bidirectional protocol
C24 will return a response message indicating an abnormal completion if it detects a data reception error after receiving the head data of the communication message for the bidirectional protocol.
If the reception error is detected before the head data of the communication message for the bidirectional protocol is received, the received data will be disregarded.
• When communicating using the MODBUS slave function
C24 will disregard received data if it detects a CRC or LRC error during data reception.
When using RTU mode, send request data as continuous data from a connected target device.
If no-reception time occurs for 1.5 character times or more before all data is received, C24 will disregard received data and regard the head data of data received next as a new address field.
When using ASCII mode, if there is no-reception time for one second or more, an error will occur.
• When communicating using the simple CPU communication function
C24 will discard received data if it detects a reception error during data reception.
■
Meaning of abbreviations in "Protocol" column
MC: MC protocol
Non: Nonprocedural protocol
Bi: Bidirectional protocol
Pd: Predefined protocol
MD: MODBUS (slave function)
S: Simple CPU communication
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
501
SD LED does not flash even after a send request was made
Symptom
SD LED does not flash even after a send request was made.
Cause
The CS(CTS) signal is in the OFF-state, and C24 cannot transmit data to the external device.
Due to the transmission control (DTR control, DC control), the external device cannot receive data.
Corrective action
• While the CS(CTS) signal is OFF, C24 does not transmit data to the target device.
Connect so that it is constantly ON when the target device is ready to receive data.
• Wait until the external device is ready to receive data.
• Check the external device or the cable condition when it takes too long for the external device to be ready to receive data.
MC No n
Bi
RD LED does not flash even though the target device is transmitting a message
Pd MD S
Symptom
RD LED does not flash even though the target device is transmitting a message.
Cause
Signal lines are not connected correctly.
The transmission control signals on the target device side have not turned ON.
If the message passes through a modem or others, the signal is interrupted at the side of device relaying the message.
Corrective action
• Cross-connect the RD(RXD) and SD(TXD) signals between C24 and the target device.
• When using MX Component, match the port opened by the OPEN statement of the target device with the cable connection port.
• Connect the wiring so that the transmission control signals including DR(DSR) and CS(CTS) are ready.
■ Remarks
The Specifications of control signal vary depending on the device. Perform the wiring in accordance with the instruction manual of the device used.
• Check the specification of the modem to review the settings and wiring, and correct them if necessary.
MC No n
Bi
Pd MD S
502
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
No response message is returned even though the target device transmitted a message and the RD LED flashes
Symptom Bi Pd MD S
The target device transmitted a message and the RD LED flashes, but C24 does not return the response message.
Cause Corrective action
Communication protocol setting is incorrect.
The CD terminal has been turned OFF when the CD terminal check is enabled.
The header byte of the message is not data needed for the set protocol and format.
• Review the communication protocol setting.
• Review the program whether unintended mode switching is performed when the buffer memory mode switching area is used for mode switching.
■ Remarks
The communication protocol setting contents and the communication protocol currently in operation can be checked at the following addresses.
• 'Communication protocol status (parameter setting)'
(Un\G592/608) set by the parameter
• 'Communication protocol status (current)' (Un\G594/
610) currently in operation
• Change the wiring so that the CD terminal remains
ON all the time.
C24 station number setting and message station number designation do not match.
The MODBUS station number and the slave station number of a
MODBUS message do not match.
The C24 data communications monitoring time is set to
"Unlimited wait", or the monitoring time is too long.
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and take the following corrective actions.
• If the format of message sent from the target device does not match with the respective protocol and format, correct the massage format according to the relevant protocol and format used.
■ Remarks
C24 skips all the messages transmitted until the header byte specified for each protocol and format (for example, "ENQ(05H)" for format 1) is received.
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and take the following corrective actions.
• Match the station number setting of C24 with the station number designation of the message.
■ Remarks
C24 performs the data reception processing when the station No. designation is the host station after the header byte specified for each protocol and format is received.
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and match the MODBUS station number of C24 with the station number designation of the message.
• Set or shorten the monitoring time and retransmit the message from the target device and determine the trouble from the contents of the time-out error.
■ Remarks
Error detection by the monitoring time (timer 0 to timer
2) is possible in the following cases.
• When part of a message is skipped.
• When transmission from the target device is interrupted.
• A link error occurred while accessing another station via CC-Link IE TSN, CC-Link IE Controller Network,
CC-Link IE Field Network, MELSECNET/H, or
MELSECNET/10.
For details of the monitoring time, refer to the following manual.
Page 259 CHANGING DATA COMMUNICATION
MC No n
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
503
Symptom
The target device transmitted a message and the RD LED flashes, but C24 does not return the response message.
Cause Corrective action
The route setting of the access target CPU module is incorrect.
The CPU response monitoring time of the C24 is too long when using the
MODBUS slave function.
When using the MODBUS slave function, "Master
Station" is selected for
"Access target" in "CC-
Link IEF Remote Head
Module" and a Q series
CPU module is accessed.
"Communication data reception enable/disable designation" in the module parameter is set to
"Receive disable."
• Check the route of the access target CPU module, and set the route again.
• Shorten the CPU response monitoring time and send the message again from the target device, and identify the cause of the error from the contents of the timeout error.
• When accessing a Q series CPU module via CC-Link
IE Field Network, the first communication is delayed for a CPU response monitoring timer value. Shorten the CPU response monitoring time as necessary.
• Change the setting in the module parameter to
"Receive enable" or 'Communication data reception enable/disable designation' (Un\G292/452) to
'Receive enable' (0).
MC No n
Bi
Pd MD S
504
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
Read request signal does not turn ON even though the target device transmitted a message and the RD LED flashes
Bi Pd MD S Symptom Cause Corrective action
The target device transmitted a message and the RD LED flashes, but
'CH Reception data read request' (X3/XA) does not turn ON.
Communication protocol setting is incorrect.
The CD terminal has been turned OFF when the CD terminal check is enabled.
When DC control is selected, the necessary DC codes are not transmitted.
The end code has not been received, or the fixed length data has not been received.
The C24 setting and message format do not match.
• Review the communication protocol setting.
• Review the program whether unintended mode switching is performed when the buffer memory mode switching area is used for mode switching.
■ Remarks
The communication protocol setting contents and the communication protocol currently in operation can be checked at the following addresses.
• 'Communication protocol status (parameter setting)' (Un\G592/608) set by the parameter
• 'Communication protocol status (current)'
(Un\G594/610) currently in operation
• Change the wiring so that the CD terminal remains
ON all the time.
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and take the following corrective actions.
• During DC1/DC3 control, if the target device transmits 'DC3(13H)' and interrupts the transmission processing of C24, transmit
'DC1(11H) at first and then the next message after the transmission processing of C24 resumed.
• During DC2/DC4 control, if the target device transmits the next message without adding
'DC2(12H)' after transmitting 'DC4(14H)', transmit a message with 'DC2(12H) added.
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and take the following corrective actions.
• Match the end code set by the receive end code designation of C24 with the one sent from the target device.
• Match the data quantity set by the receive end data quantity of C24 with the data length sent from the target device.
• For communication with the user frame, send the message with the final frame added to the end from the target device.
■ Remarks
When proper data are being transmitted from the target device, take the corrective action by referring to the troubleshooting below.
•
Page 511 Hardware information communication error "SIO" occurs
•
The interpretation of data count, or message format, etc. varies depending on the settings below. Review the settings of each item and the operation by the settings in accordance with the relevant descriptions.
• ASCII-BIN conversion enable/disable
• Transparent code setting
• User frame setting
MC No n
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
505
Symptom Cause Corrective action
The target device transmitted a message and the RD LED flashes, but
'CH Reception data read request' (X3/XA) does not turn ON.
The C24 data communications monitoring time is set to "Unlimited wait", or the monitoring time is too long.
"Communication data reception enable/disable designation" in the module parameter is set to "Receive disable."
• Set or shorten the monitoring time and retransmit the message from the target device and determine the trouble from the contents of the time-out error.
■ Remarks
In the cases below, errors can be detected by setting each monitoring time (timer 0 to 2).
• When part of a message is skipped.
• When transmission from the target device is interrupted.
For details of the monitoring time, refer to the following manual.
Page 259 CHANGING DATA COMMUNICATION
• Change the setting in the module parameter to
"Receive enable" or 'Communication data reception enable/disable designation' (Un\G292/
452) to 'Receive enable' (0).
MC No n
Bi
Pd MD S
506
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
The CPRTCL instruction execution is not completed although the
RD LED flashes, or a receive wait timeout error (7D13H) occurs
Bi Pd MD S Symptom
When the CPRTCL instruction was executed for the protocol with the communication type set to
"Receive Only" or "Send &
Receive," the RD LED flashes but the instruction execution is not completed, or a receive wait timeout error (7D13H) occurs.
Cause
Incorrect protocol number is specified in the control data.
The CD terminal has been turned OFF when the CD terminal check is enabled.
The user-edited protocol setting with the Predefined protocol support function of
Engineering tool is inconsistent with the packet format of the target device.
C24 has not received the expected packet.
Corrective action
• Review the protocol number specified in the control data for the CPRTCL instruction.
• Change the wiring so that the CD terminal remains
ON all the time.
Check the packet format of the target device, and review the protocol setting.
• In the packet setting, are the element type and element order incorrect?
• Is each element setting item (Code type, Data length, Data flow, Calculating range, etc.) incorrect?
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and correct the message if it's incorrect.
When proper data are being transmitted from the target device, take the corrective action by referring to the troubleshooting below.
•
•
Page 514 Communication is intermittent
• When data may be received before protocol execution, unselect the checkbox for "Clear OS area (receive data area) before protocol execution" on the "Protocol Detailed Setting" screen of
Engineering tool predefined protocol support function.
C24 has cleared the data received before the protocol execution. (On the
"Protocol Detailed Setting" screen of Engineering tool predefined protocol support function, "Clear receive data before protocol execution" is designated.)
The C24 data communications monitoring time is set to "Unlimited wait", or the monitoring time is too long.
"Communication data reception enable/disable designation" in the module parameter is set to
"Receive disable."
• Perform cancel processing to complete the
CPRTCL instruction execution.
• Set or shorten the monitoring time and retransmit the message from the external device and determine the trouble from the contents of the timeout error.
■ Remarks
In the cases below, errors can be detected by setting the receive wait time for the "Receive Setting" on the
"Protocol Detailed Setting" screen of Engineering tool predefined protocol support function.
• When part of a message is skipped.
• When transmission from the target device is interrupted.
• Change the setting in the module parameter to
"Receive enable" or 'Communication data reception enable/disable designation' (Un\G292/452) to
'Receive enable' (0).
MC No n
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
507
The target device transmitted a message and the RD LED flashes, but a time-out error (7A00H) occurs.
Bi Pd MD S Symptom Cause
The target device transmitted a message and the RD LED flashes, but a time-out error (7A00H) occurs.
"Various control specification" in the module parameter is incorrect.
"Communication data reception enable/disable designation" in the module parameter is set to
"Receive disable."
Corrective action
• Review the settings in "Various control specification" in the module parameter according to the settings of a communication destination.
• Change the setting in the module parameter to
"Receive enable" or 'Communication data reception enable/disable designation' (Un\G292/452) to
'Receive enable' (0).
MC No n
RUN LED turns OFF
Symptom Cause Corrective action
RUN LED on C24 turns
OFF
The module is not mounted properly.
Power module 5 VDC consumption current is insufficient.
Extraneous noise causes abnormal operation of C24.
• Mount the C24 on the base unit properly.
• Calculate the 5 VDC consumption current of each mounted module. If the current capacity is insufficient, review power module selection.
• Review the wiring so that the shield is single-point grounded.
• When ground is used with other devices, ground the C24 independently.
ERR LED flashes
MC No n
Bi
Pd MD S
Symptom Cause Corrective action
ERR LED flashes.
The communication protocol setting or transmission setting is incorrect.
The parameter settings are incorrect.
• Read the error code from the buffer memory, and check the error contents and change to the correct setting.
Parameter setting error
• Review the parameter settings with Engineering tool. Then, write the parameter settings to the CPU module, and reset it.
• Review each settings for the parameters set in the buffer memory, and turn ON the 'CH mode switching request' (Y2/Y9). For more details on
'CH mode switching request', refer to the following section.
(
Page 413 I/O Signals for Handshake with
• Write the protocol setting data for MELSEC iQ-R series C24 to the CPU module.
• Remarks
The error code when ERR LED flashes is stored in the buffer memory shown below.
Error factor
The protocol setting data stored in the CPU module is not for MELSEC iQ-R series C24.
Error code storage buffer memory
Address
CH1
Un\G515
CH2
MC No n
Name
Parameter error
(Module parameter)
Un\G20224 to 20231
Bi
Pd MD S
Parameter setting error, mode switching error status
Error address storage area
508
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
ERR LED turns ON
Symptom
ERR LED turns ON.
When the predefined protocol is executed, the
ERR LED turns ON.
Cause Corrective action
The online mode switching designation is incorrect.
The receive data clear request is executed during the dedicated instruction execution.
• Read the error code from the buffer memory, and check the error contents and correct the designation contents.
• Read the execution result (error code) of control data for the dedicated instruction of which the abnormal completion signal has turned ON, and take the corrective action corresponding the error contents.
• Write the data again to the flash ROM.
The power of C24 was turned OFF while writing to the flash ROM.
An error is detected.
The communication protocol setting is set to other than "Predefined protocol".
No protocol setting data has been written.
The protocol corresponding to the protocol number specified in the control data for the CPRTCL instruction is not registered.
• Check if any symptom corresponding to the troubleshooting by symptom occurs, and remove the cause of the error.
(
Page 500 Troubleshooting by Symptom)
• Set the communication protocol setting to
"Predefined protocol".
• Write the protocol setting data with the Predefined protocol support function of Engineering tool, and then execute the CPRTCL instruction.
• Read the protocol setting from C24 with the
Predefined protocol support function of Engineering tool.
• On the "Add Protocol" screen, check for the registered protocol and protocol No., and correct them if incorrect.
• Review the program so that the next CPRTCL instruction is executed once one CPRTCL instruction execution is completed.
Multiple CPRTCL instructions were simultaneously executed to the same channel.
Incorrect control data are specified for the CPRTCL instruction.
The edited protocol setting with the Predefined protocol support function of
Engineering tool is inconsistent with the packet format of the target device.
An expected packet has not been received, and the monitoring timeout error occurred.
Communication error occurred.
• Review the control data for the CPRTCL instruction.
• Check the error description with the System
Monitor function, and remove the cause of the error.
Check the packet format of the target device, and review the protocol setting taking the following into consideration.
• When a Conversion variable exists in the received packet, are conversion contents or the settings for sign character, number of decimals, or number of digits incorrect?
• When a check code exists in the received packet, are the processing method or the settings for code type, data length, data flow, complement calculation, or calculating range incorrect.
• When a Length exists in the received packet and a
Conversion variable is included in the calculating range of the Length, are the code type or the settings for data length, data flow, or calculating range incorrect?
• Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and correct it if the message is in correct.
MC No n
Bi
Pd MD S
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
509
• Remarks
The error code when ERR LED turns ON is stored in the buffer memory shown below.
Error factor
Modern function error
Monitoring device error
Error code storage buffer memory
Address
CH2 CH1
Un\G545
Un\G8709 Un\G8965
Name
Predefined protocol function error
MODBUS slave function error
Un\G16450
Un\G31998 to Un\G32255
Un\G16466
Modern function error
Programmable controller CPU monitoring function execution result
Predefined protocol function error code
MODBUS operating status
Error log
C ERR LED turns ON
Symptom Cause Corrective action
C ERR LED turns ON.
An error occurred during the on-demand execution.
C24 detected an error while transmitting data.
C24 detected an error while receiving data.
• Read the error code from the buffer memory, and check the error contents and correct the designation contents.
• Read the error code from the buffer memory, and take the corrective action corresponding to the error contents.
• Read the error code from the buffer memory, and take the corrective action corresponding to the error contents.
• Remarks
The error code when C ERR LED turns ON is stored in the buffer memory shown below.
Error factor
On-demand execution error
Data transmission error
Data reception error
Modern function error
MC protocol send error
Monitoring device error
Error code storage buffer memory
Address
CH1 CH2
Un\G598
Un\G599
Un\G600
Un\G545
Un\G602
Un\G8709
Un\G614
Un\G615
Un\G616
Un\G618
Un\G8965
MC No n
Bi
Name
Predefined protocol function error
MODBUS slave function error
Un\G16450
Un\G31998 to Un\G32255
Simple CPU communication function error
Un\G32872 to Un\G45159
Un\G16466
Pd MD S
On-demand execution results
Data transmission result
Data reception result
Modern function error code
MC protocol send error code
Programmable controller CPU monitoring function execution result
Predefined protocol function error code
MODBUS operating status
Error log
Diagnostic information area for simple CPU communication
Latest error code
510
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
Hardware information communication error "SIO" occurs
Bi Symptom Cause Corrective action
Hardware information communication error "SIO" occurs.
The stop bit settings do not match.
Transmission speed is too fast and the next data is transmitted before C24 completes processing of the receive data.
Data larger than the receive buffer size was received.
During multidrop connection, two or more devices transmitted data at the same time.
• Match the stop bit settings of C24 to that of the target device.
• Decrease the transmission speed and restart data communications.
• Use the DTR and DC controls to interrupt transmission before the buffer becomes full.
Perform RS/CS control when the modem function is used.
• Lengthen the transmission interval and take sufficient time for the read processing of the CPU module side.
■ Remarks
For the nonprocedural protocol, data up to the end code received at first or fixed length data is stored in the nonprocedural reception buffer memory area, and
C24 turns ON the read request to the CPU module.
When the next data is sent while the read request is
ON, the data is temporarily stored in the operating system receive buffer. When the operating system receive buffer becomes full, C24 skips the rest of the data and turns ON the "SIO" LED.
• Connect the target devices to C24 on a 1:1 basis and perform a communications test.
If C24 can communicate normally with each of all target devices, two or more devices transmit data simultaneously during multidrop communication.
Therefore, interlock the devices not to transmit at the same time.
MC No n
Pd MD S
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
511
Hardware information communication error "PRO." occurs
Bi Pd MD S Symptom Cause
Hardware information communication error signal
"PRO." turns ON.
Communications were performed with a control procedure different from the
C24 communication protocol setting.
Some of the data are different from the control procedure.
Designated command does not exist.
The device number designation is not the character count corresponding to the command.
The characters in the message include a data other than the "A to Z", "0 to
9", "(SP)", and control data.
Corrective action
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and take the following corrective actions.
• Check the C24 communication protocol setting and the message from the target device and match the settings, or correct the message and restart data communications.
A device number outside the designated range was designated.
Check the data transmitted from the target device with the Circuit Trace function of Engineering tool, and correct it if the message is in correct.
■ Remarks
Only the data '0 to 9' and 'A to F' can be handled as character area data during communications using MC protocol (ASCII mode) or the MODBUS slave function
(ASCII mode).
Therefore, when transmitting a character string as data, convert the ASCII code of each character string to 2-byte ASCII code.
• Transmitting the character "G"
The ASCII code for "G" is 47H, and is transmitted as the two bytes 34H, 37H.
• Transmitting the character "A"
The ASCII code for "A" is 41H, and is transmitted as the two bytes 34H, 31H.
(When 41H, ASCII code for "A" is transmitted unchanged, C24 ASCII BIN conversion will convert it to AH(10) and pass it to the CPU module.)
• When specifying a device, check "Device Setting" of the parameters written to the CPU module and correct it to a device No. within the designated range and restart data communications.
Check the function codes and sub codes supported by the C24, and review the request message to be sent.
A request message with a function code or sub code not supported by a C24 was received.
The number of access points or size of a MODBUS device in a received request message is out of range.
The size of device data specified in a received request message does not match that of write device data.
The size of a received request message is less than 4 bytes/8 bytes, or exceeds 256 bytes/512 bytes.
An illegal character was received after the end code
CR.
Check the MODBUS device assignment parameters set for the C24, and review the request message to be sent.
Review the contents of the request message.
MC No n
512
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
Hardware information communication error "P/S" occurs
Symptom Cause
Hardware information communication error signal
"P/S" turns ON.
The parity bit settings do not match.
Sum check codes do not match.
When CH1 and CH2 are set for the interlink operation, there is an interface to which the cable is not connected.
Corrective action
• Review the data format between C24 and the target device, and match the settings.
• Calculate to check if the sum check code transmitted from the target device is correct, and correct the sum check code if it's incorrect.
• When using CH1 and CH2 for the interlink operation, connect the cable to both of the interfaces.
• When using CH1 and CH2 for the independent operation, reconfigure the setting to the independent operation if it is set to the interlink operation.
■ Remarks
If the cable is not connected to one of the interfaces when CH1 and CH2 are used for the interlink operation, the data may be destroyed due to noise and may result in 'data cannot be decoded' or 'cause of communications error'.
MC No n
Bi
Hardware information communication error "C/N" occurs
Pd MD S
Symptom Cause
Hardware information communication error signal
"C/N" turns ON.
PC number is specified to the self-station (FF), or a station other than the station number set with the network parameter.
Routing parameters between the CPU module with C24 mounted and the communication destination
CPU module are not set.
An error occurred on CC-
Link IE TSN, CC-Link IE
Controller Network, CC-
Link IE Field Network,
MELSECNET/H, or
MELSECNET/10.
An error occurred on the
CPU module of the host station on CC-Link IE TSN,
CC-Link IE Controller
Network, CC-Link IE Field
Network, MELSECNET/H, or MELSECNET/10.
Module installation address designation for communications with
Intelligent function module is incorrect.
A command that cannot be transmitted during RUN
(program, parameters, etc.) was transmitted, or "Online change" is set to be disabled.
Corrective action
• Change the PC number to the self-station (FF) or the station number set with the network parameter, and restart data communications.
MC No n
• Check the routing parameters and set them up to the communication destination CPU module.
• Check the error contents by the status of SB and
SW related to CC-Link IE Controller Network and
CC-Link IE Field Network with the monitor function of Engineering tool etc., and take corrective actions in accordance with the reference manuals for respective network.
• Change the transmission message designation data.
• Stop the CPU module and restart data communications.
• Enable the "Online change" by command and restart data communications.
Bi
Pd MD S
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
513
Hardware information communication error "NAK" occurs
Bi Pd MD S Symptom Cause Corrective action
Hardware information communication error signal
"NAK" turns ON.
Refer to section which describes the communication error signal ("C/N", "P/S",
"PRO", "SIO") that are turned ON simultaneously when the "NAK" signal is turned ON.
• Take corrective action corresponding to the contents of the error.
■ Remarks
When the "NAK" signal is turned ON, the error code is added to "NAK" and is transmitted from C24 to the target device. Take the corrective action depending on the error code listed below.
In addition, the error code when "NAK" is transmitted is stored to the C24 buffer memory shown below, so it can be checked at the C24 side as well.
• Error code storage buffer memory
CH1 side: Un\G602
CH2 side: Un\G618
MC No n
Communication is intermittent
Symptom
Communications are intermittently established and lost.
Cause Corrective action
During multidrop connection, two or more devices transmitted data at the same time.
• Connect the target devices to C24 on a 1:1 basis and perform a loopback test.
If C24 can communicate normally with each of all target devices, two or more devices transmit data simultaneously during multidrop communication.
Therefore, interlock the devices not to transmit at the same time.
• Replace the cable, or make the connections firm.
The signal cable wiring has a loose connection.
The CD(DCD) signal turns
ON/OFF repeatedly when the CD terminal check is enabled.
When half-duplex communications is set, the
ON/OFF timing of each signal does not match.
• Change the wiring so that the CD(DCD) signal remains ON all the time, or change the setting so that the CD terminal check is disabled.
• Control at the target device side so that the ON/
OFF timing of each signal matches.
For details, refer to the following section.
(
Page 275 DATA COMMUNICATIONS USING
• Make sure to obtain handshake in the program.
The next transmission processing was requested before a previous transmission processing had been completed.
The next reception processing was requested before a previous reception processing had been completed.
Communication via modem is disrupted.
The data sent from C24 are received back to the RS-
422/485 interface (CH2) side.
• Since communication via modem may be disrupted due to low line quality or instantaneous interruption, create a program for reconnecting the line in case of unexpected line disruption.
• If this symptom occurs frequently, reduce the communication rate of the modem, and retry the communication.
• Disable the echo back with the Echo back enable/ disable designation before communication.
MC No n
Bi
Pd MD S
514
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
When a normal completion response message cannot be received
The following explains how to take corrective actions when a normal completion response message cannot be received upon command message transmission.
■
An abnormal completion response message is received
When a target device received an abnormal completion response message in response to the sent command message, take corrective action according to the error code in the response message. (
When the following problem occurs at the time of access to other station CPU module, clear the programmable controller
CPU information and retry. (
Page 498 How to Clear Programmable Controller CPU Information)
• Accessible device range became narrow. (Error code: 7140H)
• Some of commands and/or devices cannot be used (Error code: 7142H, 714DH) etc.
■
Response messages cannot be received
Change the setting value for the response monitoring time (timer 1, 5 seconds by default). (
If response messages still cannot be received even after changing the setting value, check the communication protocol setting for the relevant interface, the ON status of the indicator LED, and the connection cable.
■
The first part of a response message cannot be received
Increase the setting value of the transmission wait time (the default value is 0 ms). (
If response messages still cannot be received even after increasing the setting value, reducing the processing time from the end of transmission processing to the start of reception processing on the target device side is required.
Undecodable data are transmitted or received
Symptom
Data that cannot be decoded was transmitted and received.
Cause Corrective action
During multidrop connection, two or more devices transmitted data at the same time.
The parity bit settings do not match.
The bit length settings for the stop bit do not match.
• Connect the target devices to C24 on a 1:1 basis and perform a loopback test.
If C24 can communicate normally with each of all target devices, two or more devices transmit data simultaneously during multidrop communication.
Therefore, interlock the devices not to transmit at the same time.
• Match the settings of C24 with that of the target device.
■ Remarks
If '7 bits' is set to the data bit with the parity bit set to
'Yes' at one side and '8 bits' is set to the data bit with the parity bit set to 'None' at the other side, the transmitted/received bit number will be the same.
Therefore, data transmission/reception can be possible without error.
• Match the transmission speed of C24 with that of the target device.
• Connect the terminating resisters to the stations of both ends. (110 or 330 for C24)
Transmission speed settings do not match.
During multidrop connection, the terminating resistor is not connected correctly.
When CH1 and CH2 are set for the interlink operation, there is an interface to which the cable is not connected.
• When using CH1 and CH2 for the interlink operation, connect the cable to both of the interfaces.
• When using CH1 and CH2 for the independent operation, reconfigure the setting to the independent operation if it is set to the interlink operation.
■ Remarks
If the cable is not connected to one of the interfaces when CH1 and CH2 are used for the interlink operation, the data may be destroyed due to noise and may result in 'data cannot be decoded' or 'cause of communications error'.
MC No n
Bi
Pd MD S
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
515
Whether the communication error is caused on C24 or target device is unclear
Bi Pd MD S Symptom Cause
Whether the communications error is caused on the C24 side or the target device side is unclear.
Corrective action
Perform the following tests on the C24 side to investigate where the cause is.
• Check the hardware.
C24 is mounted correctly.
The pins of C24 has no abnormalities such as bent.
• Perform the individual station test on C24.
(
Page 492 Individual station test)
No errors occur by the hardware test.
No errors occur by the self-loopback test.
• Check the CPU module condition.
No errors that stop the CPU module operation occur.
■ Remarks
The following methods are available for testing if normal communications are possible with C24 alone.
• For single C24, set CH1 and CH2 to the nonprocedural protocol with self-loopback wiring.
When data transmitted from one channel and data received at the other channel match, the transmission/reception processing is performed normally.
• When two C24s are used, set one C24 to the nonprocedural protocol and the other C24 to the
MC protocol, and transmit an MC protocol message from the station which is set to the nonprocedural protocol. If the station which is set to the MC protocol returns the transmission message normally, transmission/reception processing is performed normally.
MC No n
Communication is not established via modem
Symptom
Auto modem initialization cannot be performed.
Cause Corrective action MC No n
Bi
Pd MD S
A modem initialization error occurs.
Modem connection CH specification is not performed.
The parameter settings are incorrect.
• Check the error code and take corrective actions.
• Set the modem connection CH specification.
• Set the parameters to match the host station modem/TA.
Review the parameter settings below with
Engineering tool. Then, write the parameter settings to the CPU module, and reset it.
• Communication speed setting
• Transmission setting
• Communication protocol setting
• Station number setting
516
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
Communication is not established with the ISDN sub-address when using a modem
Symptom Cause Corrective action Bi Pd MD S MC No n
Data cannot be communicated with ISDN sub-address
Sub-address is incorrect.
The modem does not support ISDN sub-address.
Delimiter code for subaddress is incorrect.
• Review the sub-address.
• Use modem supporting ISDN sub-address.
• Review the delimiter code in accordance with the manual for the TA.
Fixed cycle send is not performed normally
Bi Pd MD S Symptom Cause Corrective action
The programmable controller CPU monitoring function does not operate in the cycle time designated by the fixed cycle send setting.
The setting value of the fixed cycle send is incorrect.
The cycle time is affected by some causes.
• Review the settings for the fixed cycle send.
(Check if the cycle shorter than the one calculated with the monitoring timing of the CPU module has been set, etc.) (
Page 155 Monitoring timing of
• Remove the causes or designate the cycle time taking the causes into consideration.
Condition match send is not performed normally
MC No n
Symptom Cause Corrective action
The programmable controller CPU monitoring function does not operate in the cycle time designated by the condition match send setting.
The setting value of the condition match send is incorrect.
The cycle time is affected by some causes.
• Review the settings for the condition match send.
(Check if the setting value of the programmable controller CPU monitoring function designation is incorrect.) (
Page 157 Condition match send)
• Remove the causes or designate the cycle time taking the causes into consideration.
Data cannot be received by an interrupt program
MC No n
Bi
Pd MD S
Symptom Cause
Data cannot be received by an interrupt program.
C24 receives data by an instruction other than
BUFRCVS.
The parameter settings for
C24 from [Module
Parameter] [Interrupt
Settings] are not configured, or the settings are incorrect.
Corrective action MC No n
• Use BUFRCVS instruction to receive interrupt data.
• Review the parameter settings from [Module
Parameter] [Interrupt Settings].
Bi
Pd MD S
29
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
517
Data cannot be written to flash ROM
Symptom
Data cannot be written to the flash ROM.
Data written to flash ROM are not valid.
Cause
The setting change is not set to be enabled in the parameter settings with
Engineering tool.
The power of C24 was turned OFF while writing to the flash ROM.
Communication with
Engineering tool was interrupted while writing to the flash ROM.
Corrective action
• Set the setting change to 'Enable' with Engineering tool.
MC No n
• Write the data again to the flash ROM.
Bi
Pd MD S
518
29 TROUBLESHOOTING
29.3 Troubleshooting by Symptom
29.4
Error Code List
This section explains the error codes, error contents, and corrective actions for errors may occur during data communication and when using the modem function.
The signal name in the table shows the LED lighting status and communication error status stored in the 'CH side LED lighting status, communication error status' (Un\G513/514) when error occurs.
The CH side LED lighting status and communication error status can be checked with the System Monitor function or the
Intelligent Function Module Monitor function of Engineering tool.
Note that "NAK" turns ON for errors which occur by the MC protocol communication and the signal name is not indicated.
For the error code when communicating using 1C frame, refer to the following manual.
MELSEC-L Serial Communication Module User's Manual (Basic)
The meanings of abbreviations in the table are as follows:
• MC: MC protocol
• Non: Nonprocedural protocol
• Bi: Bidirectional protocol
• Pd: Predefined protocol
• MD: MODBUS (slave function)
• S: Simple CPU communication
Error code
(hexadecima l)
2242H
2250H
20E0H
3000H
3001H
Error
Module parameter error
Module extended parameter error
■ The written module extended parameter setting is any of the following:
• The module extended parameter for other module was written to the CPU module.
• The predefined protocol setting has an error.
• The data for the set item is corrupted.
CHn
ERR.
Invalid module
Modbus device duplication parameter allocation error
MODBUS device upper limit value over error
Description Signal name
• Incorrect setting value was set to the module parameter.
• The module cannot communicate with the CPU module.
• MODBUS device or CPU device specified in
MODBUS device allocation parameter overlaps with another allocation setting.
• The start MODBUS device number + assigned points in the MODBUS device allocation parameter exceeds the maximum value (65535) allowed for the MODBUS device.
Corrective action
• Set the correct value to the module parameter, and rewrite it to the CPU module.
• Write module extended parameters for C24 to the
CPU module.
• Check the predefined protocol setting in the protocol setting data error
(buffer memory: 4086H to
4089H), and correct and write it to C24, and execute the CPRTCL instruction.
• Replace the module if error occurs even after rewriting.
• The hardware failure of the
CPU module may have been occurred. Please consult your local
Mitsubishi representative.
• Correct the duplicate
MODBUS device allocation settings and write to the
CPU again.
• Check the parameter error information (address:
7C13H to 7C15H), and review the start MODBUS device number and the number of assigned points, set in the corresponding
MODBUS device allocation parameter.
Protocol
MC Non Bi
Pd
MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
519
520
Error code
(hexadecima l)
3002H
Error
Buffer memory assigned range error
Description
• The assigned range of the
C24 buffer memory set with the MODBUS device allocation parameter exceeds the range of the user free area.
Signal name
3003H
3004H
3005H
3C00H
4000H to
4FFFH
7102H
7103H
7104H
Device upper limit value over error
• The start device number + assigned points in the
MODBUS device allocation parameter exceeds the maximum value allowed for the CPU device.
Device allocation number error
• The bit device assigned to the input register or holding register is not in units of 16 points.
CC-Link IEF remote head module access target error
System error
CPU module error
• "Master station" was set in the access target, when the C24 is not mounted on the CC-Link IE Field network remote head module.
• The operating system of
C24 detected some error.
• Errors detected in the CPU module
System error
PLC access error
System error
Request data error
• The operating system of
C24 detected some error.
• Cannot communicate with
CPU module.
C/N
• The operating system of
C24 detected some error.
• The request exceeded the limit of processing points that are predetermined for each command and allowed for one transmission.
• A word device was designated in a bit unit command.
• The requested range exceeded the last device number.
(CPU module's last device number head device number + number of device points in message sent from the target device)
PRO
Corrective action
• Check the parameter error information (address:
7C13H to 7C15H), and review the start device number and the number of assigned points, set in the corresponding MODBUS device allocation parameter.
• Check the parameter error information (address:
7C13H to 7C15H), and review the start device number and the number of assigned points, set in the corresponding MODBUS device allocation parameter.
• Check the parameter error information (address:
7C13H to 7C15H), and set the number of assigned points set in the corresponding MODBUS device allocation parameter in units of 16 points.
• Review the value set for the access target of the
CC-Link IEF remote head module in the module parameter.
Page 541 Corrective actions for system error
MELSEC iQ-R CPU
Module User's Manual
(Application)
Page 541 Corrective actions for system error
• Increase the monitoring time (timer 1).
• Perform a self-loopback test, and check if the data communication with the
CPU module can be established.
Page 541 Corrective actions for system error
• Check and correct the transmission message from the target device and restart data communications.
• If no error is found in the device range, clear the programmable controller
CPU information and retry.
Protocol
MC Non Bi
29 TROUBLESHOOTING
29.4 Error Code List
Pd MD S
Error code
(hexadecima l)
7141H
714DH
Error
System error
Device name error
Monitor CPU model error
Description Signal name
• The operating system of
C24 detected some error.
• A device that cannot be specified for the corresponding command was specified.
PRO
Device number error
• The head device number is out of range.
PRO
Monitor registration error
Monitor PC No. error
• Monitor was requested before monitor registration.
PRO
• The registered PC No. and
PC No. in the monitor request are different.
C/N
• The CPU model differs at monitor registration and monitor request.
C/N
Number of monitor registration point exceeded error
• The number of monitor registration points exceeds the range.
Extension R block No. error
• A nonexistent extension file register block No. was designated.
• A block No. being used as an extension comment area, sampling trace area, or status latch area was designated.
Online disabled • A write command was designated when the
Online Change is disabled.
• Parameter or program was written during RUN.
PRO
PRO
C/N
Use not possible command error
• An unsupported command was requested for the access destination CPU module.
C/N
Corrective action
Page 541 Corrective actions for system error
• Check and correct the transmission message from the target device and restart data communications.
• If no error is found in the device name, clear the programmable controller
CPU information and retry.
• Check and correct the transmission message from the target device and restart data communications.
• Register the device to be monitored before issuing a monitor request.
• Check and correct the transmission message from the target device and restart data communications.
• Perform the monitor registration again.
• Check and correct the transmission message from the target device and restart data communications.
• Perform the monitor registration again.
• Check and correct the transmission message from the target device and restart data communications.
• Check and correct the designated block No. and restart data communications.
• Change the setting to enable online change and restart data communications.
• Stop the CPU module and restart data communications.
• Check and correct the transmission message from the target device and restart data communications.
• If no error is found in the command, clear the programmable controller
CPU information and retry.
Protocol
MC Non Bi Pd MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
521
Error code
(hexadecima l)
714EH
7150H
7151H
7153H
7155H
7156H
7160H
7161H
7164H
7167H
7168H
7169H
716CH
716FH
Error
Monitor network No. error
System error
PC No. designation error
Frame length error
Monitor unregistration error
System error
PLC access error
• The request exceeded number of processing points that can be communicated with one session set for each command.
Online disabled • A write command was designated for a online change prohibit setting.
System error
Device error
Description
• The network No. differs at monitor registration and monitor request.
C/N
• The operating system of
C24 detected some error.
• A value other than "FF" or
"0 to 120 (00H to 78H)" was specified for the PC number.
C/N
• Monitor was requested before monitor registration.
PRO
• The operating system of
C24 detected some error.
• Cannot confirm the CPU model.
C/N
System error
Request details error
• The operating system of
C24 detected some error.
• The request details or device specification method is incorrect.
Online disabled • A command that cannot be executed during RUN was specified.
CPU module error
• Cannot communicate normally with CPU module.
C/N
C/N
• The operating system of
C24 detected some error.
• A nonexistent device was designated.
• Device that cannot be specified by the corresponding command was designated.
PRO
Signal name
CHn
ERR.
C/N
Corrective action
• If the CPU module has an error, remove the CPU module error and restart data communications.
Page 541 Corrective actions for system error
• Check and correct the transmission message/ request from the target device, and restart data communications.
• Change the setting to enable online change and restart data communications.
• Stop the CPU module and restart data communications.
• Stop the CPU module and restart data communications.
• If the CPU module has an error, remove the CPU module error and restart data communications.
Page 541 Corrective actions for system error
• Check and correct the transmission message from the target device and restart data communications.
• Check and correct the other station access valid module No. in the network parameters, and restart data communications.
• Perform the monitor registration again.
Page 541 Corrective actions for system error
• Check and correct the transmission message from the target device and restart data communications.
• Modify the setting of the transmission message from the target device so that the request will not exceed the limit of processing points that are allowed for one transmission and predetermined for each
MC protocol command.
Then, retry data communications.
• Register the device to be monitored before issuing a monitor request.
Page 541 Corrective actions for system error
Protocol
MC Non Bi Pd MD S
522
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7170H
Error
1C frame error
Description
• The number of access points exceeds the range.
Signal name
PRO
7171H
7172H
7173H
1C frame error
1C frame error
• A device that cannot be specified was specified.
PRO
• The number of monitor registration points is not correct. For example, "0" is specified.
PRO
Corrective action
• Check and correct the transmission message from the target device and restart data communications.
• Check and correct the transmission message from the target device and restart data communications.
• Check and correct the transmission message from the target device and restart data communications.
• For CPU module other than R/Q/L/QnACPU, use
1C frame for monitor registration and monitor.
Protocol
MC Non Bi
7327H
7330H
7331H
7332H
7333H
7334H
7335H
7336H
Monitor registration error
CPU response monitoring timer setting error
Device code error
MODBUS device upper limit value over error
MODBUS device assigned range overlap error
Buffer memory assigned range error
Device upper limit value over error
Error status read device setting error
CC-Link IEF remote head module access target value error
• Monitor registration was performed to a CPU module other than R/Q/L/
QnACPU using 2C/3C/4C frame.
• The CPU response monitoring timer value in the buffer memory
(address:700EH) is incorrect.
• The device code value specified as a MODBUS device allocation parameter is incorrect.
• The start MODBUS device number + assigned points in the MODBUS device allocation parameter exceeds the maximum value (65535) allowed for the MODBUS device.
• MODBUS device or CPU device ranges set with the
MODBUS device allocation parameters are overlapped.
• The assigned range of the
C24 buffer memory set with the MODBUS device allocation parameter exceeds the range of the user free area.
• The start device number + assigned points in the
MODBUS device allocation parameter exceeds the maximum value allowed for the CPU device.
• The specification of the error status read device is incorrect.
• The access target specification value is other than 0 and 1 when CC-Link
IE Field network remote head module is installed.
PRO
• Review the CPU response monitoring timer value.
• Review the device code value.
• Review the start MODBUS device number and the number of assigned points.
• Review the start MODBUS device number and the number of assigned points.
• Review the start device number and the number of assigned points.
• Review the start device number and the number of assigned points.
• Review the setting of the error status read device.
• Set the access target specification value to 0 or 1 when CC-Link IE Field network remote head module is installed.
Pd MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
523
Error code
(hexadecima l)
7337H
Error
CC-Link IEF remote head module access target error
7338H Buffer memory setting error
Description Signal name
• The access target (when mounted to CC-Link IE
Field network remote head module) (address: 700FH) was set when the C24 is not mounted on the CC-
Link IE Field network remote head module.
• Writing to the system area
(use prohibited) in the buffer memory.
Corrective action
• Review the access target station or the specified access target value (when mounted to CC-Link IE
Field network remote head module).
7339H
7340H
7380H
Modbus station number invalid
Device allocation number error
CPU response monitoring timer timeout
• Invalid Modbus station number is set.
• The bit device assigned to the input register or holding register is not in units of 16 points.
• The CPU response monitoring timer timed out in the slave function.
CHn
ERR.
C/N
• Check whether writing to the system area (use prohibited) in the buffer memory was executed by the sequence program.
• Set the valid Modbus station number.
• Set the number of assigned points in units of
16 points.
7381H
7382H
7383H
7384H
7385H
Function code error
Sub-code error
MODBUS device specification error
• The request message with a function code that is not supported by the C24
MODBUS slave function was received.
• The request message with a sub-code that is not supported by the C24
MODBUS slave function was received.
• The MODBUS device allocation parameters have not been set for the
MODBUS device specified in the received request message.
• Accessed a device that the requested CPU module does not support.
CHn
ERR.
PRO.
CHn
ERR.
PRO.
CHn
ERR.
PRO.
MODBUS device specification error
MODBUS device specification error
• The range of the MODBUS device specified in the received request message exceeds the valid range of the MODBUS device allocation parameter.
• Accessed a device number that the requested CPU module does not support.
CHn
ERR.
PRO.
• The range of MODBUS devices specified in the received request message exceeds the maximum value of MODBUS devices.
CHn
ERR.
PRO.
• If an error has occurred in the programmable controller CPU, remove the error.
• Set a larger value for the
CPU response monitoring timer.
• Confirm the function codes supported by the MODBUS slave function, and review the request message to be sent.
• Confirm the sub-codes supported by the MODBUS slave function, and review the request message to be sent.
• Set the MODBUS device allocation parameters for the MODBUS device specified in the request message.
• Review the device code specified in the MODBUS device allocation parameter for the
MODBUS device specified in the request message.
• Set an adequate MODBUS device allocation parameter so that it will satisfy the MODBUS device range specified in the received request message.
• Review the assignment of the CPU device set in the
MODBUS device allocation parameter for the
MODBUS device specified in the request message.
• Check the specification of the MODBUS device on the master side from which the request message was sent.
Protocol
MC Non Bi Pd MD S
524
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7386H
7388H
7390H
7391H
7392H
7393H
7394H
7397H
7398H
7399H
Error
MODBUS device specification error
No setting for error status read device
Byte count specification error
Receive data size error
Description
• The number of access points for the MODBUS device specified in the received request message exceeds the maximum access points allowed for the relevant function.
• No error status read device was set for read exception status (FC: 07).
• The number of write points in the received request message does not match the specified number of bytes.
• The write device data size in the received request message is not consistent with the specified number of bytes.
CHn
ERR.
PRO.
CHn
ERR.
PRO.
CHn
ERR.
PRO.
CHn
ERR.
PRO.
Reference type error
Data unit error
Write error during online change
• The reference number value specified in the received request message
(FC:20, FC: 21) is incorrect.
• The contents of the data unit in the received request message are incorrect.
• The size of the received request message is smaller than the minimum size or greater than the maximum size required for the relevant function code.
• A request message for writing was received in the state of write prohibited during online change.
CHn
ERR.
PRO.
CHn
ERR.
PRO.
C/N
No reception monitoring time timeout
• No reception for a 1.5 character time or 1 second or more was detected during message reception, and the message was discarded.
CHn
ERR.
PRO.
Short frame error
Character overrun error
• The received message size (excluding the start character in the ASCII mode) was less than 4 or 8 bytes.
CHn
ERR.
PRO.
• The received message size (excluding the start character in the ASCII mode) exceeded 256 or
512 bytes.
Signal name
CHn
ERR.
PRO.
Corrective action
• Check the specification of the MODBUS device on the master side from which the request message was sent.
• Set an error status read device.
• Review the number of write points and the number of bytes on the master side from which the request message was sent.
• Review the specified contents of the write device data size and number of bytes on the master side that sent the request message.
• Review the specification of the reference number on the master side from which the request message was sent.
• Review the contents of the request message on the master side from which the request message was sent.
• Do not issue a write request message while writing is prohibited during online change.
• Use the parameter to change to the setting for write during online change.
• Review the setting of the device from which the relevant message was sent.
• Check the relevant device.
• Disconnect an erroneous device if any.
• Review the setting of the device from which the relevant message was sent.
• Check the relevant device.
• Disconnect an erroneous device if any.
• Review the contents of the message issued by the station that sent the relevant message.
• Check the relevant device.
• Disconnect an erroneous device if any.
Protocol
MC Non Bi Pd MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
525
Error code
(hexadecima l)
739AH
739BH
7403H
7411H
7412H
7817H
7A00H
Error
ASCII-binary conversion error
Description Signal name
• An ASCII code that cannot be converted to binary was received.
CHn
ERR.
PRO.
End code error • An illegal character was received after the end code
CR.
CHn
ERR.
PRO.
CS signal OFF • The CS signal was OFF at the time of request or response message transmission, resulting in the failure of the transmission.
• A cable is disconnected.
• A cable is faulty.
CRC/LRC error • The CRC/LRC in the received message does not match the CRC/LRC calculated by the C24.
CHn
ERR.
PRO.
CHn
ERR.
P/S
Transmission monitoring timer timeout
• The transmission monitoring timer timed out.
CHn
ERR.
Remote password error
Time-out error
C24 is in the remote password locked out state.
Transmission has failed due to resend timeout.
Corrective action
• Review the contents of the message issued by the station that sent the relevant message.
• Check the relevant device.
• Disconnect an erroneous device if any.
• Review the contents of the message issued by the station that sent the relevant message.
• Check the relevant device.
• Disconnect an erroneous device if any.
• Check if cable is disconnected.
• When using RJ71C24 and
RJ71C24-R2 please check the cable connection and correct the wiring so that the CS signal of RS-232 is always ON.
• Do not turn OFF or disconnect the device from the network while it is sending a message.
• Review the contents of the message issued by the relevant station.
• Check the relevant device.
• Disconnect the erroneous device if any.
• Review the line status.
• Take preventive measures against noise.
• Check if cable is disconnected.
• When using RJ71C24 and
RJ71C24-R2 please check the cable connection and correct the wiring so that the CS signal of RS-232 is always ON.
• Check that no data is being received from the line when transmitting
• Wait for awhile, and retransmit the password.
• Check the cable connection to the communication destination.
• Check the settings for the communication destination.
• If an error has occurred at
C24, refer to the manual for C24 to check the error, and take corrective actions according to the error code.
• Check if any errors occur on the communication destination.
Protocol
MC Non Bi Pd MD S
526
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7A01H
7A02H
7A03H
7A04H
7A05H
7A06H
7A07H
7A0FH
7D00H
Error
Transmission error
Description
Transmission has failed.
CPU response monitoring timer error
The request to the CPU module has failed.
Abnormal response error
Received frame error
An abnormal response was received from the communication destination.
An incorrect frame was received from the communication destination.
Parameter setting error
Own station channel error
Device specification error
The parameter settings are incorrect.
The channel being used does not support the simple CPU communication.
The device specified as the communication destination is out of specification range.
Simple CPU communication error
The simple CPU communication cannot be executed.
Protocol No. setting error
Signal name
Corrective action
• The protocol number is out of range in the control data for CPRTCL instruction.
CHn
ERR.
• Check the cable connection to the communication destination.
• Check the settings for the communication destination.
• If an error has occurred at
C24, refer to the manual for C24 to check the error, and take corrective actions according to the error code.
• Check if any errors occur on the communication destination.
• Review the monitoring time for the CPU response monitoring timer.
• Review the device/label access service processing setting.
• Check the exception code in the buffer memory.
• Check the cable connection to the communication destination.
• Check the settings for the communication destination.
• Take preventive measures against noise.
• Check if any errors occur on the communication destination.
• Check the "Various control specification" in "Basic
Settings".
• Available channel number depends on the firmware version of C24. Check the firmware version.
• Check the type, start number and end number of the destination device specified as the communication destination in parameter setting.
• The type of the communication destination depends on the firmware version of C24. Check the firmware version.
• Take preventive measures against noise.
• If the same error code is displayed even after executing again, please consult your local
Mitsubishi representative.
• Review the protocol number.
Protocol
MC Non Bi Pd MD S
29 TROUBLESHOOTING
29.4 Error Code List
527
29
Error code
(hexadecima l)
7D01H
7D02H
Error
Protocol continuous execution count setting error
Protocol notready error
7D10H
7D11H
7D12H
7D13H
Protocol unregistration error
• The protocol No. which is not registered in C24 is specified in the control data for the CPRTCL instruction.
• The CPRTCL instruction was executed without the protocol setting data written.
CHn
ERR.
Protocol simultaneous execution error
• The CPRTCL instruction and 'CH1 protocol execution request' (Y3) or
'CH2 protocol execution request' (YA) were executed simultaneously on the same channel.
CHn
ERR.
Send monitoring time timeout error
• Send monitoring time has timed out.
• Although the transmission was retried the specified number of retries, it did not succeed.
CHn
ERR.
Receive wait timeout error
Description
• The number of protocols to be executed continuously is out of range in an argument of the CPRTCL instruction.
• The CPRTCL instruction was executed while the
'predefined protocol ready'
(X1D) is OFF.
• The CPRTCL instruction was executed while the protocol setting data is being written.
• The CPRTCL instruction was executed with abnormal protocol setting data.
CHn
ERR.
CHn
ERR.
• Receive wait time has timed out.
Signal name
CHn
ERR.
Corrective action
• Review the number of protocols to be executed continuously.
• Execute the CPRTCL instruction after the
'predefined protocol ready'
(X1D) turned ON.
• Do not execute the
CPRTCL instruction while the protocol setting data is being written. (Set the CPU module in STOP state, and write protocol setting data.)
• Write the protocol setting data again to C24, and then execute the CPRTCL instruction.
• If this error persists even after rewriting, replace the module.
• Check if the specified protocol No. is correct.
• Check the 'Protocol registration' (Un\G16529 to
16536) to see if the specified protocol number is registered.
• Write the protocol setting data, and then execute the
CPRTCL instruction.
• Correct the program not to execute the CPRTCL instruction and 'CH1 protocol execution request'
(Y3)/'CH2 protocol execution request' (YA) simultaneously on the same channel.
• Check if the transmission is interrupted due to some reasons such as DTR control.
• Check whether the CS signal is ON.
• Check if the cables are disconnected.
• Check if the reception is interrupted due to some reasons such as DTR control.
• Check if the cables are disconnected.
• Check if any errors occur on the target device side.
■ Using the circuit trace function (send/receive data monitoring function), check if;
• Transmissions from the target device are interrupted.
• Any data are missing due to a data reception error.
• The data (packet) sent from the target device is incorrect.
Protocol
MC Non Bi
Pd
MD S
528
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7D14H
7D15H
7D16H
Error
Response monitoring timeout error
Response monitoring timeout error
Description Signal name
• Response monitoring time
(timer 1) has timed out during data transmission.
• Data to be sent to the target device was not obtained from the CPU module within the response monitoring time
(timer 1).
CHn
ERR.
• Response monitoring time
(timer 1) has timed out during data reception.
• Data received from the target device was not stored into the CPU module within the response monitoring time
(timer 1).
CHn
ERR.
Protocol cancel request error
• A cancel request was accepted during protocol execution, and the
CPRTCL instruction was completed abnormally.
• The CPRTCL instruction was completed abnormally because protocol setting data were written during
CPRTCL instruction execution.
• The STOP RUN operation was performed on the CPU module.
CHn
ERR.
Corrective action
7D17H
7D18H
7D19H
Packet size error
• A packet of more than
2048 bytes was received.
CHn
ERR.
Insufficient digit number error
Abnormal digit number error
• When data is received using a protocol including a packet that contains
Conversion variable
(Variable number of data), the data (the number of digits) corresponding to the
Conversion Variable is insufficient.
• When data is received using a protocol including a packet that contains
Conversion Variable (Fixed number of data and variable number of digits), the corresponding data is 0 bytes (0 digits) or exceeds the maximum number of digits.
CHn
ERR.
CHn
ERR.
• Increase the setting value for the response monitoring time (timer 1).
(Default: 5 seconds)
• If an error occurred on the
CPU module, refer to the following manual.
( MELSEC iQ-R CPU
Module User's Manual
(Application))
• Increase the setting value for the response monitoring time (timer 1).
(Default: 5 seconds)
• If an error occurred on the
CPU module, refer to the following manual.
( MELSEC iQ-R CPU
Module User's Manual
(Application))
• Check the cancelled
Predefined protocol in the
CPRTCL instruction's control data (number of executions), and eliminate the cause of the cancellation.
• Clear the error information by the 'Error initialization request' (YE) as necessary.
• To prevent coincidental execution of the CPRTCL instruction, set the CPU module in the STOP state before writing the protocol setting data.
• Execute the CPRTCL instruction again.
• Check the data length of the packet sent from the target device.
• Divide the packet data into several parts and send them separately.
• Review data sent from the target device.
• Check the packet format of the target device to see if the number of digits is set correctly.
• Review data sent from the target device.
• Check the packet format of the target device to see if the number of digits is set correctly.
Protocol
MC Non Bi Pd
MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
529
Error code
(hexadecima l)
7D1AH
7D1BH
7D20H
7D21H
7E01H
7E03H to
7E05H
7E07H
7E08H
7E09H
Error
Data length error
Value range error
Decimal point place specification error
System error
System error
System error
Execution currently disabled error
System error
Description
• In the data received from the target device, the
Length value does not match the data length of the Conversion Variable(s).
CHn
ERR.
• When data is received using a protocol including a packet that contains
Conversion Variable, data for the Conversion Variable exceeds the range of value allowed for C24.
CHn
ERR.
Data length size error
Data count size error
• The value set in the data length storage area or the data count storage area is out of range.
CHn
ERR.
• An out-of-range decimal point position is set when the number of decimals is set to Variable point.
• The number of decimals is larger than the number of digits for each data.
CHn
ERR.
• The operating system of
C24 detected some error.
• The operating system of
C24 detected some error.
• The operating system of
C24 detected some error.
• The UINI instruction was executed during execution of the programmable controller CPU information clear.
• The operating system of
C24 detected some error.
Signal name
Corrective action
• Check the packet format of the target device to see if the conversion variable is set correctly.
■ Check the data sent from the target device to see if;
• The Length value is incorrect.
• Any of the data corresponding to the conversion variable is missing.
• Review data sent from the target device.
■ Check the packet format of the target device to see if the conversion size is set incorrectly.
• If it exceeds the range for word data, change the conversion size setting to double word.
• If it exceeds the range for double word data, change the element to Nonconversion Variable.
• Check the maximum data length can be set to the data length storage area, and specify the value which is equal to the maximum data length or less.
• Check the maximum number of data can be set to the data count storage area, and specify the value which is equal to the maximum number of data or less.
• Correct the decimal point position.
• Check the number of digits setting, and set the decimal point position so that the number of decimals is less than the number of digits.
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
• Execute the UINI instruction while the programmable controller
CPU information clear is not executed.
Page 541 Corrective actions for system error
Protocol
MC Non Bi
Pd
MD S
530
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7E0AH
Error
Transmission setting error
7E40H
7E41H
7E42H
7E43H
7E44H
7E47H
7E48H
7E4FH
Command error
Data length error
Data count error
Device error
Timer 1 timeout error
Continuous request error
Request error
Number of device points error
Description Signal name
• The specification details for the transmission settings, communication protocol settings and station number settings were incorrect.
• A nonexistent command or subcommand was designated.
PRO
• A data length exceeding the number of points that can communicate during random read/write was designated.
• Number of processing points exceeds the range allowed for the command.
PRO
PRO
• A nonexistent device was designated.
• Device that cannot be specified by the corresponding command was designated.
• The start device number is out of range.
• A response message was not returned within the response monitoring time
(timer 1).
PRO
C/N
• The next request was received before a response message was returned for the preceding request.
PRO
• A request was received during parameter communication.
• Number of access points is incorrect.
PRO
PRO
Corrective action
• Review the parameter settings.
• When mode switching is executed, check that the specified contents are correct.
• If the problem is still not solved, please consult your local Mitsubishi representative.
• Check and correct the transmission message from the target device and restart data communications.
• Check and correct the transmission message from the target device and restart data communications.
• Modify the setting of the transmission message from the target device so that the request will not exceed the limit of processing points that are allowed for one transmission and predetermined for each
MC protocol command.
Then, retry data communications.
• Check and correct the transmission message from the target device and restart data communications.
• Increase the monitoring time for the response monitoring time (timer 1).
• When accessing other station's CPU, check if the routing parameters are correct.
• Do not send requests continuously from the target device.
• Adjust the monitoring time for the response monitoring time (timer 1) to the timeout time set for the target device side.
• Wait for awhile and transmit the request again.
• Check and correct the transmission message from the target device and restart data communications.
Protocol
MC Non Bi
Pd
MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
531
Error code
(hexadecima l)
7E50H
Error
User frame No. designation error
Description
• A user frame No. outside the range was designated.
Signal name
PRO
7E51H
7E52H
7E53H
7E54H
7E55H
7E57H
7E58H
7E59H
7E5EH
User frame unregistration error
User frame overwrite error
Requested frame data error
Modification not-allowed error
User frame data error
Flash ROM write error
Mode modification error
• An unregistered user frame number was designated.
PRO
• An overwrite request was issued to the frame number which has been already registered.
PRO
• A nonexistent command was designated in a subcommand.
• Byte count exceeding the number of bytes that can be requested was designated.
• The setting change enable/ disable setting is set to be disabled.
• The user frame variable data has an error.
PRO
PRO
PRO
• Writing to the flash ROM was not performed normally.
• Power is turned OFF during writing to Flash
ROM.
CHn
ERR.
• At the time of mode modification, the mode No. or transmission specifications are incorrect.
PRO
Number of writing to flash
ROM exceeded error
• Writing to flash ROM has been performed 1000 times since the power was turned ON.
• Writing to flash ROM has been performed 100,000 times.
CHn
ERR.
PLC CPU monitoring function registration error
• The programmable controller CPU monitoring function is registered for the communication protocol that does not support the function.
CHn
ERR.
Corrective action
• Check and correct the transmission message from the target device and restart data communications.
• Review the frame No.
• Perform the frame registration beforehand.
• Change the frame No. and restart data communications.
• Review the frame No.
• Change the write destination to an unregistered frame number.
• When overwriting, delete the given number beforehand.
• Check and correct the transmission message from the target device and restart data communications.
• Set the setting change enable/disable setting to
'Enable'.
• Check and correct the transmission message from the target device and restart data communications.
• Rewrite the module extended parameter to the
CPU module or C24.
• Rewrite the predefined protocol setting to the CPU module or C24.
• If the error occurs after rewriting, replace the module.
• Check and correct the transmission message from the target device and restart data communications.
• Review the parameter settings.
• Review the program.
• Write "0" to the flash ROM write count area (address:
2401H) and restart data communication.
• When the number of writes reached 100,000, replace the module.
• Correct the communication protocol setting.
Protocol
MC Non Bi
Pd
MD S
532
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7E60H
7E61H
7E62H
7E63H
7E64H
7E66H
7E67H
7E68H
7E69H
7E6AH
7E6BH to
7E6DH
7E6FH
7E70H
7E71H
7EC1H to
7EC2H
7EC3H
Error
Device monitoring duplicate registration error
System error
System error
Double send request error
Description
• Programmable controller
CPU monitoring registration was performed twice.
Cycle time units range error
PLC CPU monitoring function error
Transmission method setting error
Registration point range error
Monitoring condition error of monitoring device
CPU error monitoring setting value error
Transmission condition range error of monitoring device
CPU error monitoring setting value error
Monitoring device read point range error
CPU error monitoring setting value error
Modem connection error
CPU error
• The setting value for the cycle time units is out of range.
• The setting value for the programmable controller
CPU monitoring function is out of range.
• The transmission method setting for programmable controller CPU monitoring is incorrect.
• The total number of word blocks and bit blocks registered for programmable controller
CPU monitoring is out of range.
• The monitoring condition is out of range.
• The setting value (fixed value) for CPU error monitoring is out of range.
• The setting value for the transmission condition
(condition match send) is out of range.
• The setting value (fixed value) for CPU error monitoring is out of range.
• The read point of the monitoring device is out of range.
• The setting value (fixed value) for CPU error monitoring is out of range.
• Modem is connected to an incorrect channel.
• The communication with the CPU module was not performed normally.
C/N
• The operating system of
C24 detected some error.
• The operating system of
C24 detected some error.
• A send request was sent again during processing of the send request.
Signal name
Corrective action
• Cancel the programmable controller CPU monitoring and perform the programmable controller
CPU monitoring registration again.
• Correct the cycle time units setting value.
Protocol
MC Non Bi
• Correct the programmable controller CPU monitoring function setting value.
• Correct the transmission method setting value.
• Correct the setting value so that the total number of registered word blocks and bit blocks is within 1 to 10.
• Correct the monitoring condition.
• Correct the setting value
(fixed) for CPU error monitoring.
• Correct the setting value for the transmission condition (condition match send).
• Correct the setting value
(fixed) for CPU error monitoring.
• Correct the setting value for the monitoring device read point.
• Correct the setting value
(fixed) for CPU error monitoring.
• Correct the destination to which data is sent with the modem function.
• If the CPU module side has an error, remove the error and restart data communications.
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
• Provide an interlock for send requests.
Pd
MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
533
Error code
(hexadecima l)
7EC4H
Error
Transmission data count error,
Send and receive buffer setting error
7EC5H
7EC6H
7F00H
7F01H
Flash ROM access error
Flash ROM access error
Other module response error
Other module response error
Description Signal name
• Data exceeding the send buffer memory size was transmitted.
• Send/receive buffer settings are out of range.
• Writing to flash ROM was requested when the setting change enable/disable setting is set to be disabled with Engineering tool.
• The flash ROM read/write request contents are incorrect.
• An error response has been returned from CPU module.
• An error response has been returned from a module other than CPU module.
Corrective action
• Make the send data quantity smaller than the buffer memory size.
• Increase the value for the send buffer memory length designation.
• Designate the start address and size of transmit/receive buffer within the range of the user setting area.
• Set the setting change enable/disable setting to
'Enable' with Engineering tool, write to the CPU, and re-execute after the CPU reset or powering OFF
ON.
• Check the data at the time of read/write request, and specify the correct data.
• An error code is included in the response message of
MC protocol. Refer to the manual for the relevant
CPU module to check the error, and review the request message of MC protocol.
• If this error has occurred at the execution of
G(P).CPRTCL instruction, refer to the manual for the relevant CPU module to check the error, and review the CPU device number specified in the data storage area for Nonconversion Variable or
Conversion Variable.
• If this error occurs at the using the MODBUS slave function, refer to error log
(buffer memory:7CFEH to
7DFFH),and review the
MODBUS request message or MODBUS device allocation parameter.
• An error code is included in the response message of
MC protocol. Refer to the manual for the relevant module to check the error, and review the request message of MC protocol.
• If this error occurs at the using the MODBUS slave function, refer to error log
(buffer memory:7CFEH to
7DFFH),and review the
MODBUS request message or MODBUS device allocation parameter.
Protocol
MC Non Bi
Pd
MD S
534
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7F02H
7F03H to
7F06H
7F07H
7F20H
7F21H
7F22H
7F23H
Error
CPU module error
System error
CPU module error
Description
• An error was detected in the CPU module.
• The operating system of
C24 detected some error.
• An error was detected in the CPU module.
ASCII
Receive header area error
BIN conversion error
Command error
MC protocol message error
• When the nonprocedural or bidirectional protocol is used, an ASCII code that cannot be converted to binary code was received.
• When the nonprocedural or bidirectional protocol is used, an odd number of bytes of data was received during data communications using
ASCII BIN conversion.
• When data is received by
Conversion Variable of the predefined protocol function, the data corresponding to the
Conversion Variable cannot be converted to binary numbers.
• When data is received by a
Check code (ASCII hexadecimal or ASCII decimal) of the predefined protocol function, the data corresponding to the check code cannot be converted to binary numbers.
• The command (frame) part designation has an error.
• An ASCII code that cannot be converted to binary code was received.
• A nonexistent command, subcommand, or device was designated.
• The remote password length is incorrect.
• There is no data (ETX, CR-
LF, etc.) following the character area, or the designation was incorrect.
PRO
PRO
PRO
PRO
PRO
Signal name
Corrective action
• Check the error of the CPU module and take corrective action using the module diagnostics.
Page 541 Corrective actions for system error
• Check the error of the CPU module and take corrective action using the module diagnostics.
• Check and correct the transmission message from the target device and restart data communications.
• When the nonprocedural or bidirectional protocol is used and data is communicated using ASCII
BIN conversion, be sure to send data in units of even bytes.
■ If the predefined protocol was edited, check if the following values match the packet format of the target device:
• Conversion, sign character, number of decimals, delimiter, number of digit for conversion variable
• Code type and data length of check code
Protocol
MC Non Bi
• Check and correct the transmission message from the target device and restart data communications.
• Check and correct the transmission message from the target device and restart data communications.
• Check and correct the transmission message from the target device and restart data communications.
Pd
MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
535
Error code
(hexadecima l)
7F24H
7F25H
7F26H
7F30H
7F31H
7F32H
7F40H
7F41H
7F42H
7F50H to
7F54H
Error
Sum check error
Data length error
Command error
System error
Simultaneous transmission error
System error
Time-out error
Time-out error
Time-out error
System error
Description Signal name
• The sum check code calculated does not match the sum check code received.
• The horizontal parity code calculated does not match the horizontal parity code received.
• The calculated check code does not match the received check code.
P/S
• The length of the received data exceeds the receive area size.
CHn
ERR.
• Another command was received before the unlock processing when the remote password is registered.
• The operating system of
C24 detected some error.
• C24 and the target device started transmissions simultaneously.
CHn
ERR.
Corrective action
• Review the sum check code of the target device.
• Review the horizontal parity code of the target device.
• Review CRC-16 of the target device.
■ If the predefined protocol was edited, check if the following values match the packet format of the target device:
• Processing method or code type of the check code
• Data length
• Data flow
• Complement calculation
• Calculating range
• Correct the "data length" that is transmitted from the target device.
• Change the word/byte units designation to 'byte units'.
• Increase the value for the receive buffer memory length designation.
• Perform data communications after the unlock processing is normally completed.
Protocol
MC Non Bi
• The operating system of
C24 detected some error.
• No-reception monitoring time (timer 0) has timed out.
PRO
• Response monitoring time
(timer 1) has timed out.
• Send monitoring time
(timer 2) has timed out.
• The operating system of
C24 detected some error.
Page 541 Corrective actions for system error
• Perform processing according to the predefined arrangement with the target device. If necessary, change the 'simultaneous transmission data valid/ invalid designation'
(Un\G155/315) setting.
Page 541 Corrective actions for system error
• Check if any data is missing due to a data reception error.
• Check if the DTR control, etc. interrupted data reception.
• Check the status of the target device, and restart data communications, as required.
• Check if the DTR control, etc. interrupted data transmission.
Page 541 Corrective actions for system error
Pd
MD S
536
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7F67H
7F68H
7F69H
Error
Overrun error
Framing error
Parity error
Description Signal name
• C24 received the next data before it completed receive processing of the previous data.
SIO
• The stop bit settings do not match.
• A malfunction occurred on the line because the power for the target station was
ON/OFF.
• Noise occurs on the line.
• During multidrop connection, two or more devices transmitted data at the same time.
SIO
• The parity bit settings do not match.
• A malfunction occurred on the line because the power for the target station was
ON/OFF.
• Noise occurs on the line.
• During multidrop connection, two or more devices transmitted data at the same time.
P/S
Corrective action
• Decrease the transmission speed and restart data communications.
• Check whether momentary power failure has occurred on the station with C24.
(can be checked "AC
DOWN counter" of the special register.)
In case momentary power failure has occurred, remove the cause.
• Perform the registration, read, and delete to/from the flash ROM while the data communication is not performed.
• Match the settings of C24 with that of the target device.
• Clear the error information by 'Error initialization request' (YE).
In addition, when communicating data with the nonprocedural protocol, execute the
INPUT instruction, and read and discard the unnecessary data.
• Take measures against noise.
• During multidrop connection, provide the interlock so that data will not be transmitted simultaneously by multiple devices.
• Match the settings of C24 with that of the target device.
• Clear the error information by 'Error initialization request' (YE).
In addition, when communicating data with the nonprocedural protocol, execute the
INPUT instruction, and read and discard the unnecessary data.
• Take measures against noise.
• During multidrop connection, provide the interlock so that data will not be transmitted simultaneously by multiple devices.
Protocol
MC Non Bi
Pd
MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
537
Error code
(hexadecima l)
7F6AH
Error
Buffer full error
Description
• The operating system receive buffer overflowed and received data was skipped.
Signal name
SIO
7F6BH
7F6CH
7F9AH
7FABH
7FC6H
7FC7H
7FC9H to
7FCCH
7FCFH
7FD1H
7FD2H
7FD3H
7FD4H
7FD5H
7FD6H
7FD7H
7FD8H
CD(DCD) signal control error
Transmission error
System error
System error
System error
System error
System error
System error
Modem function error
Modem function error
Modem function error
Modem function error
Modem function error
Modern function error
Modem function error
System error
• Data was received when the CD(DCD) signal is OFF with the CD terminal check enabled.
CHn
ERR.
• Data cannot be sent because the line is not connected.
• The operating system of
C24 detected some error.
• The operating system of
C24 detected some error.
• An error was detected in the CPU built-in memory.
• The operating system of
C24 detected some error.
• The operating system of
C24 detected some error.
• The operating system of
C24 detected some error.
• The connection re-try count designation is incorrect.
• The connection retry interval designation is incorrect.
• The initialization/ connection timeout designation is incorrect.
CHn
ERR.
CHn
ERR.
CHn
ERR.
CHn
ERR.
• The number of initialization retries designation is incorrect.
• The data No. for initialization designation is incorrect.
• The data for connection of the number specified in the data No. for connection designation is incorrect.
• The data for connection of the number specified in the data No. for connection designation is incorrect.
• The operating system of
C24 detected some error.
CHn
ERR.
CHn
ERR.
CHn
ERR.
CHn
ERR.
Corrective action
• Use the DTR and DC controls and perform data communications so that the buffer does not become full. (Perform RS/
CS control when the modem function is used.)
• When the reception data read request signal turns
ON, execute read operation immediately.
• Review the CD(DCD) signal control of the target device. (Data is sent when the CD(DCD) signal is
ON.)
• Perform data communications with the
CD terminal check disabled.
• Send data after line connection processing on the interface side that uses the modem function.
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
Page 541 Corrective actions for system error
• Set the connection re-try count to 1 to 5.
• Set the connection retry interval to 90 to 300
(seconds).
• Set the time for the initialization/connection timeout to 1 to 60
(seconds).
• Set the number of initialization retires to 1 to
5.
• Designate the registered number of data for initialization or '0'.
• Review the line type.
• Review the external line outgoing number.
Page 541 Corrective actions for system error
Protocol
MC Non Bi
Pd
MD S
538
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
7FD9H
7FDAH
7FDBH
7FDCH
7FDDH
7FDEH
7FDFH
7FE0H
7FE1H
Error
Modern function error
Modem function error
System error
Modern function error
Modem function error
Modem function error
Modem function error
Modem function error
Modem function error
Description Signal name
• The line is connected to the target, or the modem has not been initialized.
CHn
ERR.
• The data No. for connection designation is incorrect.
• The operating system of
C24 detected some error.
• The data for connection of the number specified in the data No. for connection designation is incorrect.
• The connection timeout error occurred.
CHn
ERR.
CHn
ERR.
CHn
ERR.
Corrective action
• Upon the completion of the modem initialization, connect the line to the target device (via public line) while the line has not been connected yet.
• Designate the registered number of data for connection.
Page 541 Corrective actions for system error
• Review the data for connection.
Protocol
MC Non Bi
• Connection to the modem/
TA failed, or a modem/TA is not connected.
CHn
ERR.
• Review the telephone number in the data for connection.
• Check whether the connection target is connectable.
• Review the setting value for the connection timeout.
• Review the data for initialization.
• Check if the modem/TA has any failure by referring to the instruction manual for the modem/TA.
• Connect the modem/TA to
C24.
• Check the connection cable by referring to the instruction manual for the modem/TA.
• Check for any abnormality according to the following procedure.
(
Page 541 Corrective actions for system error)
• Set the modem connection
CH specification to 1 or 2.
• The modem connection channel No. has not been set.
• The designated value for modem connection channel is incorrect.
• The user frame No. designation is incorrect.
• The output start pointer designation is incorrect.
CHn
ERR.
CHn
ERR.
• Set the modem connection
CH specification to 1 or 2.
• Review the user frame No.
• Designate the registered user frame No.
• Register the designated data for initialization.
• Set the output start pointer designation to 1 to 100.
• Designate the position (nth) to which the number of data for initialization is designated.
• Designate the number of data for initialization to the designated position (n-th).
Pd MD S
29
29 TROUBLESHOOTING
29.4 Error Code List
539
Error code
(hexadecima l)
7FE2H
7FE3H
7FE4H
7FE5H
7FE6H
7FE7H
7FE8H
7FE9H
7FECH
7FEDH
7FEFH
7FF0H
Error
Modem function error
Modem function error
Description
• The output frame No. designation is incorrect.
Signal name
CHn
ERR.
• The registration data byte count designation is incorrect.
CHn
ERR.
Corrective action
• Designate the registered number of data for initialization to the range of the designated output quantity starting from the position of the output start pointer designation.
• Set the data for initialization to 1 to 78.
• Set the data for connection to 80.
• Review the data for connection.
Protocol
MC Non Bi
Modern function error
Modem function error
Remote password error
• The data for connection of the number specified in the data No. for connection designation is incorrect.
• The no-communication interval time designation is incorrect.
• Remote passwords do not match.
CHn
ERR.
CHn
ERR.
Remote password error
Remote password error
Modem function error
Module extended parameters do not exist.
Simultaneous execution error
• The remote password is not registered.
• The remote password processing command was received on the interface side where the modem function is not used.
• The MELSOFT Connection is selected in the
Communication protocol setting for the corresponding channel.
• The number of remote password mismatch exceeded the designated value of the address
200DH.
• The number of callback denial exceeded the designated value of address 2002H.
• Reading data has failed since module extended parameters do not exist.
CHn
ERR.
CHn
ERR.
Parameter setting error
Dedicated instructions simultaneous execution error
• More than one target device accessed to the parameter file at the same time.
• The parameter settings with MELSOFT are incorrect.
• A network module having the firmware version not supporting the Simple PLC communication function is used although the Simple
PLC communication is selected as communication protocol setting.
• Dedicated instructions were executed simultaneously.
• Set the no-communication interval time designation to
0 to 120.
• Review the remote password and restart data communications.
• A remote password processing command is not necessary when a remote password is not registered.
• Unlock the remote password by MELSOFT.
Alternatively, change the
Communication protocol setting for the corresponding channel to
MC protocol.
• Clear the 'accumulated count of unlock process abnormal completion'
(Un\G8956) to '0'.
• Clear the callback denial accumulated count
(address: 22F1H) to '0'.
• Write module extended parameters to C24 or CPU module.
• Do not access to the parameter file from more than one target device simultaneously.
• Correct the parameter settings, write it to the CPU module, and restart it.
• Use a network module having the firmware version that supports
Simple PLC
Communication.
• Do not execute the dedicated instructions simultaneously.
Pd
MD S
540
29 TROUBLESHOOTING
29.4 Error Code List
Error code
(hexadecima l)
Error Description Signal name
7FF1H
7FF2H
7FF3H to
7FF4H
7FF5H
7FF7H
7FFBH
Control data error
Communication protocol setting error
System error
Transmission cancel at mode switching/ transmission sequence initialization
Simultaneous access error
Channel error
• Setting value is incorrect.
• Setting value is out of the range.
• The instruction cannot be executed with the current communication protocol.
• The operating system of
C24 detected some error.
■ The processing in operation was cancelled due to performance of the following functions:
• Mode switching, transmission sequence initialization, receive data clear (by buffer memory), user frame use enable/ disable designation, UINI instruction, programmable controller CPU information clear
• Multiple target devices accessed to a station on the same network at the same time.
• Incorrect channel was designated with a dedicated instruction.
7FFCH System error • The operating system of
C24 detected some error.
7FFDH
7FFFH
NULL character transmission error
System error
• Only NULL character data was transmitted when
NULL characters automatic deletion is designated.
• The operating system of
C24 detected some error.
*1 An error code when the target CPU is one of MELSEC-A series.
Corrective action
• Correct the setting value in the control data.
• Correct the setting value of the communication protocol.
Page 541 Corrective actions for system error
• Do not execute these functions during various processes in progress.
• Do not access to a station on the same network from multiple target device at the same time.
• Review the channel for a dedicated instruction.
Page 541 Corrective actions for system error
• Review the data to be transmitted.
Page 541 Corrective actions for system error
Protocol
MC Non Bi
Pd
MD S
Corrective actions for system error
1.
Check if the C24, the power module, and the CPU module are mounted correctly.
2.
Check if the environment of the C24 usage is within the range of the general specifications for the CPU module.
3.
Check if the power supply capacity is sufficient.
4.
Check if the hardware of the C24 and the CPU module is normal according to the respective module manual. In case of a malfunction, please contact your local Mitsubishi representative for service.
5.
If the problem is still not solved, please consult your local Mitsubishi representative, explaining a detailed description of the problem.
29
29 TROUBLESHOOTING
29.4 Error Code List
541
29.5
Event History List
27002
27003
27004
27005
27006
27007
27008
The table below shows the events saved by C24.
Event code
10200
10201
10202
27000
27001
27010
27011
Event type
Security
Operation
Description
Remote password lock
Remote password unlock
Failure of remote password unlock
Transmission sequence initialization
Programmable controller CPU information clear
Error clear request
Mode switching request
Modem initialization request
Connection request
Modem disconnection request
Parameter initialization request
Connection request from MELSOFT products
Module extended parameter open error
Module extended parameter read error
Cause
The remote password is locked.
The remote password is unlocked.
The remote password was failed to be unlocked.
The transmission sequence used by the MC protocol was initialized.
The programmable controller CPU information clear request was executed.
The error clear request was executed.
The mode switching request was executed.
The modem initialization request was executed.
The connection request for the modem was executed.
The disconnection request for the modem was executed.
The parameter initialization request was executed.
By MELSOFT connection, the access via Serial communication module was performed.
Opening module extended parameter in CPU module has failed.
Reading module extended parameter in CPU module has failed.
542
29 TROUBLESHOOTING
29.5 Event History List
29.6
MODBUS Exception Code List
Exception codes are error codes common to the MODBUS protocol that are stored in a response message when a slave returns an abnormal response to a request message from a master device.
When a target device receives an exception code from a C24, refer to the following table to take a corrective action.
If processing on a C24 is completed abnormally, an exception code is stored in the error log area (Un\G31998 to 32255) of the buffer memory.
The following table lists the exception codes.
Code Name Description
01h
02h
03h
04h
Illegal Function
Illegal Data
Address
Illegal Data Value
Slave Device
Failure
The slave station received an unsupported function code.
The specified address of the
MODBUS device is erroneous.
A value contained in the data field of the request message is incorrect.
An unrecoverable error occurred while the slave station was attempting to perform the requested action.
Corrective action
Target device side
Check function codes supported by the
C24, and modify the request message to be issued.
Check the MODBUS device type and size supported by the C24, and correct the specified address in the request message to be issued.
Review the data field of the issued request message.
Review the data field of the issued request message.
C24 side
Remove the cause of the error occurred on the C24 side.
Refer to the error log of the C24, and solve the problem according to the error code.
05h
06h
07h
08h
0Ah
0Bh
Acknowledge As the slave station is executing another processing, a long duration of time is required to complete the requested processing.
Slave Device Busy As the slave station is executing another processing, the requested processing cannot be executed.
NAK Error The requested program function cannot be executed on a slave station.
Memory Parity
Error
A parity error was detected on a slave station during access to the extension file register.
Gateway Path
Unavailable
Gateway Target
Device Failed To
Respond
The gateway device is not available for use.
There is no response from the slave station connected ahead of the gateway device.
Not issued by the C24.
Not issued as a response message by the C24.
Not issued by the C24.
29
29 TROUBLESHOOTING
29.6 MODBUS Exception Code List
543
APPENDIX
Appendix 1
Module Label
The input/output signal and buffer memory of C24 can be set by using module label.
Module label configuration
A name of module label is defined in the configuration below:
"Instance name"_"Module number"."Channel number"."Label name"
"Instance name"_"Module number"."Label name"
"Instance name"_"Module number"."Channel number"."Label name"_D
"Instance name"_"Module number"."Label name"_D
Ex.
C24_1.stnCH1.uSet_ReceivedDataCount_Reception_D
■
Instance name
The instance name for RJ71C24(-R2/R4) is "C24".
■
Module number
A module number is a number starting from 1, which is added to identify a module that has the same instance name.
■
Channel number
A channel number is a number added to the module label corresponding to a buffer memory other than the CH1/CH2 common area.
For module label corresponding to a buffer memory other than the CH1/CH2 common area, the following content is added as the channel number.
Channel number
CH1
CH2
Content to be added stnCH1 stnCH2
■
Label name
This is a module unique label name.
■
_D
This indicates that the module label is for direct access. Without this symbol means a label for refresh. There are some differences between refresh and direct access as shown below.
Type
Refresh
Direct access
Description
Values written to/read from a module label are reflected to the module in batch at the time of refresh. This shortens program execution time.
Values written to/read from a module label are immediately reflected to the module. Although the program execution time is longer than refresh, the responsiveness will be increased.
Access timing
At the time of refresh
At the time of writing to/ reading from module label
544
APPX
Appendix 1 Module Label
Appendix 2
Input/Output Signal List
This section explains the input/output signals of C24.
The input/output signal assignments in the table below are when the start I/O number of C24 is '0000'.
The devices starting with X indicate input signals from a C24 to CPU module.
The devices starting with Y indicate output signals from a CPU module to C24.
Do not output (turn ON) the signals of "Use prohibited" in the input/output signal list shown below.
If any of the "Use prohibited" signals is output, the programmable controller system may malfunction.
A
APPX
Appendix 2 Input/Output Signal List
545
Input signals
Device number
X5
Signal name
CH1 Transmission normal completion
CH1 Transmission abnormal completion
CH1 Transmission processing
CH1 Reception data read request
CH1 Reception abnormal detection
CH1 Protocol execution completion
CH1 Switching mode
CH2 Transmission normal completion
CH2 Transmission abnormal completion
CH2 Transmission processing
CH2 Reception data read request
CH2 Reception abnormal detection
Reference
Page 57 Receiving Data from Target
Page 90 Receiving Data from Target
XC
XD
CH2 Protocol execution completion
CH2 Switching mode
Page 57 Receiving Data from Target
Page 90 Receiving Data from Target
XF
X10
X11
X12
X13
X14
X15 to X16
X19
X1A
X1B
X1C
X1D
CH1 Error occurrence
CH2 Error occurrence
Modem initialization completion
Dialing
Connection
Initialization/connection abnormal completion
Modem disconnection completion
Use prohibited
User frame read completion from flash ROM
User frame write completion from flash ROM
Use prohibited
CH1 Global signal
CH2 Global signal
Parameter initialization completion
Predefined protocol ready
Page 192 List of input/output signals for the modem function
MELSEC Communication Protocol
Reference Manual
Page 52 Execution Condition of
Predefined Protocol Communication
X1F
Module READY
Watchdog timer error
*1 The device does not turn ON/OFF by executing a dedicated instruction when using a function that corresponds to the input signal.
*2 The device turns ON/OFF by executing a dedicated instruction when using a function that corresponds to the input signal.
(ON OFF: Data read completion)
*3 The 'CH Switching mode' (X6/XD) turns ON when the following function is performed.
Mode switching, transmission sequence initialization, reception data clear (by buffer memory), user frame use enable/disable designation, UINI instruction, programmable controller CPU information clear
While the 'CH Switching mode' (X6/XD) is ON, do not issue a communication request to a target interface.
(The transmission/reception processing of C24 is stopped while the 'CH Switching mode' (X6/XD) is ON.)
*4 The C ERR LED of the same channel also turns ON when an error occurs.
'CH Error occurrence' (XE/XF) turns OFF when 'Error initialization request' (YE) turns ON or the data transmission/reception processing is performed normally.
*5 'Predefined protocol ready' (X1D) is a signal that turns ON when predefined protocol communication becomes ready.
*6 Module READY is a signal that sends a signal of the applicability of accessing to C24 from the CPU module.
Use it as an interlock signal for a program.
*7 Restart the CPU module when the watchdog timer error is turned ON.
If the error still occurs after restarting, refer to the following section and take corrective actions.
546
APPX
Appendix 2 Input/Output Signal List
YA
YB to YD
YE
YF
Y10
Y11
Y12
Y13 to Y16
Y17
Y18
Y19 to Y1B
Y1C
Y1D to Y1F
Output signals
Device number
Y0
Y1
Y2
Y3
Y4 to Y6
Y7
Y8
Y9
Signal name
CH1 Transmission request
CH1 Reception data read completion
CH1 Mode switching request
CH1 protocol execution request
Use prohibited
CH2 Transmission request
CH2 Reception data read completion
CH2 Mode switching request
CH2 protocol execution request
Use prohibited
Error initialization request
Use prohibited
Modem initialization request
Connection request
Modem disconnection request
Use prohibited
User frame read request from flash ROM
User frame write request to flash ROM
Use prohibited
Parameter initialization request
Use prohibited
Reference
Page 492 Turning OFF the ERR LED and initializing the error codes
Page 192 List of input/output signals for the modem function
A
APPX
Appendix 2 Input/Output Signal List
547
Appendix 3
Buffer Memory
The buffer memory is the memory of C24 used for storing data (setting values, monitoring values, etc.) transmitted to or received from the CPU module.
Initial values are set to the buffer memory.
When changing the initial values, set the parameters with Engineering tool.
For details, refer to the following section.
Configuration of buffer memory
A buffer memory consists of a user area and a system area as shown below.
■
User area
• User area is an area where a user can read/write data.
• The user area consists of areas for storing setting values for data communication, for actual data communication, and for storing communication status and communication error information.
• Read/write data from/to the user area in accordance with the instructions in the corresponding reference section.
■
System area
System area is an area used by the C24 system.
Buffer memory assignment list
A buffer memory is configured with 16 bits per address.
Names, default values, etc. of each address of the buffer memory are as shown below.
■
Meaning of abbreviations in "Protocol" column
MC: MC protocol
Non: Nonprocedural protocol
Bi: Bidirectional protocol
Pd: Predefined protocol
MD: MODBUS (slave function)
S: Simple CPU communication
■
Meaning of symbols in "Protocol" column
The following symbols are assigned to protocols related to the setting values of a corresponding area and to areas used for control by user settings.
R, W: An area where data can be read/written from/to the CPU module and an target device.
R: An area where data can only be read from the CPU module and an target device.
: System area used by the system or area not used by the corresponding protocol.
548
APPX
Appendix 3 Buffer Memory
Precautions
• Do not write data in the "System area" of the buffer memory.
If data is written to any of the system areas, the programmable controller system may malfunction.
The system area exists in the user area partially, therefore, take caution when reading from/writing to the buffer memory.
• To use the dedicated instructions, change the following initial settings (default values) for data communications by setting parameters with an Engineering tool, or by executing the CSET instruction in the program.
Initial setting
Communication using MC protocol
Communication using nonprocedural/ bidirectional protocols
Setting the unit of data length sent by the ondemand function
Setting the buffer memory used by the ondemand function
Setting the unit of data length to be sent and received
Setting the data send area
Setting item
• "Word/byte units designation" (addresses: 96H/136H)
• "Buffer memory start address designation" (addresses: A0H/
140H)
• "Send buffer memory length designation" (addresses: A3H/143H)
• "Word/byte units designation" (addresses: 96H/136H)
Setting the data receive area
• "Send buffer memory start address designation" (addresses:
A2H/142H)
• "Send buffer memory length designation" (addresses: A3H/143H)
• "Receive buffer memory length designation" (addresses: A7H/
147H)
For details on the registration operation by an Engineering tool, refer to the following section.
For the CSET instruction, refer to the following manual.
MELSEC iQ-R Programming Manual (Module Dedicated Instructions)
A
APPX
Appendix 3 Buffer Memory
549
Buffer memory list
Purpose Name Address
Dec (Hex)
CH1 CH2
0, 1
(0H, 1H)
2
(2H)
3
(3H)
4
(4H)
5
(5H)
6 to 45
(6H to 2DH)
46
(2EH)
47
(2FH)
48
(30H)
49
(31H)
50
(32H)
51
(33H)
52
(34H)
53
(35H)
54
(36H)
55
(37H)
56
(38H)
57 to 127
(39H to 7FH)
Defaul t value
Protocol
MC No n
Use prohibited
For flash
ROM (user frame) access
For designation of the modem function-1
Use prohibited
For designation of the modem function-1
System area
Register/read/delete instructions
0: No request
1: Registration request
2: Read request
3: Deletion request
Frame No. direction
0: No designation
Other than 0: Frame number
Registration/read/delete result storage
0: Normal completion
Other than 0: Abnormal completion
Registration data byte count designation
0: No designation
Other than 0: Number of registered data bytes
(maximum 80 bytes)
User frame
0: No designation
Other than 0: Registration data (maximum 80 bytes)
Modem connection CH specification
0: None
1: CH1
2: CH2
System area
Connection re-try count designation
1 to 5: Number of retries
Connection retry interval designation
90 to 300: Connection retry interval (unit: s)
0
0
0
0
0
0
Initialization/connection timeout designation
1 to 60: Timeout time (unit: s)
R, W
R, W
3 (3 times)
180
(180
) seconds
60 (60
) seconds
3 (3 times)
7D0H
R, W
Use prohibited
For designation of the modem function-1
Use prohibited
Number of initialization retries designation
1 to 5: Number of retries
Data No. for initialization designation
0H : Send designated data for initialization by the send user frame designation area.
7D0H to 801FH: Data number for initialization
Data No. for connection designation
0H: No designation
BB8H to 801FH: Data number for connection
System area
No-communication interval time designation
0: Infinite wait
1 to 120: No communication interval (line disconnection wait time)
(unit: min)
RS/CS control enable/disable designation
0: Control disabled
1: Control enabled
System area
0
30 (30 minutes)
1
R, W
Bi Pd MD S
Reference
550
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1
128
(80H)
CH2
129 to 143
(81H to 8FH)
144
(90H)
304
(130H)
145
(91H)
146
(92H)
305
(131H)
306
(132H)
Purpose Name
For programmabl e controller
CPU information clear
Use prohibited
For designation of mode switching
For designation of mode switching
Signal specification
Programmable controller CPU information clear request
0: No request
4C43H: Requested
System area
Switching mode No. designation
0000H: Match the setting in MELSOFT.
0001H: MC protocol (Format 1)
0002H: MC protocol (Format 2)
0003H: MC protocol (Format 3)
0004H: MC protocol (Format 4)
0005H: MC protocol (Format 5)
0006H: Nonprocedural protocol
0007H: Bidirectional protocol
0009H: Predefined protocol
000AH: MODBUS slave (RTU)
000BH: MODBUS slave (ASCII)
00FFH: MELSOFT connection
Transmission specifications after switching designation
Designates transmission specifications after switching when b15 of this area is 1 (ON).
• Operation setting (b0)
0: Independent 1: Interlink
• Data bit (b1)
0: 7 bits 1: 8 bits
For the MODBUS slave (RTU), specify '1: 8 bits.'
• Parity bit (b2)
0: None 1: Yes
• Odd/even parity (b3)
0: Odd 1: Even
• Stop bit (b4)
0: 1 bit 1: 2 bits
• Sum check code (b5)
0: None 1: Yes
• Online change (b6)
0: Disable 1: Enable
• Setting change (b7)
0: Disable 1: Enable
• Communication speed (b8 to b11)
1200 bps to 230400 bps
• For system (b12 to b14)
All 0
• Transmission specifications direction after switching (b15)
0: Match settings in MELSOFT
1: Match settings in this area
RS and DTR signal status designation
0: OFF 1: ON
RS (RTS) signal (b0)
ER (DTR) signal (b2)
For system (b1), (b3) to (b15)
0
0
0
5H
Defaul t value
Protocol
MC No n
R,
W
R, W
R, W
Bi Pd MD S
R,
W
Reference
MELSEC iQ-
R Serial
Communicati on Module
User's
Manual(Start up)
A
APPX
Appendix 3 Buffer Memory
551
Address
Dec (Hex)
CH1 CH2
147
(93H)
148
(94H)
149
(95H)
150
(96H)
Purpose Name
307
(133H)
308
(134H)
309
(135H)
310
(136H)
For designation of transmission control
For designation of communicatio n control
DTR/DSR (ER/DR), DC control designation
• Transmission control (b0)
0: DTR/DSR control
1: DC code control
• DC1/DC3 control (b8)
0: Control disabled
1: Control enabled
• DC2/DC4 control (b9)
0: Control disabled
1: Control enabled
DC1/DC3 (Xon/Xoff) code designation
• DC1 code (b0 to b7)
00H to FFH: DC1 code
• DC3 code (b8 to b15)
00H to FFH: DC3 code
DC2/DC4 code designation
• DC2 code (b0 to b7)
00H to FFH: DC2 code
• DC4 code (b8 to b15)
00H to FFH: DC4 code
Word/byte units designation
0: Word units 1: Byte units
151
(97H)
311
(137H)
152
(98H)
312
(138H)
1412H
0
CD terminal check designation (for RS-232)
0: Check 1: Do not check
1
Communication method designation (for RS-
232)
0: Full-duplex communication 1: Half-duplex communication
0
153
(99H)
154
(9AH)
155
(9BH)
313
(139H)
314
(13AH)
315
(13BH)
For designation of half-duplex communicatio ns control (for
RS-232)
For designation of communicatio n control
Simultaneous transmission priority/non-priority designation
0: Priority
1 to 255: Non-priority (transmission wait time, unit: 100 ms)
Retransmission time transmission method designation
0: Do not resend 1: Resend
Simultaneous transmission data valid/invalid designation
• Receive data enable/disable (b0)
0: Enable 1: Disable
• Send data enable/disable (b8)
0: Enable 1: Disable
0
0
0
Defaul t value
Protocol
0
MC No n
R, W
Bi Pd MD S
Reference
1311H
R, W
R, W
R, W
R,
W
MELSEC iQ-
R Serial
Communicati on Module
User's
Manual(Start up)
552
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1
156
(9CH)
157
(9DH)
158
(9EH)
159
(9FH)
160
(A0H)
161
(A1H)
CH2
316
(13CH)
317
(13DH)
318
(13EH)
319
(13FH)
320
(140H)
321
(141H)
Purpose Name Defaul t value
Protocol
MC No n
R, W For designation of data communicatio n time monitoring
No-reception monitoring time (timer 0) designation
0H: Unlimited wait
28H to FA0H: Monitoring time (unit: byte)
Response monitoring time (timer 1) designation
0H: Unlimited wait
1H to BB8H: Monitoring time (unit: 100ms)
Send monitoring time (timer 2) designation
0H: Unlimited wait
1H to BB8H: Monitoring time (unit: 100ms)
System area Use prohibited
For designation of on-demand function
Buffer memory start address designation
(400H to 1AFFH, 2600H to 3FFFH)
Data length designation
(0000H to 3400H)
)
0
32H (5 seconds
708H (3 minutes)
CH1:40
0H
CH2:80
0H
0
R,
W
R, W
R,
W
Bi Pd MD S
R, W
Reference
MELSEC
Communicati on Protocol
Reference
Manual
163
(A3H)
164
(A4H)
165
(A5H)
166
(A6H)
162
(A2H)
167
(A7H)
168
(A8H)
169
(A9H)
170
(AAH)
171
(ABH)
172
(ACH)
322
(142H)
323
(143H)
324
(144H)
325
(145H)
326
(146H)
327
(147H)
328
(148H)
329
(149H)
330
(14AH)
331
(14BH)
332
(14CH)
For designation of send area
Send buffer memory start address designation
(400H to 1AFFH, 2600H to 3FFFH)
CH1:
400H
CH2:
800H
200H
For data reception
For designation of receive area
Send buffer memory length designation
(0001H to 1A00H)
Receive end data quantity designation
0001H to 33FEH: Receive end data quantity
Receive end code designation
FFFFH: No designation for receive end code
0H to FFH: Receive end code
Receiving buffer memory start address designation
(400H to 1AFFH, 2600H to 3FFFH)
1FFH
0D0AH:
CR+LF
CH1:
600H
CH2:
A00H
200H
For data reception
For designation of on-demand user frame
Receive buffer memory length designation
(0001H to 1A00H)
Receive data clear request
0: No request 1: Requested
Start frame No. designation, 1st
0: No designation Other than 0: Designated
Start frame No. designation, 2nd
0: No designation Other than 0: Designated
Final frame No. designation, 1st
0: No designation Other than 0: Designated
Final frame No. designation, 2nd
0: No designation Other than 0: Designated
0
0
0
0
0
R, W
R,
W
R, W
R,
W
R,
W
A
APPX
Appendix 3 Buffer Memory
553
Address
Dec (Hex)
CH1 CH2
Purpose Name
173
(ADH)
174 to
177
(AEH to
B1H)
178 to
181
(B2H to
B5H)
182
(B6H)
183
(B7H)
184
(B8H)
185
(B9H)
186 to
285
(BAH to
11DH)
286
(11EH)
343
(157H)
344
(158H)
345
(159H)
346 to
445
(15AH to
1BDH)
446
(1BEH)
333
(14DH)
334 to
337
(14EH to
151H)
338 to
341
(152H to
155H)
342
(156H)
For designation of receive user frame
Sending user frame
For designation of send user frame
For designation of send wait time
User frame use enable/disable designation
0: Not use 1: Use
2: Data communication possible (Set by C24)
Start frame No. designation (1st to 4th)
0H: No designation 1H or more: Start frame No.
Final frame No. designation (1st to 4th)
0H: No designation 1H or more: Final frame No.
Sending user frame
0: Has not been sent
1 to 100: User frame being sent (nth)
CR/LF output designation
0: Do not send 1: Send
Output start pointer designation
0: No designation 1 to 100: Send from nth
Output quantity designation
0: No designation 1 to 100: Output n
Send frame number designation (A maximum of
100 can be designated)
0H: No designation
1H to C01FH: Designated
Transmission wait time designation
0: No wait time
1H to FH: Wait time (unit: 10 ms)
0
0
0DH
0AH
00H
00H
0
0
0
0
0
0
Defaul t value
Protocol
MC No n
R,
W
R,
W
R
R,
W
Bi Pd MD S
R, W 287
(11FH)
288
(120H)
289
(121H)
447
(1BFH)
448
(1C0H)
449
(1C1H)
For designation of transparent code
For conversion designation
Transparent code for sending specification, 1st
0000H: No specification
Other than 0000H: Specified (below)
• Transparent code (b0 to b7)
00H to FFH: Transparent code
• Additional code (b8 to b15)
01H to FFH: Additional code
Transparent code for receiving specification
0000H: No specification
Other than 0000H: Specified (below)
• Transparent code (b0 to b7)
00H to FFH: Transparent code
• Additional code (b8 to b15)
01H to FFH: Additional code
ASCII-binary conversion designation
0: Do not convert 1: Convert
0
0
0 R, W
290
(122H)
450
(1C2H)
For communicatio n control specification
Echo back enable/prohibit specification for RS-
422/485 interface
0: Echo back enable
1: Echo back prohibit
0 R, W
Reference
Setting of receive user frames
554
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1 CH2
Purpose
291
(123H)
451
(1C3H)
For NULL character automatic removal designation
Name
NULL character automatic removal designation for transmission
0: Auto delete disabled
1: Auto delete enabled
0
Defaul t value
Protocol
MC No n
R, W
Bi Pd MD S
292
(124H)
452
(1C4H)
For erroneous reception prevention designation
Communication data reception enable/disable designation
0: Receive enable
1: Receive disable
0 R, W
Reference
293 to
303
(125H to
12FH)
512
(200H)
513
(201H)
514
(202H)
453 to
511
(1C5H to 1FFH)
Use prohibited
For confirmation of station number setting status
For confirmation of LED lighting status and communicatio n error status
System area
Station number (parameter setting)
CH1 side LED lighting status and communication error status
0: LED OFF, no error
1: LED ON, error
SD WAIT (b0)
SIO (b1)
PRO. (b2)
P/S (b3)
C/N (b4)
NAK (b5)
ACK. (b6)
NEU. (b7)
For system (b8) to (b14)
CH1 ERR. (b15)
CH2 side LED lighting status and communication error status
0: LED OFF, no error
1: LED ON, error
SD WAIT (b0)
SIO (b1)
PRO. (b2)
P/S (b3)
C/N (b4)
NAK (b5)
ACK. (b6)
NEU. (b7)
CH2.ERR. (b14)
For system (b8) to (b13),(b15)
Depend s on paramet er setting
Depend s on module status.
R
Depend s on module status.
R
A
APPX
Appendix 3 Buffer Memory
555
Address
Dec (Hex)
CH1 CH2
515
(203H)
516
(204H)
517 to 541
(205H to 21DH)
542
(21EH)
543, 544
(21FH, 220H)
Purpose
For confirmation of parameter setting and mode switching
For confirmation of user frame
For confirmation of user frame
Use prohibited
Name Defaul t value
Protocol
• Parameter setting error and mode switching error status
0: No error
Other than 0: Parameter setting error and mode switching error
• CH1 Communication protocol setting number
(b0)
0: Normal 1: Error
• CH1 Communication speed setting (b1)
0: Normal 1: Error
• CH1 Mode switching at setting change prohibit (b3)
0: Normal 1: Error
• CH2 Communication protocol setting number
(b4)
0: Normal 1: Error
• CH2 Communication speed setting (b5)
0: Normal 1: Error
• CH2 Mode switching at setting change prohibit (b7)
0: Normal 1: Error
• Setting station No. (b14)
0: Normal 1: Error
• Interlink operation setting (b15)
0: Normal 1: Error
Number of registered user frames
0: No registration 1 to 200: Number of registered frames
0
User frame registration status (for registration number check)
0: No registration 1: Registered
Bit corresponding to registration No. is 0(OFF)/
1(ON).
Registration No. 3E8H (1000): Address 205H
(b0) to Registration No. 4AFH(1199): Address
211H (b7)
Number of registered default registration frames
(for system)
Depend s on registrati on status.
Depend s on registrati on status.
R
System area
Depend s on registrati on status.
MC No n
R
Bi Pd MD S
Reference
Intelligent function module monitor
Default registration frame (read only)
556
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1 CH2
545
(221H)
546
(222H)
547
(223H)
548, 549
(224H, 225H)
550
(226H)
551, 552
(227H, 228H)
553 to 589
(229H to 24DH)
590
(24EH)
591
(24FH)
Purpose Name Defaul t value
Protocol
For confirmation of the modem function
Modern function error code
(error code when the modem function is being used)
0: Normal completion
Other than 0 (error code) : Abnormal completion
Modem function sequence status
0: Idle
1: Waiting for initialization
2: Initializing modem
3: Waiting
4: Checking password
5: Communicating
7: Modem disconnected
Number of data registration for connection
0: No registration 1 to 30: Number of registrations
0
0
Data registration status for connection (for confirmation of registration No.)
0: No registration 1: Registered
Bit corresponding to registration No. is 0(OFF)/
1(ON).
Registration No. BB8H (3000) : Address 224H
(b0) to Registration No. BD5H (3029) : Address
225H (b13)
Number of data registration for initialization
0: No registration 1 to 30: Number of registrations
Depend s on registrati on status.
Depend s on registrati on status.
For confirmation of the modem function
Data registration status for initialization (for confirmation of registration No.)
0: No registration 1: Registered
Bit corresponding to registration No. is 0(OFF)/
1(ON).
Registration No.9C4H (2500) : Address 227H
(b0) to Registration No. 9E1H (2529) : Address
228H (b13)
System area
R
Depend s on registrati on status.
Depend s on registrati on status.
R
Use prohibited
For confirmation of test mode status
For confirmation of station number setting status
Test mode setting status
0000H: No specification
0001H: Hardware Tests
0002H: Self-loopback test
Station number (instruction setting)
(0 to 31)
Depend s on paramet er setting.
Depend s on module status.
R
R
MC No n
R, W
Bi Pd MD S
R
Reference
Intelligent function module monitor
A
APPX
Appendix 3 Buffer Memory
557
Address
Dec (Hex)
CH1
592
(250H)
593
(251H)
CH2
608
(260H)
609
(261H)
Purpose
For confirmation of transmission control status
Name
Communication protocol status (parameter setting)
0: MELSOFT Connection
1: MC protocol (Format 1)
2: MC protocol (Format 2)
3: MC protocol (Format 3)
4: MC protocol (Format 4)
5: MC protocol (Format 5)
6: Nonprocedural protocol
7: Bidirectional protocol
8: (For interlink operation)
9: Predefined protocol
AH: MODBUS slave (RTU)
BH: MODBUS slave (ASCII)
10H: Simple CPU communication
Transmission setting status (parameter setting)
• Operation setting (b0)
0: Independent 1: Interlink
• Data bit (b1)
0: 7 bits 1: 8 bits
• Parity bit (b2)
0: None 1: Yes
• Odd/even parity (b3)
0: Odd 1: Even
• Stop bit (b4)
0: 1 bit 1: 2 bits
• Sum check code (b5)
0: None 1: Yes
• Online change (b6)
0: Disable 1: Enable
• Setting change (b7)
0: Disable 1: Enable
• Communication speed (b8 to b11)
1200 bps to 230400 bps
• For system (b12 to b15)
All 0
Defaul t value
Protocol
MC No n
R Depend s on paramet er setting.
Depend s on paramet er setting.
R
Bi Pd MD S
Reference
558
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1
594
(252H)
595
(253H)
596
(254H)
597
(255H)
598
(256H)
599
(257H)
600
(258H)
601
(259H)
CH2
610
(262H)
611
(263H)
612
(264H)
613
(265H)
614
(266H)
615
(267H)
616
(268H)
617
(269H)
Purpose Name
For confirmation of transmission control status
Control signal status
For confirmation of communicatio n result
Use prohibited
Communication protocol status (current)
0: MELSOFT connection
1: MC protocol (Format 1)
2: MC protocol (Format 2)
3: MC protocol (Format 3)
4: MC protocol (Format 4)
5: MC protocol (Format 5)
6: Nonprocedural protocol
7: Bidirectional protocol
8: (For interlink operation)
9: Predefined protocol
AH: MODBUS slave (RTU)
BH: MODBUS slave (ASCII)
10H: Simple CPU communication
Transmission status (current)
• Operation setting (b0)
0: Independent 1: Interlink
• Data bit (b1)
0: 7 bits 1: 8 bits
• Parity bit (b2)
0: None 1: Yes
• Odd/even parity (b3)
0: Odd 1: Even
• Stop bit (b4)
0: 1 bit 1: 2 bits
• Sum check code (b5)
0: None 1: Yes
• Online change (b6)
0: Disable 1: Enable
• Setting change (b7)
0: Disable 1: Enable
• Communication speed (b8 to b11)
1200 bps to 230400 bps
• For system (b12 to b15)
All 0
RS-232 control signal status
0: OFF status 1: ON status
RS(RTS) (b0)
DR(DSR) (b1)
ER(DTR) (b2)
CD(DCD) (b3)
CS(CTS) (b4)
CI(RI) (b5)
Not used (b6 to b15) All 0
Transmission sequence status (For confirmation of MC protocol communication status)
0: Waiting for receiving command message
1: Receiving command message
2: Command message reception complete
3: Waiting to access CPU module
4: Accessing CPU module
5: CPU module access complete
6: Response message transmission
On-demand execution results
0: Normal completion Other than 0: Abnormal completion (error code)
Data transmission result
0: Normal completion Other than 0: Abnormal completion (error code)
Data reception result
0: Normal completion Other than 0: Abnormal completion (error code)
System area
Defaul t value
Protocol
Depend s on module status.
Depend s on module status.
Depend s on signal status.
0
0
0
0
MC No n
R
R
R
R,
W
R, W
Bi Pd MD S
Reference
Intelligent function module monitor
Intelligent function module monitor
APPX
Appendix 3 Buffer Memory
559
A
Address
Dec (Hex)
CH1 CH2
Purpose Name
602
(25AH)
603
(25BH)
618
(26AH)
619
(26BH)
For confirmation of communicatio n result
MC protocol send error code
(excludes 1C frame communication)
0: No error 1 or more: Send error code
Receive user frame (nth)
0: Has not been received
1 to 4: Combination of user frame No. designations for reception message
System area 604 to
607
(25CH to 25FH)
1024
(400H)
620 to
1023
(26CH to 3FFH)
2048
(800H)
Use prohibited
Send/receive
Send data quantity designation
0: No designation 1 or more: Number of send data
Send data specification
Data to be sent to a target device
1025 to
1535
(401H to
5FFH)
1536
(600H)
2049 to
2559
(801H to
9FFH)
2560
(A00H)
Receive data quantity (Number of data for which read is requested)
0: No receive data 1 or more: Receive data quantity
Receive data
Data received from a target device
1537 to
2047
(601H to
7FFH)
2561 to
3071
(A01H to
BFFH)
3072 to 6911
(C00H to 1AFFH)
For user User setting area (3840 words)
Determined by the user.
0
0
0
0
0
0
Defaul t value
Protocol
0
MC No n
R,
W
Bi Pd MD S
R, W
R, W
R
Reference
Receive area and receive data arrangement
Send area and send data arrangement
560
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1 CH2
Purpose
6912 to 6952
(1B00H to 1B28H)
6953 to 6993
(1B29H to 1B51H)
6994 to 7034
(1B52H to 1B7AH)
7035 to 7075
(1B7BH to 1BA3H)
7076 to 7116
(1BA4H to 1BCCH)
7117 to 7157
(1BCDH to 1BF5H)
7158 to 7198
(1BF6H to 1C1EH)
7199 to 7239
(1C1FH to 1C47H)
7240 to 7280
(1C48H to 1C70H)
7281 to 7321
(1C71H to 1C99H)
7322 to 7362
(1C9AH to 1CC2H)
7363 to 7403
(1CC3H to 1CEBH)
7404 to 7444
(1CECH to 1D14H)
7445 to 7485
(1D15H to 1D3DH)
7486 to 7526
(1D3EH to 1D66H)
7527 to 7567
(1D67H to 1D8FH)
7568 to 7608
(1D90H to 1DB8H)
7609 to 7649
(1DB9H to 1DE1H)
7650 to 7690
(1DE2H to 1E0AH)
7691 to 7731
(1E0BH to 1E33H)
7732 to 7772
(1E34H to 1E5CH)
7773 to 7813
(1E5DH to 1E85H)
For user registration
Name
For registration No. 8001H
For registration No. 8002H
For registration No. 8003H
For registration No. 8004H
For registration No. 8005H
For registration No. 8006H
For registration No. 8007H
For registration No. 8008H
For registration No. 8009H
For registration No. 800AH
For registration No. 800BH
For registration No. 800CH
For registration No. 800DH
For registration No. 800EH
For registration No. 800FH
For registration No. 8010H
For registration No. 8011H
For registration No. 8012H
For registration No. 8013H
For registration No. 8014H
For registration No. 8015H
For registration No. 8016H
Defaul t value
Protocol
MC No n
Bi Pd MD S
The user registration area is used together for the following usage, with data written by the user according to the purpose of use by the TO instruction, etc.
■ When data is communicated using user frames
• User frame
■ When data is communicated using the modem function
• Data for initialization
• Data for connection
Reference
A
APPX
Appendix 3 Buffer Memory
561
Address
Dec (Hex)
CH1 CH2
Purpose Name
7814 to 7854
(1E86H to 1EAEH)
7855 to 7895
(1EAFH to 1ED7H)
7896 to 7936
(1ED8H to 1F00H)
7937 to 7977
(1F01H to 1F29H)
7978 to 8018
(1F2AH to 1F52H)
8019 to 8059
(1F53H to 1F7BH)
8060 to 8100
(1F7CH to 1FA4H)
8101 to 8141
(1FA5H to 1FCDH)
8142 to 8182
(1FCEH to 1FF6H)
8183 to 8198
(1FF7H to 2006H)
8199
(2007H)
For user registration
For registration No. 8017H
For registration No. 8018H
For registration No. 8019H
For registration No. 801AH
For registration No. 801BH
For registration No. 801CH
For registration No. 801DH
For registration No. 801EH
For registration No. 801FH
8200
(2008H)
8201
(2009H)
8202, 8203
(200AH, 200BH)
8204
(200CH)
8205
(200DH)
8206
(200EH)
8207
(200FH)
8208
(2010H)
8209
(2011H)
8459 to
8463
(210BH to
210FH)
8464
(2110H)
Interrupt specification
8465
(2111H)
Use prohibited
For designation of the modem function -2
System area
Auto modem initialization designation
0: Do not automatically initialize 1:
Automatically initialize
Modem initialization DR (DSR) signal enable/ disable designation
0: DR signal enabled
1: DR signal disabled
Complete signal handling for modem function designation
0: Do not turn ON/OFF X13, X14.
1: Turn ON/OFF X13, X14.
System area Use prohibited
For remote password function
For designation of the modem function -3
Use prohibited
Remote password mismatch notification count designation
0H: No designation
1H to FFFFH: Number of times for notification
Remote password mismatch notification accumulated count designation
0H: No designation
1H to FFFFH: Cumulative number of times for notification
Line disconnection wait time specification (PLC
CPU monitor)
0000H to FFFFH: Wait time (unit: s)
System area
0
1
1
0
1
0
Use prohibited
Receive interrupt-issued designation
0: Do not issue interrupt.
1: Issue interrupt.
System area
0
Defaul t value
Protocol
MC No n
Bi Pd MD S
The user registration area is used together for the following usage, with data written by the user according to the purpose of use by the TO instruction, etc.
■ When data is communicated using user frames
• User frame
■ When data is communicated using the modem function
• Data for initialization
• Data for connection
R, W
R,
W
R, W
R, W
Reference
562
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1
8210
(2012H)
8211
(2013H)
8212
(2014H)
CH2
8466
(2112H)
8467
(2113H)
8468
(2114H)
Purpose Name
For designation of transmission control
Use prohibited
Transmission control start free space designation
64 to 4095: transmission control start free space
Transmission control end free space designation
263 to 4096: transmission control end free space
Nonprocedural no-reception monitoring time method designation
0: Method 0 1: Method 1
System area
64
263
0
Defaul t value
Protocol
MC No n
R, W
R,
W
8213 to
8215
(2015H to
2017H)
8216
(2018H)
8469 to
8471
(2115H to
2117H)
8472
(2118H)
8217
(2019H)
8473
(2119H)
Send/receive data monitoring function
Send/receive data monitoring designation
0000H: No monitor/stop instruction
0001H: Monitor start instruction
0002H: Monitoring (set by C24.)
1002H: Monitoring stopped (set by C24.)
100FH: Monitor setting error (set by C24.)
Monitor option specification
0: OFF 1: ON
Stop at buffer full specification (b0)
0 timer error outbreak stop designation (b2)
For system (b1), (b3) to (b15)
Monitor buffer start address designation
(400H to 1AFDH, 2600H to 3FFDH)
0
0
8218
(201AH)
8474
(211AH)
8488 to
8495
(2128H to
212FH)
8496 to
8504
(2130H to
2138H)
8475
(211BH)
8476 to
8479
(211CH to
211FH)
8480 to
8483
(2120H to
2123H)
8484 to
8487
(2124H to
2127H)
8232 to
8239
(2028H to
202FH)
8240 to
8248
(2030H to
2038H)
8219
(201BH)
8220 to
8223
(201CH to
201FH)
8224 to
8227
(2020H to
2023H)
8228 to
8231
(2024H to
2027H)
Use prohibited
For designation of user frame receiving method
Use prohibited
For designation of transparent code
Monitor buffer size designation
(0003H to 1A00H)
System area
User frame receiving method designation (1st to
4th)
0: Method 0, 1: Method 1
Method 1 dedicated receive end data quantity designation (1st to 4th)
0 or more: Method 1 dedicated receive end data quantity designation
System area
Transparent code for sending specification (2nd to 10th)
0000H: No specification
Other than 0000H: Specified (below)
• Transparent code (b0 to b7)
00H to FFH : Transparent code
• Additional code (b8 to b15)
01H to FFH : Additional code
CH1:
2600H
CH2:
3300H
0D00H
0
0
0
R, W
R,
W
R, W
Bi Pd MD S
Reference
C24 DTR control contents and free OS area specification
Send/receive data monitoring operation
Setting of receive user frames
A
APPX
Appendix 3 Buffer Memory
563
8249 to
8255
(2039H to
203FH)
8256
(2040H)
8257
(2041H)
Address
Dec (Hex)
CH1
8258
(2042H)
8259
(2043H)
8260
(2044H)
8261
(2045H)
8262
(2046H)
8263 to
8268
(2047H to
204CH)
CH2
Purpose Name
8505 to
8511
(2139H to
213FH)
8512
(2140H)
8513
(2141H)
8514
(2142H)
Use prohibited
For designation of programmabl e controller
CPU monitoring function
System area
Cycle time units designation
0: 100 ms 1: s 2: min
Cycle time designation (programmable controller CPU monitoring interval time)
0H: No designation
1H to FFFFH: Programmable controller CPU monitoring interval time
Programmable controller CPU monitoring function designation
0: Do not use the function.
1: Fixed cycle send
2: Condition match send
System area 8515
(2143H)
8516
(2144H)
8517
(2145H)
8518
(2146H)
2
5H
0
Send pointer designation (For fixed cycle send and nonprocedural data transmission)
0: No specification
1 to 100: Output head point (send from the nth)
Send the user frames designated in the following send frame number designation areas from the designated pointer position.
(addresses: CH1 side = BAH to 11DH, CH2 side
= 15AH to 1BDH)
Output quantity designation (for fixed cycle send and nonprocedural data transmission)
0: No specification
1 to 100:Output quantity (Specify the number of frame to be transmitted.)
Data No. for connection designation (for fixed cycle send)
0: No designation
0BB8H to 0BD5H, 8001H to 801FH: Data No. for connection
System area
0
0
0
8519 to
8524
(2147H to
214CH)
Use prohibited
Defaul t value
Protocol
MC No n
R
R
R
Bi Pd MD S
Reference
564
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1 CH2
8269
(204DH)
8270
(204EH)
8271
(204FH)
8272
(2050H)
8273,
8274
(2051H,
2052H)
8275
(2053H)
8276
(2054H)
8277
(2055H)
8278
(2056H)
8279
(2057H)
8280
(2058H)
8281 to
8361
(2059H to
20A9H)
Purpose Name Defaul t value
Protocol
MC No n
R
Bi Pd MD
8525
(214DH)
8526
(214EH)
8527
(214FH)
8528
(2150H)
For designation of programmabl e controller
CPU monitoring function
Registered word block quantity designation
0: No designation
1 to 10: Number of blocks of word devices
(Up to 10 blocks can be designated in total.)
Registered bit block quantity designation
0: No designation
1 to 10: Number of blocks of bit devices
(Up to 10 blocks can be designated in total.)
CPU error monitoring designation
0: Do not monitor. 1: Monitor.
1st block monitoring device
Monitoring device designation
0: No designation
90H to CCH: Device code
1st block monitoring device
Start device No. specification
0 or more: Start device number
0
0
0
0
8529,
8530
(2151H,
2152H)
8531
(2153H)
8532
(2154H)
8533
(2155H)
8534
(2156H)
8535
(2157H)
8536
(2158H)
8537 to
8617
(2159H to
21A9H)
0
For designation of programmabl e controller
CPU monitoring function
1st block monitoring device
Number of read points specification
0: No specification
1 or more: read point
1st block monitoring device
Monitoring condition specification (judgment condition specification)
0: No specification
1 or more: Monitoring condition
0
0
1st block monitoring device
Monitoring condition value designation
• At bit device
0: OFF 1: ON
• At word device
0 to FFFFH: Monitoring condition value
1st block monitoring device
Send pointer designation
(for condition match send and nonprocedural data transmission)
0: No designation
1 to 100: Output head point (send from the nth)
Send the user frames designated in the following send frame number designation areas from the designated pointer position.
(address: CH1 side = BAH to 11DH, CH2 side =
15AH to 1BDH)
0
0
R
R
1st block monitoring device
Output quantity designation
(for condition match send and nonprocedural data transmission)
0: No designation
1 to 100: Output quantity
(Designate the number of frame to be transmitted.)
1st block monitoring device
Data No. for connection designation
(for condition match send)
0: No designation
0BB8H to 0BD5H, 8001H to 801FH: Data No. for connection
0
0 R
2nd to 10th block monitoring devices
The structure of each area is the same as the 1st block monitoring device area.
Page 579 Monitoring device areas for the programmable controller CPU monitoring function
S
Reference
APPX
Appendix 3 Buffer Memory
565
A
Address
Dec (Hex)
CH1 CH2
Purpose Name
8425 to
8458
(20E9H to
210AH)
8704 to
8707
(2200H to
2203H)
8708
(2204H)
8362 to
8421
(20AAH to
20E5H)
8422
(20E6H)
8423
(20E7H)
8424
(20E8H)
8709
(2205H)
8710
(2206H)
8711
(2207H)
8681 to
8703
(21E9H to
21FFH)
8960 to
8963
(2300H to
2303H)
8964
(2304H)
8618 to
8677
(21AAH to
21E5H)
8678
(21E6H)
Use prohibited
8679
(21E7H)
8680
(21E8H)
System area
For designation of programmabl e controller
CPU monitoring function
Use prohibited
CPU error monitoring designation
Send pointer designation
(for condition match send and nonprocedural data transmission)
0: No designation
1 to 100: Output head point (send from the nth)
Send the user frames designated in the following send frame number designation areas from the designated pointer position.
CH1 side = BAH to 11DH
CH2 side = 15AH to 1BDH
CPU error monitoring designation
Output quantity designation
(for condition match send and nonprocedural data transmission)
0: No designation
1 to 100: Output quantity (number of frame to be transmitted)
CPU error monitoring designation
Data No. for connection designation
(for condition match send)
0: No designation
0BB8H to 0BD5H, 8001H to 801FH: Data No. for connection
System area
0
0
0
Use prohibited
Programmabl e controller
CPU monitoring function
System area
0
8965
(2305H)
8966
(2306H)
8967
(2307H)
Programmable controller CPU monitoring function operation status
0: Not executed
1: Wait for programmable controller CPU monitoring time
2: Accessing programmable controller CPU
3: Sending monitoring results
Programmable controller CPU monitoring function execution result (current)
0: Normal completion Other than 0: Abnormal completion (error code)
Programmable controller CPU monitoring function number of transmission
0: Not executed 1 or more: Number of transmissions
Monitoring condition attained block No.
0: No block of which monitoring condition is satisfied
1 to 10: Registration order of word/bit block
(nth)
4096 : CPU abnormal monitoring block
The latest block No. for which monitoring condition is satisfied is stored.
0
0
0
Defaul t value
Protocol
MC No n
R
R
R
Bi Pd MD S
Reference
566
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1 CH2
Purpose Name
8712 to
8948
(2208H to
22F4H)
8949 to 8954
(22F5H to 22FAH)
8955
(22FBH)
16385
(4001H)
16386
(4002H)
16388 to
16395
(4004H to
400BH)
16396 to
16403
(400CH to
4013H)
8968 to
9215
(2308H to
23FFH)
16417
(4021H)
16418
(4022H)
Use prohibited
System area
8956
(22FCH)
8957, 8958
(22FDH, 22FEH)
8959
(22FFH)
9216
(2400H)
9217
(2401H)
9218 to 9727
(2402H to 25FFH)
9728 to 16383
(2600H to 3FFFH)
16384
(4000H)
16387
(4003H)
16416
(4020H)
16419
(4023H)
16420 to
16427
(4024H to
402BH)
16428 to
16435
(402CH to
4033H)
Use prohibited
For the remote password function
System area
Accumulated count of unlock process normal completion
0 or more: Accumulated count of normal completion
Accumulated count of unlock process abnormal completion
0 or more: Accumulated count of abnormal completion
System area Use prohibited
For the remote password function
Use prohibited
For storage of number of flash ROM write
Use prohibited
For user
Accumulated count of lock process by line disconnection
0 or more: Accumulated count of lock process by line disconnection
System area
Flash ROM write count
0 to 1000: Number of rewriting
System area
For designation of predefined protocol function control data
Use prohibited
For designation of predefined protocol function control data
User setting area 2 (6656 words)
(Send/receive data monitoring function default buffer)
Usage is determined by the user.
Number of consecutive protocol executions
0: No protocol executed
1 to 8: Number of protocols to be executed continuously
System area
Execution results
0: Normal completion
Other than 0: Abnormal completion (error code)
Result of the execution count
0: No protocol executed
1 to 8: Number of executed protocol for continuous execution
Protocol number
0: No designation
1 to 128, 201 to 207: Protocol number to be executed
Matched packet No.1 to 8
0: No matched packet
1 to 16: Matched packet No.
0
0
0
0
0
0
0
0
0
0
Defaul t value
Protocol
MC No n
R,
W
R,
W
R
R, W
Bi Pd MD S
R,
W
R
R
R,
W
R
Reference
A
APPX
Appendix 3 Buffer Memory
567
Address
Dec (Hex)
CH1 CH2
Purpose Name
16404 to
16415
(4014H to
401FH)
16448
(4040H)
16449
(4041H)
16450
(4042H)
16451
(4043H)
16436 to
16447
(4034H to
403FH)
16464
(4050H)
Use prohibited
16465
(4051H)
For designation of predefined protocol function control data
For confirmation of predefined protocol function execution status
16466
(4052H)
16467
(4053H)
System area
Protocol cancel
0: No cancel direction (default)
1: Cancel request (set by user)
2: Cancel completed (set by C24)
Protocol execution status
0: Unexecuted (default)
1: Waiting for transmission
2: Sending
3: Waiting for data reception
4: Receiving
5: Completed
Predefined protocol function error code
0: Normal
Other than 0: Error (error code)
Protocol execution count
0: No log
1 to 65535: Number of executions
System area 16452 to
16463
(4044H to
404FH)
16468 to
16479
(4054H to
405FH)
16480 to 16517
(4060H to 4085H)
16518
(4086H)
Use prohibited
Use prohibited
Protocol setting data error information
16519
(4087H)
System area
16520
(4088H)
16521
(4089H)
16522 to 16527
(408AH to 408FH)
Use prohibited
Protocol No.
1 to 128: Protocol No.
65535: Unidentified
Setting type
0: Packet setting or element setting
1: Protocol detailed setting
65535: Unidentified
Packet No.
0: Send packet
1 to 16: Receive packet No.
65535: Unidentified
Valid when the Setting type value is 0.
Element No.
1 to 32: Element No.
65535: Unidentified
Valid when the Setting type value is 0.
System area
Defaul t value
Protocol
MC No n
Bi Pd MD S
Reference
0
0
0
0
0
0
0
0
R,
W
R
R
568
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1
16528
(4090H)
CH2
Purpose Name
For confirmation of protocol setting data
Number of registered protocols
0: No registration
1 to 128: Number of registrations
16529 to 16536
(4091H to 4098H)
Protocol registration
0: No registration
1: Registered
The bit corresponding to each protocol No. turns ON or OFF.
* Each bit indicates the corresponding protocol No.
Un\G16529
Un\G16530
Un\G16531
Un\G16532
Un\G16533
Un\G16534
Un\G16535
Un\G16536 b15 b14 b13
80
96
112
128
16
32
48
64
15
31
47
63
79
95
111
127
78
94
110
126
14
30
46
62
29
45
4
100
116 b2 b1 b0
3
19
35
51
67
83
99
115
2
18
34
1
17
33
50
66
82
98
49
65
81
97
114 113
0: Not registered
1: Registered
System area 16537 to 16607
(4099H to 40DFH)
16608,
16609
(40E0H,
40E21)
16610
(40E2H)
16624,
16625
(40F0H,
40F1H)
16626
(40F2H)
Use prohibited
Use prohibited
For designation of protocol execution history
System area
Execution log options
History storage condition
0 (OFF): Error logs of only protocol that completed abnormally are stored.
1 (ON): All protocol execution status and execution logs are stored.
0
0
Defaul t value
Protocol
0
MC No n
Bi Pd MD S
R
Reference
R,
W
16611 to
16623
(40E3H to
40EFH)
16639
(40FFH)
16640
(4100H)
16641
(4101H)
16627 to
16638
(40F3H to
40FEH)
18431
(47FFH)
18432
(4800H)
18433
(4801H)
Use prohibited
Use prohibited
For confirmation of protocol execution history
System area
System area
Number of stored protocol execution logs
0: No log
1 to 32: Number of stored logs
Protocol execution log write pointer
0: No log
1 to 32: Latest protocol execution log No.
0
0
R
16642
(4102H)
18434
(4802H)
Use prohibited
System area
A
APPX
Appendix 3 Buffer Memory
569
Address
Dec (Hex)
CH1 CH2
16677
(4125H)
18469
(4825H)
16678
(4126H)
18470
(4826H)
16679
(4127H)
18471
(4827H)
16680
(4128H)
18472
(4828H)
Purpose
16643
(4103H)
18435
(4803H)
For confirmation of protocol execution history
16644 to
16659
(4104H to
4113H)
16660 to
16675
(4114H to
4123H)
16676
(4124H)
18436 to
18451
(4804H to
4813H)
18452 to
18467
(4814H to
4823H)
18468
(4824H)
Name
Execution log 1
Protocol No.
0: No log
1 to 128: Protocol No.
201 to 207: Functional protocol No.
Execution log 1
Target device model
0: No protocol executed
Other than 0: Target device model (Up to 32 bytes are stored in ASCII codes.)
Execution log 1
Protocol name
0: No protocol executed
Other than 0: Protocol name (Up to 32 bytes in
ASCII codes are stored.)
Execution log 1
Communication type
0: No protocol executed
1: Send only
2: Receive only
3: Send and receive
14: Functional protocol
15: Unregistered protocol
Execution log 1
Protocol execution status
0: Unexecuted
1: Waiting for transmission
2: Sending
3: Waiting for reception
4: Receiving
5: Completed
Execution log 1
Execution result
0: Normal completion
Other than 0 (error code): Abnormal completion
Execution log 1
Matched packet No.
0: Error occurred, or Communication type of the executed protocol is "Send only".
1 to 16: Matched receive packet number
Execution log 1
Number of send retries
0: No retry
1 to 10: Number of retries
System area
0
0
0
0
0
0
0
0
Defaul t value
Protocol
MC No n
Bi Pd MD S
R
16681
(4129H)
16682
(412AH)
18473
(4829H)
18474
(482AH)
Use prohibited
For confirmation of protocol execution history
16683
(412BH)
18475
(482BH)
Execution log 1 start time and date
0: No log
Upper 8 bits: Month
Lower 8 bits: Last 2 digits of year b15 to
Month (01H to 12H) b8 b7 to b0
Year (00H to 99H), last 2 digits
0
Execution log 1 start time and date
0: No log
Upper 8 bits: Hour
Lower 8 bits: Day b15 to
Hour (00H to 23H) b8 b7 to
Day (01H to 31H) b0
0
R
Reference
570
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1 CH2
Purpose
16684
(412CH)
18476
(482CH)
For confirmation of protocol execution history
Name
Execution log 1 start time and date
0: No log
Upper 8 bits: Second
Lower 8 bits: Minute b15 to b8 b7
Second (00H to 59H) to
Minute (00H to 59H) b0
Defaul t value
Protocol
0
MC No n
16685
(412DH)
16686
(412EH)
16687
(412FH)
16688
(4130H)
18477
(482DH)
18478
(482EH)
18479
(482FH)
18480
(4830H)
Execution log 1 start time and date
0: No log
Lower 8 bits: First 2 digits of year
Lower 8 bits: Day of week (0: Sun to 6: Sat) b15 to b8 b7
Year (00H to 99H), first 2 digits to
Day of week (00H to 06H) b0
00H (Sunday) to 06H (Saturday)
Execution log 1 end time and date
0: No log
Upper 8 bits: Month
Lower 8 bits: Last 2 digits of year b15 to
Month (01H to 12H) b8 b7 to b0
Year (00H to 99H), last 2 digits
Execution log 1 end time and date
0: No log
Upper 8 bits: Hour
Lower 8 bits: Day b15 to
Hour (00H to 23H) b8 b7 to
Day (01H to 31H) b0
Execution log 1 end time and date
0: No log
Upper 8 bits: Second
Lower 8 bits: Minute b15 to b8 b7 to
Second (00H to 59H) Minute (00H to 59H) b0
0
0
0
0
16689
(4131H)
18481
(4831H)
Execution log 1 end time and date
0: No log
Lower 8 bits: First 2 digits of year
Lower 8 bits: Day of week (0: Sun to 6: Sat) b15 to b8 b7
Year (00H to 99H), first 2 digits to
Day of week (00H to 06H) b0
00H (Sunday) to 06H (Saturday)
0
16690 to
18177
(4132H to
4701H)
18178 to
18430
(4702H to
47FEH)
18482 to
19969
(4832H to
4E01H)
19970 to
20223
(4E02H to
4EFFH)
20224 to 20231
(4F00H to 4F07H)
Use prohibited
Error address storage area
Execution log 2 to 32
Same as Execution log 1
System area
Stores the buffer memory address of which parameter setting value is set outside the range.
(Up to 8)
0
0
Bi Pd MD S
R
R
20232 to 20479
(4F08H to 4FFFH)
20480 to 24575
(5000H to 5FFFH)
Use prohibited
Send/receive area for predefined protocol function
System area
Predefined protocol function buffer
0 R,
W
Reference
APPX
Appendix 3 Buffer Memory
571
A
Address
Dec (Hex)
CH1 CH2
Purpose Name
24576 to 28671
(6000H to 6FFFH)
28672 to 32639
(7000H to 7F7FH)
32640 to 45159
(7F80H to B067H)
45160 to 49151
(B068H to BFFFH)
49152 to 53247
(C000H to CFFFH)
Use prohibited
System area
Page 573 Buffer memory list for MODBUS
Page 577 Buffer memory list for simple CPU communication
Use prohibited
For user
System area
User setting area for MODBUS
0
Defaul t value
Protocol
MC No n
Bi Pd MD S
R,
W
53248 to 57343
(D000H to DFFFH)
57344 to 65535
(E000H to FFFFH)
For user User setting area for simple CPU communication
System area
0
Use prohibited
*1 The area can be used as a user setting area (the send and receive data storage areas).
Reference
R,
W
MODBUS device assignment parameters
572
APPX
Appendix 3 Buffer Memory
Buffer memory list for MODBUS
Purpose Name Address
Dec (Hex)
CH1 CH2
28672 to 28673
(7000H to 7001H)
28674
(7002H)
28676
(7004H)
28675
(7003H)
28677
(7005H)
28678 to 28679
(7006H to 7007H)
28680 to 28681
(7008H to 7009H)
28682
(700AH)
28683
(700BH)
28684 to 28685
(700CH to 700DH)
28686
(700EH)
MODBUS status storage area
Setting area for
MODBUS
System area
Error code
System area
System area
Device for error status
28687
(700FH)
28688
(7010H)
28689
(7011H)
28690 to 30975
(7012H to 78FFH)
Use prohibited
Default value
Target
CH1/CH2 side exception code storage area
System area
0
Device code
System area
Start device number
CPU response monitoring timer value
0: 5s
Value other than '0': Setting time = Setting value 100 ms
Access target specification when a CC-Link IE Field Network remote head module is mounted
Buffer memory for error status
MODBUS station number setting
Upper 8 bits: CH2 side (1 to 247)
Lower 8 bits: CH1 side (1 to 247)
System area
0101H
R
000A7H R, W
0H R, W
32H(5s) R, W
0
0
R, W
R, W
Reference
Page 465 MODBUS slave settings
A
APPX
Appendix 3 Buffer Memory
573
Address
Dec (Hex)
CH1 CH2
31170 to 31171
(79C2H to 79C3H)
31172
(79C4H)
31173
(79C5H)
31174 to 31263
(79C6H to 7A1FH)
31264
(7A20H)
31265
(7A21H)
31266 to 31267
(7A22H to 7A23H)
31268
(7A24H)
31269
(7A25H)
31270 to 31359
(7A26H to 7A7FH)
31360 to 31748
(7A80H to 7C04H)
30976
(7900H)
30977
(7901H)
30978 to 30979
(7902H to 7903H)
30980
(7904H)
30981
(7905H)
30982 to 31071
(7906H to 795FH)
31072
(7960H)
31073
(7961H)
31074 to 31075
(7962H to 7963H)
31076
(7964H)
31077
(7965H)
31078 to 31167
(7966H to 79BFH)
31168
(79C0H)
31169
(79C1H)
Purpose Name Default value
MODBUS device assignment parameter
Coil assignment 1 Device code
System area
Start device number
Start coil number
Number of assigned points
Coil assignment 2 to
16
Input assignment 1
Same as coil assignment 1
Device code
System area
Start device number
Start input number
Use prohibited
Number of assigned points
Input assignment 2 to 16
Input register assignment 1
Same as input assignment 1
Device code
System area
Start device number
Start input register number
Number of assigned points 0
Input register assignment 2 to 16
Holding register assignment 1
Same as input register assignment 1
Device code
0
System area
0
Start device number
Start holding register number
0
0
0
0
Number of assigned points 0
Holding register assignment 2 to 16
System area
Same as holding register assignment 1 0
0
0
0
0
0
0
0
0
0
0
0
Target
R, W
R, W
R, W
R, W
R, W
R, W
R, W
R, W
Reference
Page 467 MODBUS device assignment parameters
574
APPX
Appendix 3 Buffer Memory
Address
Dec (Hex)
CH1 CH2
31749
(7C05H)
31750
(7C06H)
31751 to 31762
(7C07H to 7C12H)
31763
(7C13H)
31764
(7C14H)
31765
(7C15H)
31766 to 31769
(7C16H to 7C19H)
31770 to 31997
(7C1AH to 7CFDH)
31998
(7CFEH)
31999
(7CFFH)
32000
(7D00H)
32001
(7D01H)
32002
(7D02H)
32003
(7D03H)
32004
(7D04H)
32005 to 32006
(7D05H to 7D06H)
32007
(7D07H)
32008 to 32255
(7D08H to 7DFFH)
32256 to 32511
(7E00H to 7EFFH)
Purpose
MODBUS operating status
Use prohibited
Name Default value
System area
MODBUS station number confirmation
Upper 8 bits: CH2 side (1 to 247)
Lower 8 bits: CH1 side (1 to 247)
When the MODBUS slave function is not used, '0' is stored.
System area
Parameter error information
0
MODBUS device allocation parameter error code storage area
MODBUS device allocation parameter setting result storage area
Device type error
0: Not assigned
1: Coil
2: Input
4: Input register
5: Holding register
MODBUS device allocation parameter setting result storage area
Assigned group No. error
System area
0
0
0
System area
Error log Number of errors occurred
Error log write pointer
0
0
Error log 1 detailed error code
Error log 1 exception code
Error log 1 function code
Error log 1 CH
0
0
0
0
Error log 1 station number
System area
Error log 1 function
0: No error
3: Slave function
4: Others
Error log 2 to 32
(Same as error log 1)
0
0
System area
0
Target
R
R
R
R
Reference
Page 489 Current operation status reading method
Page 467 MODBUS device assignment parameters
A
APPX
Appendix 3 Buffer Memory
575
Address
Dec (Hex)
CH1 CH2
32518
(7F06H)
32519
(7F07H)
32520
(7F08H)
32521
(7F09H)
32522
(7F0AH)
32523
(7F0BH)
32524
(7F0CH)
32525
(7F0DH)
32512
(7F00H)
32513
(7F01H)
32514
(7F02H)
32515
(7F03H)
32516
(7F04H)
32517
(7F05H)
32582
(7F46H)
32583
(7F47H)
32584
(7F48H)
32585
(7F49H)
32586
(7F4AH)
32587
(7F4BH)
32588
(7F4CH)
32589
(7F4DH)
32576
(7F40H)
32577
(7F41H)
32578
(7F42H)
32579
(7F43H)
32580
(7F44H)
32581
(7F45H)
Purpose
MODBUS communication status
Name
CH1/CH2 communication status
Diagnostic data
Bus message count
Diagnostic data
Bus communication error count
Diagnostic data
Character overrun count
Diagnostic data
Message discard count
Diagnostic data
Data discard count
Diagnostic data
Failed transmission count
Diagnostic data
Slave message count
Diagnostic data
Slave no-response count
Diagnostic data
Slave NAK count
Diagnostic data
Slave busy count
Diagnostic data
Exception error count
Diagnostic data
Communications event count
Diagnostic data
2nd byte of end code
Diagnostic data
Communications mode
0: Online mode
1: Force listen only mode
System area 32526 to
32542
(7F0EH to
7F1EH)
32543
(7F1FH)
32544 to
32575
(7F20H to
7F3FH)
32590 to
32606
(7F4EH to
7F5EH)
32607
(7F5FH)
32608 to
32639
(7F60H to
7F7FH)
Communications event log count 0
Communication event log 1 to 64
7F20H
7F21H b15 to
Log 2
Log 4 b8 b7 to
Log 1
Log 3 b0
0
7F3FH
Log 64 Log 63
'1' is stored in the communication event corresponding to each bit.
Default value
Target Reference
0
0
0AH
0
0
0
0
0
0
0
0
0
0
0
R, W
R
Page 490 Check method for the communication status of the
R
576
APPX
Appendix 3 Buffer Memory
Buffer memory list for simple CPU communication
Purpose Name Address
Dec (Hex)
CH1 CH2
32640 to 32671
(7F80H to 7F9FH)
32672 to 32703
(7FA0H to 7FBFH)
32704 to 32735
(7FC0H to 7FDFH)
32736 to 32767
(7FE0H to 7FFFH)
32768 to 32799
(8000H to 801FH)
32800 to 32831
(8020H to 803FH)
Communication status area for simple CPU communication
Request to start communication at request for each setting number
A request contact to start data transmission when "On
Request" is selected for the communication setting is stored.
OFF ON: Requested
ON OFF: Completed
For 512 settings (1 bit per setting)
Request to stop communication for each setting number
A request contact to stop data transmission when "Fixed
Interval" is selected for the communication setting is stored.
OFF ON: Requested
ON OFF: Completed
For 512 settings (1 bit per setting)
Request to restart communication for each setting number
A request contact to restart data transmission when "Fixed
Interval" is selected for the communication setting is stored.
OFF ON: Requested
ON OFF: Completed
For 512 settings (1 bit per setting)
Execution status flag for each setting number
The data transmission/reception status is stored.
ON: Communicating
OFF: Communication stop
For 512 settings (1 bit per setting)
Preparation completion for each setting number
The preparation completion status of the simple CPU communication is stored.
ON: Ready
OFF: Not set, not ready
For 512 settings (1 bit per setting)
System area
Default value
Target
0
0
0
0
0
R, W
R, W
R, W
R
R
Reference
A
APPX
Appendix 3 Buffer Memory
577
Address
Dec (Hex)
CH1 CH2
32832 to 32863
(8040H to 805FH)
Purpose
Diagnostic information area for simple CPU communication
Name
Setting status of each setting number
The setting status of each setting number is stored.
ON: Set
OFF: Not set
For 512 settings (1 bit per setting)
Number of settings
Default value
0
Target
R
32864
(8060H)
32865
(8061H)
32866 to 32871
(8062H to 8067H)
32872
(8068H)
32873
(8069H)
32874
(806AH)
32875
(806BH)
32876
(806CH)
32877
(806DH)
32878
(806EH)
32879
(806FH)
32880 to 32881
(8070H to 8071H)
32882 to 32883
(8072H to 8073H)
32884 to 32885
(8074H to 8075H)
32886 to 32887
(8076H to 8077H)
32888 to 32889
(8078H to 8079H)
32890 to 32891
(807AH to 807BH)
Error clear request
A request to clear the latest error code and exception codes for setting number 1 to 512 diagnostic information is stored.
0 1: Requested
1 0: Completed
System area
Setting No.1 diagnostic information
Setting No.
Communication pattern
Communication setting
Communication destination
Communication status
Station number
Host station CH
Target PLC number
Execution interval [ms] (maximum value)
0
Execution interval [ms] (minimum value)
0
Number of times for normal completion 0
Number of times for abnormal completion
Number of retries
0
0
0
0
0
0
0
0
0
0
Execution interval [ms] (current value) 0
0
0
R
R, W
R
R
R
R
R
R
R
R
R
R
R
R
R
R
32892
(807CH)
32893
(807DH)
32894 to 32895
(807EH to 807FH)
32896 to 45159
(8080H to B067H)
Latest error code
Exception code
System area
0
0
R
R
Setting No.2 to 512 diagnostic information (same as setting No.1 diagnostic information)
■
Addresses of setting No.2 diagnostic information and later
Each address of setting No.2 diagnostic information and later can be calculated with the following formula:
• Address of the buffer memory corresponding to setting No.1 + ((Target setting number - 1) 24)
Reference
Ex.
The address of 'Latest error code' of setting No.512 is as follows:
• 32892+((512-1) 24)=45156
578
APPX
Appendix 3 Buffer Memory
Monitoring device areas for the programmable controller CPU monitoring function
■
CH1 side buffer memory address: decimal (hexadecimal)
Name N-th block monitoring device
1 2 3 4
8272
(2050H)
8273 to
8274
(2051H to
2052H)
8275
(2053H)
8276
(2054H)
8277
(2055H)
8278
(2056H)
8281
(2059H)
8282 to
8283
(205AH to
205BH)
8284
(205CH)
8285
(205DH)
8286
(205EH)
8287
(205FH)
8290
(2062H)
8291 to
8292
(2063H to
2064H)
8293
(2065H)
8294
(2066H)
8295
(2067H)
8296
(2068H)
8299
(206BH)
8300 to
8301
(206CH to
206DH)
8302
(206EH)
8303
(206FH)
8304
(2070H)
8305
(2071H)
8279
(2057H)
8280
(2058H)
8288
(2060H)
8289
(2061H)
8297
(2069H)
8298
(206AH)
8306
(2072H)
8307
(2073H)
5
8308
(2074H)
8309 to
8310
(2075H to
2076H)
8311
(2077H)
8312
(2078H)
8313
(2079H)
8314
(207AH)
8315
(207BH)
8316
(207CH)
6
8317
(207DH)
8318 to
8319
(207EH to
207FH)
8320
(2080H)
8321
(2081H)
8322
(2082H)
8323
(2083H)
8324
(2084H)
8325
(2085H)
7
8326
(2086H)
8327 to
8328
(2087H to
2088H)
8329
(2089H)
8330
(208AH)
8331
(208BH)
8332
(208CH)
8333
(208DH)
8334
(208EH)
8
8335
(208FH)
8336 to
8337
(2090H to
2091H)
8338
(2092H)
8339
(2093H)
8340
(2094H)
8341
(2095H)
8342
(2096H)
8343
(2097H)
9
8344
(2098H)
8345 to
8346
(2099H to
209AH)
8347
(209BH)
8348
(209CH)
8349
(209DH)
8350
(209EH)
8351
(209FH)
8352
(20A0H)
10
8353
(20A1H)
8354 to
8355
(20A2H to
20A3H)
8356
(20A4H)
8357
(20A5H)
8358
(20A6H)
8359
(20A7H)
8360
(20A8H)
8361
(20A9H)
Monitoring device designation
Start device No. specification
Number of read points specification
Monitoring condition specification
(judgment condition specification)
Monitoring condition value designation
Send pointer designation
(for condition match send, data transmission)
Output quantity designation
(for condition match send, data transmission)
Data No. for connection designation
(for condition match send)
■
CH2 side buffer memory address: decimal (hexadecimal)
N-th block monitoring device
1 2 3 4
8528
(2150H)
8529 to
8530
(2151H to
2152H)
8531
(2153H)
8532
(2154H)
8533
(2155H)
8534
(2156H)
8537
(2159H)
8538 to
8539
(215AH to
215BH)
8540
(215CH)
8541
(215DH)
8542
(215EH)
8543
(215FH)
8546
(2162H)
8547 to
8548
(2163H to
2164H)
8549
(2165H)
8550
(2166H)
8551
(2167H)
8552
(2168H)
8555
(216BH)
8556 to
8557
(216CH to
216DH)
8558
(216EH)
8559
(216FH)
8560
(2170H)
8561
(2171H)
5
8564
(2174H)
8565 to
8566
(2175H to
2176H)
8567
(2177H)
8568
(2178H)
8569
(2179H)
8570
(217AH)
6
8573
(217DH)
8574 to
8575
(217EH to
217FH)
8576
(2180H)
8577
(2181H)
8578
(2182H)
8579
(2183H)
7
8582
(2186H)
8583 to
8584
(2187H to
2188H)
8585
(2189H)
8586
(218AH)
8587
(218BH)
8588
(218CH)
8
8591
(218FH)
8592 to
8593
(2190H to
2191H)
8594
(2192H)
8595
(2193H)
8596
(2194H)
8597
(2195H)
9
8600
(2198H)
8601 to
8602
(2199H to
219AH)
8603
(219BH)
8604
(219CH)
8605
(219DH)
8606
(219EH)
8535
(2157H)
8536
(2158H)
8544
(2160H)
8545
(2161H)
8553
(2169H)
8554
(216AH)
8562
(2172H)
8563
(2173H)
8571
(217BH)
8572
(217CH)
8580
(2184H)
8581
(2185H)
8589
(218DH)
8590
(218EH)
8598
(2196H)
8599
(2197H)
8607
(219FH)
8608
(21A0H)
10
8609
(21A1H)
8610 to
8611
(21A2H to
21A3H)
8612
(21A4H)
8613
(21A5H)
8614
(21A6H)
8615
(21A7H)
8616
(21A8H)
8617
(21A9H)
Name
Monitoring device designation
Start device No. specification
Number of read points specification
Monitoring condition specification
(judgment condition specification)
Monitoring condition value designation
Send pointer designation
(for condition match send, data transmission)
Output quantity designation
(for condition match send, data transmission)
Data No. for connection designation
(for condition match send)
A
APPX
Appendix 3 Buffer Memory
579
Appendix 4
Dedicated Instructions
Dedicated instructions are used to simplify programming when using intelligent function module functions.
For details, refer to the following manual.
MELSEC iQ-R Programming Manual (Module Dedicated Instructions)
Dedicated instruction list
List of dedicated instruction
The following table lists the dedicated instructions explained.
Purpose Dedicated instruction
ONDEMAND
Function overview
Sends data using the on-demand function of MC protocol.
On-demand function transmission
Predefined protocol function CPRTCL
Nonprocedural protocol communication
Bidirectional protocol communication
Communication status confirmation
Data transmission/reception
BIDIN
SPBUSY
BUFRCVS
PRR
Executes the protocol setting data registered using the Predefined protocol support function of
Engineering tool.
Transmits data for the designated data count.
Reads received data.
Transmits data for the designated data count.
Reads received data.
Reads the status of data transmission/reception using the dedicated instruction.
Receive data clear
Programmable controller CPU monitoring function
Setting the units of send/receive data quantity
User frame registration to flash
ROM (registration/reading of user frame)
Mode switching
CSET
PUTE
GETE
UINI
Receives data by an interrupt program using nonprocedural or bidirectional protocol communication.
Transmits data with the user frame according to the contents defined in the send user frame designation area in data communications using the nonprocedural protocol.
Performs the receive data clear without stopping the transmission processing in data communications using the nonprocedural protocol.
Registers/cancels programmable controller CPU monitoring in order to use the programmable controller
CPU monitoring functions.
Sets the unit (word/byte) of data quantity to be sent and received.
Registers a user frame.
Reads a user frame.
Changes the mode, transmission specifications, and host station No. of C24.
*1 To change the following setting values of the buffer memory used by the dedicated instructions, use Engineering tool or execute the
CSET instruction (initial setting) before starting data communication. ( MELSEC iQ-R Programming Manual (Module Dedicated
Instructions))
'Word/byte units designation' (Un\G150/310)
'Buffer memory start address designation' (Un\G160/321)
'Send buffer memory start address designation' (Un\G162/322)
'Send buffer memory length designation' (Un\G163/323)
'Receiving buffer memory start address designation' (Un\G166/326)
'Receive buffer memory length designation' (Un\G167/327)
The dedicated instructions are executed base on the setting values of the buffer memory at the module startup or those which were changed by the CSET instruction (initial setting).
Precautions
Do not change data (control data, request data, etc.) designated by a dedicated instruction until the execution of that instruction is completed.
580
APPX
Appendix 4 Dedicated Instructions
Appendix 5
Operation Image and Data Structure of
Predefined Protocol
Operation image of each communication type of protocol
In the predefined protocol function, communication with target devices is performed through the communication type "Send only", "Receive only", or "Send & receive". This section explains the respective operation images.
When communication type is "Send Only"
The specified packet is transmitted once.
Transmitted data
Data Command Station No. Header C24 Terminator
Target device
The operation image of "Send only" is as follows.
■
Normal completion
CPU module
Execute dedicated instruction
(G(P).CPRTCL)
Completion device
Status display device at completion
OFF at normal completion
C24 Send packet
Target device Send packet
■
Error completion (transmission monitoring timeout error)
Example of setting
Standby time: 0, Number of send retries: 0, Monitoring time: other than 0
Error occurred
CPU module
Execute dedicated instruction
(G(P).CPRTCL)
Completion device
Status display device at completion
ON at error completion t: Transmission waiting time
C24
Cannot send a packet
Target device
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
581
When communication type is "Receive Only"
When data are received from the target device, the process completes when the received data matches the receive packet and the receiving process is performed.
C24
Predefined receive packet
Receiving process
Verification match
Receive data 1
Header
Station
No. 1
Receive data 2
Up to 16 receive packet can be specified
Target device
The operation image of "Receive only" is as follows.
■
Normal completion
Store verification-matched receive packet number
(1 to 16)
CPU module
Execute dedicated instruction
(G(P).CPRTCL)
Completion device
Status display device at completion
C24
Target device
(Receive buffer clear)
* Only if it is specified
Receive packet
Verification match
Receive packet
582
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
■
Error completion (receive wait timeout error)
CPU module
Execute dedicated instruction
(G(P).CPRTCL)
Completion device
Status display device at completion
C24
(Receive buffer clear)
* Only if it is specified t: Reception waiting time
Error occurred
ON at error completion
Verification mismatch
Receive packet Receive packet
Target device
• When variables are included in receive packet elements, variable parts are not verified.
• When more than one receive packet is specified, received data is verified with the receive packet information of the first registered packet in the order of registration. The receive processing is performed once received data match one of the receive packet number, and further verification is not performed.
• The receive packet number which is matched as the result of the verification is stored in the control data of the dedicated instruction (CPRTCL instruction).
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
583
When communication type is "Send & Receive"
A packet is sent once, and the status changes to the data receive wait stat after the transmission completes normally. Then, data is received from the target device, and the process completes when the received data matches the receive packet and the receiving process is performed.
C24
Terminator
Transmitted data
Data Command Station Header
Receive data 1
Predefined receive packet
Target device
Receive data 2
Up to 16 receive packet can be specified
Verification match
Verification match
The operation image of "Send & receive" is as follows.
■
Normal completion
Store verification-matched receive packet number
(1 to 16)
CPU module
Execute dedicated instruction
(G(P).CPRTCL)
Completion device
Status display device at completion
OFF at normal completion
C24
Target device
(Receive buffer clear)
* Only if it is specified
Send packet
Start waiting for receive data
Receive packet
Send packet
Verification match
Receive packet
584
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
■
Error completion (receive wait timeout error)
CPU module
Execute dedicated instruction
(G(P).CPRTCL)
Completion device
Status display device at completion
C24
(Receive buffer clear)
* Only if it is specified
Send packet
Target device t: Reception waiting time
Send packet
Verification mismatch
Receive packet Receive packet
Error occurred
ON at abnormal completion
• When variables are included in receive packet elements, variable parts are not verified.
• When more than one receive packet is specified, received data is verified with the receive packet information of the first registered packet in the order of registration. The receive processing is performed once received data match one of the receive packet number, and further verification is not performed.
• The receive packet number which is matched as the result of the verification is stored in the control data of the dedicated instruction (CPRTCL instruction).
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
585
Verification operation of receive packet
The following shows C24 operation when data that are different from the specified receive packet are received.
Receive data prior to the different data is discarded. Data is compared again from the start of the receive packet, and once the data matches the receive packet, the data receiving operation is processed.
Specified receive packet
STX ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ ‘6’ ETX
Same Same Same Same Different
Receive data STX ‘1’ ‘2’ ‘3’ STX ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ ‘6’ ETX
Discarded
Specified receive packet
STX ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ ‘6’ ETX
Same Same Same Same Same Same Same Same
Receive data STX ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ ‘6’ ETX →Verification match
586
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Data examples of packet elements
This section explains the processing procedures and practical data examples of elements that can be placed in a packet.
Length
■
Processing procedure
C24 processes length according to the following procedure.
C24
(Data flow)
Forward direction (upper byte lower → byte)
Reverse direction (lower byte upper → byte)
(Code type)
HEX
(Data length)
(Calculating range)
Data transmission
Data reception
Swapping send data
BIN → ASCII conversion of length value Byte swap
(by word)
*Only when the data length specification is 4 bytes
(Code type) (Data flow)
Forward direction (upper byte lower → byte)
Reverse direction (lower byte upper → byte)
HEX
ASCII hexadecimal
ASCII decimal
Calculated length value
(Data length)
(Calculating range)
Swapping receive data
Byte swap
(by word)
*Only when the data length specification is 4 bytes
ASCII hexadecimal
ASCII decimal
BIN → ASCII conversion of length value
Received length value
■
Data example
The following is an example in the case where the calculated value of length is 258 bytes in decimal (258 is 102H in hexadecimal).
• Data flow is "Forward direction"
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte
'2' (32H)
'8' (38H)
02H
2 bytes
'02' (30H 32H)
'58' (35H 38H)
0102H
3 bytes
'102' (31H 30H 32H)
'258' (32H 35H 38H)
000102H
4 bytes
'0102' (30H 31H 30H 32H)
'0258' (30H 32H 35H 38H)
00000102H
*1 Values in '( )' indicate ASCII code.
• Data flow is "Reverse direction"
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
'20' (32H 30H)
'85' (38H 35H)
0201H
3 bytes
'201' (32H 30H 31H)
'852' (38H 35H 32H)
020100H
4 bytes
'2010'(32H 30H 31H 30H)
'8520' (38H 35H 32H 30H)
02010000H
*1 Values in '( )' indicate ASCII code.
• Data flow is "Byte swap"
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte 2 bytes
3 bytes
4 bytes
'1020' (31H 30H 32H 30H)
'2085' (32H 30H 38H 35H)
00000201H
*1 Values in '( )' indicate ASCII code.
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
587
A
■
Calculating range
The following shows specification examples of the calculating range of Length.
Packet element 1
Packet element 2
Packet element 3
Packet element n-2
Packet element n-1
Packet element n
Packet format
Header Length Static data Variable Terminator
Example 1
Example 2
Example 3
Calculating range when specifying 1 to n
Calculating range when specifying 3 to (n-2)
Calculating range when specifying 3 to n
Example 1: Calculating range when 1 and n are specified as the start and the end respectively.
Example 2: Calculating range when 3 and n-2 are specified as the start and the end respectively.
Example 3: Calculating range when 3 and n are specified as the start and the end respectively.
Check code
588
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Non-conversion variable
■
Processing procedure
C24 processes non-conversion variable according to the following procedure.
C24
(Byte swap) (Fixed length/Variable length)
(Data length/Maximum data length)
(Unit of stored data)
When "Byte swap" is ’Disable’
Unit of stored data
Lower byte + Upper byte
Data storage area
D0
D1
'B'
(42h)
'D'
(44h)
'A'
(41h)
'C'
(43h)
D0
D1
D2
Lower bytes only
00h
00h
00h
D3 00h
'A'
(41h)
'B'
(42h)
'C'
(43h)
'D'
(44h)
Data transmission
“ABCD”
“ABCD”
Disable byte swap
Swapping send data
Enable byte swap
CPU device
G device
Send data
C24 ignores data of upper bytes
“ABCD”←“BADC”
When "Byte swap" is ’Enable’
Unit of stored data
Lower byte + Upper byte
Data storage area
D0
D1
'A'
(41h)
'C'
(43h)
'B'
(42h)
'D'
(44h)
D0
D1
D2
Lower bytes only
00h
00h
00h
D3 00h
'B'
(42h)
'A'
(41h)
'D'
(44h)
'C'
(43h)
C24 ignores data of upper bytes
(Byte swap)
Data reception
“ABCD”
“ABCD"
Disable byte swap
Swapping receive data
Enable byte swap
“ABCD”→“BADC”
(Fixed length/Variable length)
(Data length/Maximum data length)
(Unit of stored data)
When "Byte swap" is ’Disable’
Unit of stored data
Lower byte + Upper byte Lower bytes only
Data storage area
D0
D1
'B'
(42h)
'D'
(44h)
'A'
(41h)
'C'
(43h)
D0
D1
D2
D3
00h
00h
00h
00h
'A'
(41h)
'B'
(42h)
'C'
(43h)
'D'
(44h)
CPU device
G device
Receive data
C24 stores 00h to upper bytes
Unit of stored data
When "Byte swap" is ’Enable’
Lower byte + Upper byte Lower bytes only
Data storage area
D0
D1
'A'
(41h)
'C'
(43h)
'B'
(42h)
'D'
(44h)
D0
D1
D2
D3
00h
00h
00h
00h
'B'
(42h)
'A'
(41h)
'D'
(44h)
'C'
(43h)
C24 stores 00h to upper bytes
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
589
■
Data example
• The following table shows data to be stored in the data storage area when the string of send data is 'ABCD'.
(Reference: A=41H, B=42H, C=43H, and D=44H in ASCII code)
Item
Fixed length/Variable length
Data length
Start address of data storage area
Unit of stored data
Byte swap
Data to be stored in data storage area
Description
Fixed length
4 bytes
D0
Lower byte + Upper byte
Disable
D0=4241H
D1=4443H
Enable
D0=4142H
D1=4344H
Lower bytes only
Disable
D0=0041H
D1=0042H
D2=0043H
D3=0044H
Enable
D0=0042H
D1=0041H
D2=0044H
D3=0043H
• The following table shows data to be stored in the data storage area when the string of send data is 'EFG'.
(Reference: E=45H, F=46H, and G=47H in ASCII code)
Item
Fixed length/Variable length
Data length
Start address of data storage area
Unit of stored data
Byte swap
Data to be stored in data storage area
Description
Fixed length
3 bytes
D0
Lower byte + Upper byte
Disable
D0=4645H
D1=0047H
Enable
D0=4546H
D1=4700H
Lower bytes only
Disable
D0=0045H
D1=0046H
D2=0047H
D3= (any data)
Enable
D0=0046H
D1=0045H
D2=0047H
D3= (any data)
590
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Conversion variable
■
Processing procedure
C24 processes conversion variable according to the following procedure.
• When "Conversion" is 'HEX ASCII hexadecimal' or 'ASCII hexadecimal HEX'
C24
Data transmission
“00001234,”
(Delimiter)
No delimiter
(Number of digits)
(Blank-padded character)
Digits are filled
Variable number of digits
(Conversion)
Adding a delimiter Comma, space
When "Delimiter" is ’ , ’
“00001234,”←“00001234”
Adding blank-padded characters
Digits are not filled (Blank-padded character : 0)
Digits are not filled (Blank-padded character : space)
When "Number of digits" is ’8’ and "Blank-padded character" is ’0’
“00001234”←“1234”
BIN → ASCII conversion of transmitted data
“1234”←1234H
(Number of data/Maximum number of data)
(Fixed number of data/
Variable number of data)
(Conversion unit)
CPU device
G device
Transmitted data
(numeric data)
When "Conversion unit" is ’Word’
D0
1234H
Data reception
“00001234,”
(Delimiter)
No delimiter
(Number of digits)
(Blank-padded character)
No blank-padded character
Variable number of digits
(Conversion)
Deleting a delimiter
Comma, space
When "Delimiter" is ’ , ’
Blank-padded characters are included
“00001234,”→“00001234”
Deleting blank-padded characters
When "Number of digits" is
’8’ and "Blank-padded character" is ’0’
“00001234”→“1234”
ASCII → BIN conversion of received data
“1234”→1234H
(Number of data/Maximum number of data)
(Fixed number of data/
Variable number of data)
(Conversion unit)
CPU device
G device
Received data
(numeric data )
When "Conversion unit" is ’Word’
D0
1234H
Blank-padded characters
When transmitting data, upper digits are filled with the data specified in "Blank-padded character" when the number of digits is less than that specified in "Number of Send Digits of Data".
When receiving data, either '0' or '_(space)' is processed as a blank-padded character regardless of the specification in
"Blank-padded character".
Ex.
Setting of "Number of Send Digits of Data" is '6' ('_' indicates a space character in the table)
Received data
000120
_ _ 0120
0 _ 0120
_ _ _ 120
00012 _
_ _ _ 12 _
0001 _ 0
Operation of C24
Considers the first 3 digits as blank-padded characters.
Considers the first 3 digits as blank-padded characters.
Considers the first 3 digits as blank-padded characters.
Considers the first 3 digits as blank-padded characters.
Considers it to be an ASCII BIN conversion error (7F20H).
Considers it to be an ASCII BIN conversion error (7F20H).
Considers it to be an ASCII BIN conversion error (7F20H).
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
591
• When "Conversion" is "HEX ASCII Decimal" or "ASCII Decimal HEX"
C24
Data transmission
“-_ _12.34,”
(Delimiter)
No delimiter
Adding a delimiter
When "Delimiter" is ’ , ’
Comma, space
“-_ _12.34, ”←“-_ _12.34”
(Number of digits)
(Blank-padded character)
Digits are filled
Variable number of digits
(Number of decimals)
No decimal point
(Sign)
(Sign character)
(Conversion)
Bin → ASCII conversion of send data
(Fixed number of data/
Variable number of data)
(Conversion unit)
ASCII decimal(Unsigned)
CPU device
G device
Adding blank-padded is ’6’ characters
When "Number of digits"
Digits are not filled
(Blank-padded character : 0)
Digits are not filled and "Blank-padded character" is ’Space’
(Blank-padded character : space)
"-_ _12.34" ← "-12.34"
Adding a decimal point 1 to 10
Variable point
When "Number of decimals" is ’2’
“-12.34”←“-1234”
* "_" indicates a blank.
BIN→ ASCII conversion of send data
Adding a sign character
“-1234”← -1234
(Number of data/Maximum number of data)
Send data
ASCII decimal (numeric data)
(Signed)
When "Conversion unit" is ’Word’, and "Sign" is "Signed*"
D0
-1234
(FB2EH)
*Signed: When setting other than "Unsigned"
Data reception
“-_ _12.34,”
(Delimiter) (Number of digits)
(Blank-padded character)
(Number of decimals) (Sign)
(Sign character)
(Conversion)
(Fixed number of data/
Variable number of data)
(Conversion unit)
No delimiter
No blank-padded character
Variable number of digits
No decimal point
ASCII decimal
(Unsigned) ASCII → BIN conversion of received data
CPU device
G device
Comma, space
Deleting a delimiter
When "Delimiter" is ’ , ’
“-_ _12.34, ”→“-_ _12.34”
Deleting blank-padded
Blank-padded characters are included characters
1 to 10
Variable
When "Number of digits" is ’6’ point and "Blank-padded character" is ’Space’
Deleting a decimal point
When "Number of decimals" is ’2’
“-_ _12.34”→“-12.34” “-12.34”→“-1234”
Deleting a sign character
ASCII decimal
(Signed)
ASCII → BIN conversion of received data
*Signed: When setting other than "Unsigned"
“-1234”→-1234
Received data
(numeric data)
When "Conversion unit" is ’Word’, and "Sign" is "Signed*"
D0
-1234
(FB2EH)
* "_" indicates a blank.
(Number of data/Maximum number of data)
592
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
■
Data example
The following table shows send data when a packet consists of [Header], [Conversion variable], [Terminator] and data stored in the data storage area is D0=837 (0345H), D1=18 (0012H). (Reference: 120345H =1180485 in decimal form)
• Data example 1
Item Setting contents
Fixed number of data/Variable number of data
Fixed number of data
Number of Send Data 1
Start address of data storage area D0
Conversion unit
Conversion
Number of Send Digits of Data
Blank-padded character
Word
HEX
5
0
ASCII decimal
Sign
Sign character
Number of decimals
Delimiter
Unsigned
(Not applicable)
No decimal point
No delimiter
[Header]00837[Terminator]
Fixed number of data
1
D0
Word
HEX ASCII decimal
5
Space
Signed
+
2
Comma
[Header]+_ _ 8.37, [Terminator]
Fixed number of data
1
D0
Word
HEX ASCII decimal
Variable number of digits
(Not applicable)
Signed
+
No decimal point
Comma
[Header]+837, [Terminator]
*1 The "_" indicates a space.
• Data example 2
Item Setting contents
Fixed number of data/Variable number of data
Number of Send Data
Fixed number of data
1
Start address of data storage area D0
Conversion unit
Conversion
Double word
HEX ASCII decimal
Number of Send Digits of Data 10
Blank-padded character
Sign
Sign character
Number of decimals
Delimiter
0
Signed
+
8
No delimiter
[Header]+00.01180485[Terminator]
Fixed number of data
2
D0
Word
HEX ASCII decimal
5
Space
Unsigned
(Not applicable)
No decimal point
No delimiter
[Header]_ _ 837 _ _ _18[Terminator]
Fixed number of data
2
D0
Word
HEX ASCII decimal
5
+
2
0
Signed
Comma
[Header]+008.37, +000.18[Terminator]
*1 '_' indicates a blank.
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
593
Check code
■
Processing procedure
C24 processes check code according to the following procedure.
1.
Calculates value according to the selection of "Processing method".
2.
When "Complement calculation" is 'One's complement' or 'Two's complement', performs a 2-word-wise complement operation on the value calculated in the above 1.
3.
When "Code type" is 'ASCII decimal', extracts the lowest one word from the value calculated in the above 2, and performs the hexadecimal to decimal conversion.
C24
(Data flow)
Forward direction (upper byte → lower byte)
Reverse direction (lower byte → upper byte)
(Code type)
HEX
(Processing method)
(Data length)
(Calculating range)
(Complement calculation)
Data transmission
Data reception
Byte swap (by word)
*Only when the data length specification is 4 bytes
Swapping send data
(Data flow)
Swapping receive data
Byte swap (by word)
*Only when the data length specification is
4 bytes
Forward direction (upper byte → lower byte)
Reverse direction (lower byte → upper byte)
ASCII hexadecimal
ASCII decimal
HEX
BIN → ASCII conversion of length value ASCII hexadecimal
ASCII decimal
(Code type)
ASCII → BIN conversion of length value
Calculated length value
(Processing method)
(Data length)
(Calculating range)
(Complement calculation)
Calculated check code
Checking
Received check code
■
Calculation procedure for horizontal parity
The following show procedures for calculating horizontal parities using the following sample data.
STX “R” “J” “7” “1” “C” “2” “4” ETX
Horizontal parity
Calculating range
For the packet shown above
“R”
“J”
(52
H
)
(4A
H
)
0101 0010
XOR
0100 1010 =
“7” (37
H
)
“1” (31
H
)
“C” (43
H
)
“2” (32
H
)
“4” (34
H
)
ETX (03
H
)
0001 1000
XOR
0011 0111 = 0010 1111
XOR
0011 0001 = 0001 1110
XOR
0100 0011 = 0101 1101
XOR
0011 0010 = 0110 1111
XOR
0011 0100 = 0101 1011
XOR
0000 0011 = 0101 1000 (Binary)
Horizontal parity = 58 (Hexadecimal)
594
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Data flow: Forward direction
• "No Complement Calculation" is designated (58H in hexadecimal is 88 in decimal)
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte
"8" (38H)
"8" (38H)
58H
2 bytes
"58" (35H 38H)
"88" (38H 38H)
0058H
3 bytes
"058"(30H 35H 38H)
"088" (30H 38H 38H)
000058H
4 bytes
"0058" (30H 30H 35H 38H)
"0088" (30H 30H 38H 38H)
00000058H
*1 Values in '( )' indicate ASCII code.
• "One's complement" is designated (One's complement for 0000 0058H is FFFF FFA7H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FFA7H in hexadecimal is 65447 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
"7"(37H)
"7" (37H)
A7H
2 bytes
"A7" (41H 37H)
"47" (34H 37H)
FFA7H
3 bytes
"FA7" (46H 41H 37H)
"447" (34H 34H 37H)
FFFFA7H
4 bytes
"FFA7" (46H 46H 41H 37H)
"5447" (35H 34H 34H 37H)
FFFFFFA7H
*1 Values in '( )' indicate ASCII code.
• "Two's complement" is designated (Two's complement for 0000 0058H is FFFF FFA8H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FFA8H in hexadecimal is 65448 in decimal.)
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte
"8" (38H)
"8" (38H)
A8H
2 bytes
"A8" (41H 38H)
"48" (34H 38H)
FFA8H
3 bytes
"FA8" (46H 41H 38H)
"448" (34H 38H 38H)
FFFFA8H
4 bytes
"FFA8" (46H 46H 41H 38H)
"5448" (35H 34H 34H 38H)
FFFFFFA8H
*1 Values in '( )' indicate ASCII code.
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
595
Data flow: Reverse direction
• "No Complement Calculation" is designated (58H in hexadecimal is 88 in decimal)
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte 2 bytes
"85" (38H 35H)
"88" (38H 38H)
5800H
3 bytes
"850" (38H 35H 30H)
"880" (38H 38H 30H)
580000H
4 bytes
"8500" (38H 35H 30H 30H)
"8800" (38H 38H 30H 30H)
58000000H
*1 Values in '( )' indicate ASCII code.
• "One's complement" is designated (One's complement for 0000 0058H is FFFF FFA7H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FFA7H in hexadecimal is 65447 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
"7A" (37H 41H)
"74" (37H 34H)
A7FFH
3 bytes
"7AF" (37H 41H 46H)
"744" (37H 34H 34H)
A7FFFFH
4 bytes
"7AFF" (37H 41H 46H 46H)
"7445" (37H 34H 34H 35H)
A7FFFFFFH
*1 Values in '( )' indicate ASCII code.
• "Two's complement" is designated (Two's complement for 0000 0058H is FFFF FFA8H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FFA8H in hexadecimal is 65448 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
"8A" (38H 41H)
"84" (38H 34H)
A8FFH
3 bytes
"8AF" (38H 44H 46H)
"844" (38H 34H 34H)
A8FFFFH
4 bytes
"8AFF" (38H 41H 46H 46H)
"8445" (38H 34H 34H 35H)
A8FFFFFFH
*1 Values in '( )' indicate ASCII code.
596
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Data Flow: Byte swap
• "No Complement Calculation" is designated (58H in hexadecimal is 88 in decimal)
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte 2 bytes
3 bytes
4 bytes
"0085" (30H 30H 38H 35H)
"0088" (30H 30H 38H 38H)
00005800H
*1 Values in '( )' indicate ASCII code.
• "One's complement" is designated (One's complement for 0000 0058H is FFFF FFA7H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FFA7H in hexadecimal is 65447 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
3 bytes
4 bytes
"FF7A" (46H 46H 37H 41H)
"4574" (34H 35H 37H 34H)
FFFFA7FFH
*1 Values in '( )' indicate ASCII code.
• "Two's complement" is designated (Two's complement for 0000 0058H is FFFF FFA8H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FFA8H in hexadecimal is 65448 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
3 bytes
4 bytes
"FF8A" (46H 46H 38H 41H)
"4584" (34H 35H 38H 34H)
FFFFA8FFH
*1 Values in '( )' indicate ASCII code.
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
597
■
Calculation procedure for sum check
The following show procedures for calculating sum check codes using the following sample data.
STX “R” “J” “7” “1” “C” “2” “4” ETX
Sum check
Calculating range
For the data shown above
Sum check value=52H+4AH+37H+31H+43H+32H+34H+03H=1B0H
Data flow: Forward direction
• "No Complement Calculation" is designated (1B0H in hexadecimal is 432 in decimal)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
"0" (30H)
"2" (32H)
B0H
2 bytes
"B0" (42H 30H)
"32" (33H 32H)
01B0H
3 bytes
"1B0" (31H 42H 30H)
"432" (34H 33H 32H)
0001B0H
4 bytes
"01B0" (30H 31H 42H 30H)
"0432" (30H 34H 33H 32H)
000001B0H
*1 Values in '( )' indicate ASCII code.
• "One's complement" is designated (One's complement for 0000 01B0H is FFFF FE4FH)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FE4FH in hexadecimal is 65103 in decimal.)
Code type Data length
1 byte 2 bytes 3 bytes 4 bytes
ASCII hexadecimal
ASCII decimal
HEX
"F" (46H)
"3" (33H)
4FH
"4F" (34H 46H)
"03" (30H 33H)
FE4FH
"E4F" (45H 34H 46H)
"103" (31H 30H 33H)
FFFE4FH
"FE4F" (46H 45H 34H 46H)
"5103" (35H 31H 30H 33H)
FFFFFE4FH
*1 Values in '( )' indicate ASCII code.
• "Two's complement" is designated (Two's complement for 0000 01B0H is FFFF FE50H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FE50H in hexadecimal is 65104 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
"0" (30H)
"4" (34H)
50H
2 bytes
"50" (35H 30H)
"04" (30H 34H)
FE50H
3 bytes
"E50" (45H 35H 30H)
"104" (31H 30H 34H)
FFFE50H
4 bytes
"FE50" (46H 45H 35H 30H)
"5104" (35H 31H 30H 34H)
FFFFFE50H
*1 Values in '( )' indicate ASCII code.
598
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Data flow: Reverse direction
• "No Complement Calculation" is designated (1B0H in hexadecimal is 432 in decimal)
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte 2 bytes
"0B" (30H 42H)
"23" (32H 33H)
B001H
3 bytes
"0B1" (30H 42H 31H)
"234" (32H 33H 34H)
B00100H
4 bytes
"0B10" (30H 42H 31H 30H)
"2340" (32H 33H 34H 30H)
B0010000H
*1 Values in '( )' indicate ASCII code.
• "One's complement" is designated (One's complement for 0000 01B0H is FFFF FE4FH)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FE4FH in hexadecimal is 65103 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
"F4" (46H 34H)
"30" (33H 30H)
4FFEH
3 bytes
"F4E" (46H 34H 45H)
"301" (33H 30H 31H)
4FFEFFH
4 bytes
"F4EF" (46H 34H 45H 46H)
"3015" (33H 30H 31H 35H)
4FFEFFFFH
*1 Values in '( )' indicate ASCII code.
• "Two's complement" is designated (Two's complement for 0000 01B0H is FFFF FE50H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FE50H in hexadecimal is 65104 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
"05" (30H 35H)
"40" (34H 30H)
50FEH
3 bytes
"05E" (30H 35H 45H)
"401" (34H 30H 31H)
50FEFFH
4 bytes
"05EF" (30H 35H 45H 46H)
"4015" (34H 30H34H 35H)
50FEFFFFH
*1 Values in '( )' indicate ASCII code.
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
599
Data Flow: Byte Swap
• "No Complement Calculation" is designated (1B0H in hexadecimal is 432 in decimal)
Code type
ASCII hexadecimal
ASCII decimal
HEX
Data length
1 byte 2 bytes
3 bytes
4 bytes
"100B" (31H 30H 30H 42H)
"4023" (34H 30H 32H 33H)
0000B001H
*1 Values in '( )' indicate ASCII code.
• "One's complement" is designated (One's complement for 0000 01B0H is FFFF FE4FH)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FE4FH in hexadecimal is 65103 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
3 bytes
4 bytes
"EFF4" (45H 46H 46H 34H)
"1530" (31H 35H 33H 30H)
FFFF4FFEH
*1 Values in '( )' indicate ASCII code.
• "Two's complement" is designated (Two's complement for 0000 01B0H is FFFF FE50H)
When "Code type" is "ASCII decimal", the lower one word is extracted and converted from hexadecimal to decimal. (FE50H in hexadecimal is 65104 in decimal.)
Code type Data length
ASCII hexadecimal
ASCII decimal
HEX
1 byte
2 bytes
3 bytes
4 bytes
"EF05" (45H 46H 30H 35H)
"1540" (31H 35H 34H 30H)
FFFF50FEH
*1 Values in '( )' indicate ASCII code.
■
Calculation procedure for 16-bit CRC (for MODBUS)
This is an error check method to be used when data are transmitted/received with the RTU mode of the MODBUS protocol.
The data length of CRC is fixed to 2 bytes (16 bits), and the CRC is calculated every 1 byte (8 bits) from the start of the calculating range according to the following procedure.
1.
Load a 16-bit register whose bits are all '1'.
2.
Exclusive OR (XOR) the first 1 byte (8 bits) of the calculating range with 8 bits in above 1.
3.
Shift the result of the step 2. for one bit right.
4.
If the least significant bit in above 2. is '1', exclusive OR (XOR) the result of 3. with the generator polynomial (A001H). If the least significant bit is '0', shift the result of step 3. one bit right (operation described in 3.) without the exclusive OR
(XOR) operation.
5.
Repeat steps 3. and 4. for 8 times.
6.
Exclusive OR (XOR) the result of the above 5 with the next 1 byte (8 bits).
7.
Repeat step 3 through 6 until all bytes have been processed. The final result is CRC value.
8.
The CRC value is stored in a packet in the order of lower 8 bits upper 8 bits.
600
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Ex.
The calculation example of 16-bit CRC (for MODBUS)
Packet example:
Station number
02H
Function code
07H
16-bit CRC
41H
Calculation method of 16-bit CRC (for MODBUS) for the above packet example
CRC error checking procedure 16-bit register (MSB)
(Load a 16-bit register whose bits are all '1')
02H (Station number)
Exclusive OR (XOR)
Shift 1
Generator polynomial
Exclusive OR (XOR)
Shift 2
Generator polynomial
Exclusive OR (XOR)
Shift 3
Shift 4
Generator polynomial
Exclusive OR (XOR)
Shift 5
Shift 6
Generator polynomial
Exclusive OR (XOR)
Shift 7
Shift 8
Generator polynomial
Exclusive OR (XOR)
07H (Function code)
Exclusive OR (XOR)
Shift 1
Generator polynomial
Exclusive OR (XOR)
Shift 2
Generator polynomial
Exclusive OR (XOR)
Shift 3
Generator polynomial
Exclusive OR (XOR)
Shift 4
Shift 5
Generator polynomial
Exclusive OR (XOR)
Shift 6
Shift 7
Shift 7
CRC value
0110 1000
1010 0000
1100 1000
0110 0100
0011 0010
1010 0000
1001 0010
0100 1001
0010 0100
0001 0010
12H
0100 0010
0010 0001
1010 0000
1000 0001
-
1000 0001
0100 0000
1010 0000
1110 0000
0111 0000
1010 0000
1101 0000
-
1111 1111
1111 1111
0111 1111
1010 0000
1101 1111
0110 1111
1010 0000
1100 1111
0110 0111
0011 0011
1010 0000
1001 0011
0100 1001
0010 0100
1010 0000
1000 0100
0010 0111
0000 0001
0010 0110
0001 0011
0000 1001
0000 0001
0000 1000
0000 0100
1000 0010
0100 0001
41H
0111 1111
0011 1111
0000 0001
0011 1110
0000 0111
0011 1001
1001 1100
0000 0001
1001 1101
0100 1110
0000 0001
0100 1111
1111 1111
0000 0010
1111 1101
1111 1110
0000 0001
1111 1111
1111 1111
0000 0001
1111 1110
1111 1111
1111 1111
0000 0001
1111 1110
1111 1111
1111 1111
0000 0001
1111 1110
0
1
0
1
1
1
-
1
0
1
1
1
0
1
-
0
0
0
-
Flag
12H
6
7
Calculating procedure
1 to 2
3 to 4
5
8
A
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
601
■
Check code calculation range
The following shows specification examples of the check code calculation code.
Packet element 1
Packet element 2
Packet element n-2
Packet element n-1
Packet element n
Packet format
Example 1
Example 2
Example 3
Header Static data
Non-conversion variable
Calculating range when specifying 1 to (n-1)
Calculating range when specifying 2 to (n-1)
Calculating range when specifying 2 to (n-2)
Terminator Check code
Example 1: Calculating range when 1 and n-1 are specified as the start and the end respectively.
Example 2: Calculating range when 2 and n-1 are specified as the start and the end respectively.
Example 3: Calculating range when 2 and n-2 are specified as the start and the end respectively.
Non-verified reception
The usage example for non-verified reception is shown below.
Example of format of packet from other device
1 byte
STX
2 byte
Identification code
2 byte
Country code
5 byte
Manufacturer code
5 byte
Product code
Data to be read
Variable number of characters
1 byte
ETX
Data needed by the user
When the data are not needed by the user and data contents and/or the number of character vary
Set a Non-verified reception element
Example of packet setting
1 byte
Header
2 byte
Conversion variable
Variable number of characters
Non-verified reception (variable number of characters)
1 byte
Terminator
Using a non-verified reception element has the following advantages in the case of the packet format shown above.
• The only necessary data can be stored in the device memory of a CPU module and buffer memory.
• A single protocol (packet) can handle receive packets that includes data whose contents vary each time.
602
APPX
Appendix 5 Operation Image and Data Structure of Predefined Protocol
Appendix 6
Processing Time
Processing time for nonprocedural protocol (guideline)
The processing time for the Output and Input instructions can be estimated by the following formula.
Note, however, that the processing time may become longer depending on other communication functions (e.g., communication using the MC protocol) and special functions (e.g., ASCII-binary conversion, transmission control) that are used at the same time.
The value obtained from the following formula is considered to be the processing time taken for reception or transmission only when CH1 only is used (RS-232 connection).
■
OUTPUT instruction
Tp=St+(Dle/Cr 1000+0.07) Ds+T1
Tp
: The time from the start of execution of the Output instruction to the End processing of the sequence scan at the completion of the Output instruction execution (ms)
St
Dle
Cr
: Scan time
: Data length of 1 byte at data transmission (number of bits)
: Communication rate (bps)
Ds
T1
: Number of bytes of send data
: C24 T1=2.7
*1 This stands for the time range of processing (Tp).
Start of the Output instruction execution
Start of the END processing of the scan at the completion of the OUTPUT instruction execution
Tp
Step 0 END
Program
Transmission command
OUTPUT instruction
OUTPUT instruction complete device
C24
Target device
OUTPUT
Transmission data
1 scan
A
APPX
Appendix 6 Processing Time
603
■
INPUT instruction
Tp = Sr+0.09 Dr+T2
Tp
: Time from the start of the INPUT instruction execution to the start of End processing for the sequence scan at the completion of the INPUT instruction execution (ms)
Sr
Dr
T2
: Scan time
: Number of bytes of reception data
: C24 T2=6.3
*1 This indicates the range of processing time (Tp).
Start of the INPUT instruction execution
Tp
Start of the END processing of the scan at the completion of the INPUT instruction execution
Step 0 END
Program
(*3)
Reception data read request (X3)
INPUT instruction
INPUT instruction complete device
INPUT
1 scan
C24
Target device Receive data
2ms(*2)
*2 It indicates the time from when C24 receives data from the line to when the 'CH1 reception data read request' (X3) turns ON when only read processing of 30 bytes data is performed with one of the channels on C24 used.
*3 When DX3 (direct mode) is used, C24 is accessed at the time of the instruction execution with the program.
DX3 (direct mode) speeds up reading input compared to X3 (refresh mode).
For differences between the modes, refer to the following manual.
MELSEC iQ-R CPU Module User's Manual (Application)
604
APPX
Appendix 6 Processing Time
Appendix 7
When Connecting the Module to a
Remote Head Module
This section describes the restrictions and communication example for when connecting the C24 to a remote head module.
Restrictions
This section describes the restricted functions and specifications of when connecting the C24 to a remote head module.
When creating a program
• Dedicated instructions cannot be used.
• Data cannot be received with an interrupt program.
Communication using the MC protocol
The command that can be used differs from that of the CPU module. For the command that can be used in the remote head module, refer to the following.
MELSEC Communication Protocol Reference Manual
Communication using the MODBUS slave function
For the restrictions on communications using the MODBUS slave function, refer to the following section.
Page 115 Specifying an access target
A
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
605
Communication example
This section describes the communication example for when connecting the C24 to a remote head module.
System configuration example
(1) (2) (3) (4)
(3)
(4)
No.
(1)
(2)
Component
R04CPU
RJ71GF11-T2
RJ72GF15-T2
RJ71C24
External device (personal computer)
External device (temperature controller)
Network
CC-Link IE Field Network
CC-Link IE Field Network
Protocol
CH1: Nonprocedural protocol or bidirectional protocol
CH2: Predefined protocol
Nonprocedural protocol or bidirectional protocol
Predefined protocol
606
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
Communication procedure
The following shows the procedure to send/receive data.
■
Data communication using the predefined protocol
Writes send data to the link register (W) of the CPU module to store the send data in the data storage area set in the packet setting of the predefined protocol support function.
Executes the REMTO instruction to write the number of consecutive protocol executions to the buffer memory of the C24.
Executes the REMTO instruction to write the number of a protocol to be executed to the buffer memory of the C24.
Executes the protocol by 'CH2 protocol execution request' (YA).
Checks the protocol execution by 'CH2 protocol execution completion' (XC).
Reads the predefined protocol execution result, result of the execution count, and matched packet number from the buffer memory of the C24 with the REMFR instruction.
Reads the data received from the external device which is transferred from the device of the remote head module to the link register (W) of the CPU module.
RJ71GF11-T2
RY
0000H
RY
RJ72GF15-T2
0000H
Y
RJ71C24 R04CPU
Y
1000H
Õ
1000H
Ö
X
0000H
Ò
W
RX
RWw
0000H
RX
0000H
RWw
0000H
X
0000H
W Un\G
1000H
Ø
RWr
0000H
RWr
1000H
A
100
117
0
1
8
D Ó
REMTO
REMTO
Ô
×
REMFR
Un\G4020H
Un\G4022H
Un\G4024H
Un\G402BH
Un\G4033H
: Link refresh
: Link scan
: link dedicated instruction (REMTO, REMFR)
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
607
■
Data communication using the nonprocedural or bidirectional protocol
• Receiving procedure
Checks data received from the external device by 'CH1 reception data read request' (X3).
Transfers the received data from the buffer memory of the C24 to the device of the remote head module by refresh (remote head module C24).
Reads the received data transferred to the link register (W) of the CPU module by link refresh.
R04CPU
Y
1000H
RJ71GF11-T2
RY
0000H
RY
RJ72GF15-T2
0000H
Y
RJ71C24
1000H
Ò
X
0000H
W
RX
RWw
0000H
RX
0000H
RWw
0000H
X
0000H
W
Un\G
1000H
Ô
RWr
0000H
RWr
1000H
Ó
: Link refresh
: Link scan
: Refresh (Remote head module C24)
• Sending procedure
Writes send data to the link register (W) of the CPU module to write the send data to the buffer memory of the C24.
Issues the transmission request by 'CH1 transmission request' (Y0).
'CH1 transmission normal completion' (X0) turns ON when the execution of the transmission request completes.
RJ71GF11-T2
RY
0000H
RY
RJ72GF15-T2
0000H
Y
RJ71C24 R04CPU
Y
1000H
Ó
1000H
Ô
X
0000H
Ò
W
RX
RWw
0000H
RX
0000H
RWw
0000H
X
0000H
W
Un\G
1000H
RWr
0000H
RWr
1000H
: Link refresh
: Link scan
: Refresh (Remote head module C24)
608
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
Setting in the master station on CC-Link IE Field Network
Connect the engineering tool to the CPU module of the master station on CC-Link IE Field Network and set parameters.
1.
Set the CPU module as follows:
[Project] [New]
2.
Click the [Setting Change] button to set to use module labels.
3.
Set the CC-Link IE Field Network master/local module as follows.
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
A
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
609
4.
Click the [Setting Change] button to set to use module labels.
5.
Set the items in "Required Settings" of "Module Parameter" as follows.
[Navigation window] [Parameter] [Module Information] [RJ71GF11-T2] [Module Parameter] [Required
Settings]
6.
Set the network configuration as follows.
[Navigation window] [Parameter] [Module Information] [RJ71GF11-T2] [Module Parameter] [Basic Settings]
[Network Configuration Settings]
610
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
7.
Set the refresh settings as follows.
[Navigation window] [Parameter] [Module Information] [RJ71GF11-T2] [Module Parameter] [Basic Settings]
[Refresh Setting]
8.
Write the set parameters to the CPU module of the master station on CC-Link IE Field Network. Then, reset the CPU module or power off and on the system.
[Online] [Write to PLC]
In this example, default values are used for parameters that are not shown above. For the parameters, refer to the following.
MELSEC iQ-R CC-Link IE Field Network User's Manual (Application)
A
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
611
Setting in the intelligent device station on CC-Link IE Field Network
Connect the engineering tool to the remote head module of the intelligent device station on CC-Link IE Field Network and set the parameters.
1.
Set the remote head module as follows.
[Project] [New]
2.
Set the items in "Network Required Setting" of "CPU Parameter" as follows.
[Navigation window] [Parameter] [RJ72GF15-T2] [CPU Parameter] [Network Required Setting]
3.
Set the C24 as follows.
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
612
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
4.
Click the [OK] button.
5.
Set parameters of the C24 according to the protocol to be used.
Page 614 Program example of a predefined protocol
Page 619 Program examples of a nonprocedural protocol or bidirectional protocol
A
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
613
Program example of a predefined protocol
The following shows a program example to connect an external device (temperature controller) to the CH2 of a C24, and to execute a predefined protocol.
■
Module parameter setting of a C24
1.
Set the items in "Basic Settings" as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Basic Settings]
2.
Write the set parameters to the remote head module of the intelligent device station on CC-Link IE Field Network. Then, reset the remote head module or power the system off and on.
[Online] [Write to PLC]
In this example, default values are used for parameters that are not shown above. For the parameters, refer to the following.
MELSEC iQ-R CC-Link IE Field Network User's Manual (Application)
■
Predefined protocol support function setting of a C24
1.
Select [Tool] [Predefined Protocol Support Function] from an Engineering tool.
2.
Select "Serial Communication Module" in "Module Type" in the "Predefined Protocol Support Function" screen.
614
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
3.
Select [File] [New] in the "Predefined Protocol Support Function" screen.
4.
Select [Edit] [Add Protocol] in the "Protocol Setting" screen.
5.
Select "Predefined Protocol Library" in "Type" on the "Add Protocol" screen, and select the protocol to be used in
"Protocol to Add".
A
6.
Click the "Variable Unset" cell of "Packet Setting" screen on the "Protocol Setting" screen.
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
615
7.
Click the "Variable unset error" cell on the "Packet Setting" screen
8.
Enter 'W0' to "Send Data Storage Area" on the "Element Setting" screen.
9.
Set the packet settings in the "Variable Unset" cell of "Packet Setting" on the "Protocol Setting" screen with the same procedure (from step 5 to step 8).
Set the following values for the data storage area.
Packet name Element number
NOR/0601H:RD Controller Status
ERR/0601H; RD Controller Status
7
ERR: Command Finished Abnormally 2
9
2
2
8
4
Element name
Communication Unit No.
Operation Status
Related Information
Communication Unit No.
Response Code
Communication Unit No.
End Code
Data storage area specification
Set 'W1000'
Set 'W1001'
Set 'W1002'
Set 'W1000'
Set 'W1003'
Set 'W1000'
Set 'W1004'
10.
Select [Online] [Write to Module] from Engineering tool.
11.
Select "CPU Built-in Memory" in "Target Memory" on the "Write to Module" screen, and click the [Execute] button.
616
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
■
Program example
This program uses the module labels of the CC-Link IE Field Network master/local module. Write the program to the CPU module on the master station.
Category
Module label
Label name
GF11_1.bSts_DataLinkError
GF11_1.bnSts_DataLinkError_Station[1]
Description
Data link error status of own station
Data link status of each station (station
No.1)
Device
SB0049
SW00B0.0
Label to be defined Define the global label as shown below.
A
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
617
(6) Sets send data and writes the number of consecutive protocol executions and the number of a protocol to be executed to the buffer memory of the C24 with the REMTO instruction.
(62) Issues the predefined protocol execution request when the REMTO instruction completes.
(70) Reads the execution result from the buffer memory of the C24 with the REMFR instruction when the execution of the predefined protocol completes.
618
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
Program examples of a nonprocedural protocol or bidirectional protocol
The following shows program examples to connect an external device (personal computer) to the CH1 of a C24, and to send/ receive data by using a nonprocedural protocol or bidirectional protocol with input/output signals.
■
Module parameter setting of a C24
1.
Set the items in "Basic Settings" as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Basic Settings]
For communication using the bidirectional protocol, set the communication protocol setting to "Bidirectional protocol."
2.
Set the items in "refresh settings" of "Module Parameter" as follows.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Refresh setting]
A
3.
Write the set parameters to the remote head module of the intelligent device station on CC-Link IE Field Network. Then, reset the remote head module or power the system off and on.
[Online] [Write to PLC]
In this example, default values are used for parameters that are not shown above. For the parameters, refer to the following.
MELSEC iQ-R CC-Link IE Field Network User's Manual (Application)
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
619
■
Program example for data reception
This program uses the module labels of the CC-Link IE Field Network master/local module. Write the program to the CPU module on the master station.
Category
Module label
Label name
GF11_1.bSts_DataLinkError
GF11_1.bnSts_DataLinkError_Station[1]
Description
Data link error status of own station
Data link status of each station (station
No.1)
Device
SB0049
SW00B0.0
Label to be defined Define the global label as shown below.
620
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
(6) Reads the received data when the C24 receives data normally.
(18) Reads error description (error code) when the C24 detects an error at data reception. (Unnecessary for bidirectional protocols.)
A
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
621
■
Program for data transmission
This program uses the module labels of the CC-Link IE Field Network master/local module. Write the program to the CPU module on the master station.
Category
Module label
Label name
GF11_1.bSts_DataLinkError
GF11_1.bnSts_DataLinkError_Station[1]
Description
Data link error status of own station
Data link status of each station (station
No.1)
Device
SB0049
SW00B0.0
Label to be defined Define the global label as shown below.
622
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
(6) Sets send data and issues a send request.
(32) Performs the processing when the transmission processing completes normally.
(35) Performs the processing when the transmission processing completes abnormally.
APPX
Appendix 7 When Connecting the Module to a Remote Head Module
623
A
Appendix 8
Using MODBUS in a Redundant System
This section explains the restriction and communication examples when using MODBUS in a redundant system.
For the restrictions when using a C24 in a redundant system with a redundant extension base unit, refer to the following section.
Page 661 Using the Module in the Redundant System with Redundant Extension Base Unit
Restrictions
Available modules
Use the following modules in a redundant system.
Model
RnPCPU
R6RFM
RJ71C24
RJ71C24-R2
RJ71C24-R4
Type
Process CPU
Redundant function module
Serial communication module
Firmware version
'24' or later
'01' or later
'13' or later
Available functions
When using a C24 in a redundant system, only the following functions can be used.
• Data communication using the predefined protocol
• Data communication using a MODBUS slave
Communication using a dedicated instruction
If the system is switched during dedicated instruction execution, the instruction may not be completed. Execute it again from the control system CPU module after system switching.
624
APPX
Appendix 8 Using MODBUS in a Redundant System
Redundant master station (single line)
Connect the master station of the control system and that of the standby system with a tracking cable.
If an error occurs in the master station of the control system, the master station of the standby system performs control and continues communications with a slave station.
(1)
(2) (3)
(4)
RS-422/485
(1) Tracking cable
(2) Master station (control system)
(3) Master station (standby system)
(4) MODBUS slave device
System switching
An execution result of the protocols registered for the predefined protocol support function (GP.CPRTCL) is monitored.
When an error occurs, the system switching instruction (SP.CONTSW) is executed in the process CPU (redundant mode) of the control system.
*1
*1 To execute this instruction, 'System switching by a user' (SM1646) must be turned ON (manual switching permitted) in advance.
Cases in which the system can be switched
The system is switched if any of the following errors occurs:
• Cable disconnection
• Communication error
• Power interruption
A
APPX
Appendix 8 Using MODBUS in a Redundant System
625
Redundant master station (redundant line)
Connect the master station of the control system and that of the standby system with a tracking cable.
Set a slave station for each master station.
If an error occurs in the master station of the control system, the master station of the standby system performs control and continues communications with slave stations.
(1)
(3) (2)
RS-232/422/485
(4)
RS-232/422/485
(4)
(4) (4)
(1) Tracking cable
(2) Master station (control system)
(3) Master station (standby system)
(4) MODBUS slave device
Precautions
• The configurations of the control system and the standby system must be the same.
• When using RS-232, only one MODBUS slave device can be connected.
System switching
An execution result of the protocols registered for the predefined protocol support function (GP.CPRTCL) is monitored.
When an error occurs, the system switching instruction (SP.CONTSW) is executed in the process CPU (redundant mode) of the control system.
*1
*1 To execute this instruction, 'System switching by a user' (SM1646) must be turned ON (manual switching permitted) in advance.
Cases in which the system can be switched
The system is switched if any of the following errors occurs:
• Cable disconnection
• Communication error
• Power interruption
626
APPX
Appendix 8 Using MODBUS in a Redundant System
Redundant slave station (redundant line)
Connect the slave station of the control system and that of the standby system with a tracking cable.
Prepare a line to the master station for each of the slave stations of the control system and the standby system.
If an error occurs in the slave station of the control system, the slave station of the standby system performs control and continues communications with the master station.
(1)
RS-232/422/485
(2) (3)
(4)
(1) MODBUS master device
(2) Slave station (control system)
(3) Slave station (standby system)
(4) Tracking cable
System switching
Data for alive check is periodically sent from the master station to determine whether a communication error occurs, and the data is monitored in slave stations.
When an error occurs, the system switching instruction (SP.CONTSW) is executed in the process CPU (redundant mode) of the control system.
*1
The master station determines which slave station is currently operating as the control system by reading the values in
'Control system judgment flag' (SM1634) and 'Standby system judgment flag' (SM1635) of each slave station.
*1 To execute this instruction, 'System switching by a user' (SM1646) must be turned ON (manual switching permitted) in advance.
Cases in which the system can be switched
The system is switched if any of the following errors occurs:
• Cable disconnection
• Communication error
• Power interruption
A
APPX
Appendix 8 Using MODBUS in a Redundant System
627
Communication examples for a redundant master station (single line)
The following shows program examples to continue communications with a slave station by switching the master station of the standby system to the control system if an error occurs in the master station of the control system.
Common sample programs can be used for redundant master stations (both single line and redundant line).
Therefore, a redundant master station (single line) is used for explanation in communication examples shown below.
A program executed in a master station (standby system) is required for a redundant master station (single line). For details on this type of program, refer to the following section.
(
Page 639 Considerations for a redundant master station (single line))
Overview
The following shows the operation overviews of a sample program used for a communication example.
■
Normal operation
(1) (2)
(3)
RS-485
CPU module RJ71C24
Ò
Control system
RJ71C24
Device assignment parameter
MODBUS device
40001
40002
Device memory
D0
D1
Ó
CPU module
Device memory
D0
D1
628
(1) Master station (control system): RJ71C24 (predefined protocol)
(2) Master station (standby system): RJ71C24 (predefined protocol)
(3) Slave station: RJ71C24 (MODBUS slave (RTU))
No.
Description
The master station (control system) sends the following request message to the slave station with the GP.CPRTCL instruction.
• Read holding registers (FC: 03)
(request to read a value in the read holding register 400001)
The slave station returns a value in D0 according to the MODBUS device assignment parameter settings.
The master station (control system) stores received data in W5 according to protocol setting data.
The above operations are repeated every three seconds.
APPX
Appendix 8 Using MODBUS in a Redundant System
■
When an error occurs
(1)
RS-485
(2)
(3)
CPU module
Control system
RJ71C24
Standby system
Ò
Ó
CPU module RJ71C24
Ô
RJ71C24 CPU module
Standby system
Control system
Õ
(1) Master station (control system): RJ71C24 (predefined protocol)
(2) Master station (standby system): RJ71C24 (predefined protocol)
(3) Slave station: RJ71C24 (MODBUS slave (RTU))
No.
Description
The master station (control system) sends a request message to the slave station with the GP.CPRTCL instruction.
If the GP.CPRTCL instruction completes with an error, the master station (control system) switches the system with the SP.CONTSW instruction.
The master station (standby system) that has switched to the new control system sends a request message to the slave station with the GP.CPRTCL instruction in the same way as the master station (control system) that is the old control system.
The slave station sends a response message to the master station (standby system) that has switched to the new control system.
A
APPX
Appendix 8 Using MODBUS in a Redundant System
629
System configuration
(2)
(1)
(3)
(4)
RS-485
(1) Tracking cable
(2) Master station (control system): RJ71C24 (predefined protocol)
(3) Master station (standby system): RJ71C24 (predefined protocol)
(4) Slave station: RJ71C24 (MODBUS slave (RTU))
Type
Master station
Slave station
Model
RnPCPU
R6RFM
RJ71C24
RCPU
RJ71C24
Type
Process CPU
Redundant function module
Serial communication module
CPU module
Serial communication module
Start I/O No.
3E00H
0000H
0020H
3E00H
0000H
Setting for a master station (control system)
The following shows the procedure for connecting to the CPU module on a master station and setting parameters in an engineering tool.
1.
Set the CPU module as follows:
[Project] [New]
2.
Click the [Setting Change] button to set to use module labels.
3.
Click the [OK] button to add module labels of the CPU module.
630
APPX
Appendix 8 Using MODBUS in a Redundant System
4.
Set the R6RFM as follows:
[Navigation window] [Parameter] [System Parameter] [I/O Assignment] tab [I/O Assignment Setting]
5.
Set the RJ71C24 as follows:
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
6.
Click the [OK] button to add module labels of the RJ71C24.
A
APPX
Appendix 8 Using MODBUS in a Redundant System
631
7.
Set the RS-485 (CH2) of the master station as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Basic Settings]
[Various control specification]
Item
Various control specification Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting
MODBUS station number setting
Communication control setting Echo back enable/prohibit specification
8.
Write the set parameters to the CPU module that controls the master station.
[Online] [Write to PLC]
9.
Select [Tool] [Predefined Protocol Support Function] in an engineering tool.
10.
Select "Module Type" "Serial Communication Module."
Description
Predefined protocol
230400 bps
Independent
8
None
1
None
Enable
Disable
0
Echo back prohibit
11.
Select [File] [New].
12.
Select [Edit] [Add Protocol].
632
APPX
Appendix 8 Using MODBUS in a Redundant System
13.
Select "Predefined Protocol Library" for "Type," and select a protocol to be used in "Protocol to Add."
Protocol No.
Manufacturer Model Protocol name
1 Schneider Electric MODBUS 03: RD Holding Registers
14.
Right-click the added protocol, and select [Protocol Detailed Setting] from the shortcut menu.
15.
Set '30' for "Receive Wait Time."
A
APPX
Appendix 8 Using MODBUS in a Redundant System
633
16.
Right-click the added protocol, and select [Device Batch Setting] from the shortcut menu.
17.
Set 'W0' for "Device No."
18.
Write the set protocol setting data to the module.
[Online] [Write to Module]
19.
Reset the CPU module or turn the power OFF and ON.
Precautions
• If '0' is set for "Receive Wait Time," the system is not switched because it continues waiting for a response from a slave station.
• If the CPU module is in the backup mode, protocol setting data cannot be written. Be sure to switch the CPU module to the separate mode before writing.
• Protocol setting data cannot be written to both systems at the same time. Write it to the control system and the standby system individually.
• The target memory in which protocol setting data is written must be the same for the control system and the standby system.
Setting for a master station (standby system)
Set a master station (standby system) with the same procedure as a master station (control system).
Page 630 Setting for a master station (control system)
634
APPX
Appendix 8 Using MODBUS in a Redundant System
Setting for a slave station
The following shows the procedure for connecting to the CPU module on a slave station and setting parameters in an engineering tool.
1.
Set the CPU module as follows:
[Project] [New]
2.
Click the [Setting Change] button to set to use module labels.
3.
Click the [OK] button to add module labels of the CPU module.
4.
Set the RJ71C24 as follows:
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
A
APPX
Appendix 8 Using MODBUS in a Redundant System
635
5.
Click the [OK] button to add module labels of the RJ71C24.
6.
Set the RS-485 (CH2) of the slave station as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Basic Settings]
[Various control specification]
Item
Various control specification Communication protocol setting
Communication speed setting
Transmission setting
Station number setting
MODBUS station number setting
Operation setting
Data bit
Stop bit
Sum check code
Online change
Setting change
Description
MODBUS slave (RTU)
230400 bps
Independent
8
None
1
None
0
1
Enable
Disable
*1 Set the same value as the master station.
7.
Write the set parameters to the CPU module on the slave station.
[Online] [Write to PLC]
8.
Reset the CPU module or turn the power OFF and ON.
Program example for a master station
Category
Module label
Label to be defined
Label name/FB name
C24_1
C24_1.bSts_CommunicationProtocolPreparationCo
mpletion
RCPU.stSM.bAlways_ON
RCPU.stSM.bUser_System_Switching_Availability
Define the global label as shown below.
Description
Target module
Predefined protocol ready
Always ON
System switching by a user
Device
SM400
SM1646
FB M+RJ71C24_ExeCommonProtocol Executes the protocol registered with GX Works3.
*1 Do not specify it as a target for tracking transfer. ( MELSEC iQ-R CPU Module User's Manual (Application))
636
APPX
Appendix 8 Using MODBUS in a Redundant System
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
APPX
Appendix 8 Using MODBUS in a Redundant System
637
A
(0)
(2)
Turns SM1646 ON to execute the SP.CONTSW instruction.
Sets a value to the device assigned in the protocol setting.
• Sets '1' for the request destination slave station number.
• Sets the start holding register number and the number of read points so that MODBUS device (400001) will be read.
Sets a value for the input label of M+RJ71C24_ExeCommonProtocol.
• Sets '2' for the communication channel.
• Sets '1' for the number of consecutive protocol executions.
• Sets '1' for the execution protocol number specification.
Turns M+RJ71C24_ExeCommonProtocol execution request ON.
(18) Executes M+RJ71C24_ExeCommonProtocol.
(74) Turns the SP.CONTSW instruction execution request ON if an error occurs in completion.
(76) Starts the timer for next sending after completion of M+RJ71C24_ExeCommonProtocol.
(80) Measures for three seconds.
(85) Turns the next transmission request execution request ON after three seconds.
(88) Switches the system with the SP.CONTSW instruction if an error occurs in completion.
Program example for a slave station
Create a program for a slave station as necessary.
638
APPX
Appendix 8 Using MODBUS in a Redundant System
Considerations for a redundant master station (single line)
For a redundant master station (single line), a master station (standby system) also receives data sent by a master station
(control system) and a slave station. This causes a buffer full error (7F6AH) in the master station (standby system). If a buffer full error occurs, the buffer area is cleared when the master station (standby system) switches to the new control system; therefore, the new control system operates normally after system switching.
To avoid a buffer full error in a master station (standby system), a functional protocol 'receive data clear (protocol No.201)' of the predefined protocol function must be periodically executed in the master station (standby system).
In addition, add a sample program executed in the master station (standby system) and correct a sample program executed in the master station (control system).
Precautions
• Execute a program in both systems.
For details, refer to the following manual.
( MELSEC iQ-R CPU Module User's Manual (Application))
• Do not specify a device assigned to a module label or global label for a sample program as a target for tracking transfer.
For details on tracking transfer, refer to the following manual.
( MELSEC iQ-R CPU Module User's Manual (Application))
■
Example of a program added for a master station (standby system)
Category
Module label
Label to be defined
Label name
C24_1
C24_1.bSts_CommunicationProtocolPreparationCo
mpletion
RCPU.stSM.bStandby_System_Identification_Flag
Define the global label as shown below.
Description
Target module
Predefined protocol ready
Standby system judgment flag
Device
X3D
SM1635
A
*1 Add and define global labels as shown in the red frame.
APPX
Appendix 8 Using MODBUS in a Redundant System
639
(0) Turns the GP.ECPRTCL instruction execution request ON.
• Sets functional protocol No.201 for control data 'execution protocol number specification (s+2)' of GP.ECPRTCL.
(5) Executes the GP.ECPRTCL instruction.
(24) Starts the timer to clear the next transmitted data after the GP.ECPRTCL instruction is completed.
(29) Turns the next GP.ECPRTCL instruction execution request ON.
*1 The timer value must be less than or equal to the transmission cycle from the control system MODBUS master station.
640
APPX
Appendix 8 Using MODBUS in a Redundant System
■
Example of a program corrected for a master station (control system)
Correct the program shown in the following section.
Page 636 Program example for a master station
• Part to be corrected
Add a close contact (M302) in the red frame.
APPX
Appendix 8 Using MODBUS in a Redundant System
641
A
Communication examples for a redundant slave station
(redundant line)
The following shows program examples to continue communications with the master station by switching a slave station
(standby system) to the control system if an error occurs in a slave station (control system).
Overview
The following shows the operation overviews of a sample program used for a communication example.
■
Normal operation
(1)
(2)
RS-232 RS-232
(3)
CPU module
Control system
Device memory
RJ71C24
Device assignment parameter
MODBUS device
020481
Device memory
SM0
RJ71C24
-R2
CPU module
RJ71C24
-R2
RJ71C24
CPU module
Standby system
SM1634
SM1635
Ò , Ô Ò
D0
022115
022116
400001
SM1634
SM1635
D0
D12287
412288 D12287
Ó
Ó
,
Õ
(1) Master station 1 and master station 2: RJ71C24-R2 (predefined protocol)
(2) Slave station (control system): RJ71C24 (MODBUS slave (RTU))
(3) Slave station (standby system): RJ71C24 (MODBUS slave (RTU))
No.
Description
The master station sends the following request messages to the slave stations (control system and standby system) with the GP.CPRTCL instruction.
• Reading two points from the coil 022115 with 'Read coils (FC:01)' (reading SM1634 and SM1635 used to determine the control system)
• Writing a value for alive check to the holding register 412288 with 'Write multiple registers (FC:16)'
Each of the slave stations (control system and standby system) processes the request from the master station according to the MODBUS assignment parameter and sends a response message.
The master station determines the value acquired with 'Read coils' and sends a request message used for actual control to the slave station (control system).
The slave station (control system) processes the request from the master station according to the MODBUS assignment parameter, and sends a response message.
The above operations are repeated every three seconds.
642
APPX
Appendix 8 Using MODBUS in a Redundant System
■
When an error occurs
(1)
(2)
RS-232
(3)
CPU module
Control system
RJ71C24
Standby system
Ô
RJ71C24
-R2
CPU module RJ71C24
-R2
Ò Ò , Õ
RJ71C24 CPU module
Standby system
Control system
Ó , Ö
(1) Master station 1 and master station 2: RJ71C24-R2 (predefined protocol)
(2) Slave station (control system): RJ71C24 (MODBUS slave (RTU))
(3) Slave station (standby system): RJ71C24 (MODBUS slave (RTU))
No.
Description
The master station sends a request message to each of the slave stations (control system and standby system) with the GP.CPRTCL instruction.
The slave station (control system) cannot receive the request message, and only the slave station (standby system) sends a response message (data for alive check).
The slave station (control system) switches the system with the SP.CONTSW instruction because data for alive check was not updated after 10 seconds.
The master station determines the value acquired with 'Read coils' and sends a request message used for actual control to the slave station (standby system) that has switched to the new control system.
The slave station (standby system) that has switched to the new control system processes the request from the master station according to the
MODBUS assignment parameter, and sends a response message.
A
APPX
Appendix 8 Using MODBUS in a Redundant System
643
System configuration
(1)
(2)
RS-232 RS-232
(3)
(1) Master station 1 and master station 2: RJ71C24-R2 (predefined protocol)
(2) Slave station (control system): RJ71C24 (MODBUS slave (RTU))
(3) Slave station (standby system): RJ71C24 (MODBUS slave (RTU))
(4) Tracking cable
(4)
Type
Master station
Slave station
Model
RCPU
RnPCPU
R6RFM
RJ71C24
Type
CPU module
Serial communication module
Process CPU
Redundant function module
Serial communication module
*1 Master station 1
*2 Master station 2
Start I/O No.
3E00H
0000H
0020H
3E00H
0000H
0020H
Setting for a master station
The following shows the procedure for connecting to the CPU module on a master station and setting parameters in an engineering tool.
1.
Set the CPU module as follows:
[Project] [New]
2.
Click the [Setting Change] button to set to use module labels.
644
APPX
Appendix 8 Using MODBUS in a Redundant System
3.
Click the [OK] button to add module labels of the CPU module.
4.
Set the RJ71C24-R2 (master station 1) as follows:
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
5.
Click the [OK] button to add module labels of the RJ71C24-R2 (master station 1).
Set the RJ71C24-R2 (master station 2) with the same procedure.
A
APPX
Appendix 8 Using MODBUS in a Redundant System
645
6.
Set the RS-232 (CH1) of master station 1 and master station 2 as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24-R2] [Module Parameter] [Basic Settings]
[Various control specification]
Item
Various control specification Communication protocol setting
Communication speed setting
Transmission setting Operation setting
Data bit
Parity bit
Odd/even parity
Stop bit
Sum check code
Online change
Setting change
Station number setting
MODBUS station number setting
Transmission control setting Transmission control
DC1/DC3 control
DC2/DC4 control
7.
Write the set parameters to the CPU module that controls the master stations.
[Online] [Write to PLC]
8.
Select [Tool] [Predefined Protocol Support Function] in an engineering tool.
9.
Select "Module Type" "Serial Communication Module."
Description
Predefined protocol
230400 bps
Independent
8
None
1
None
Enable
Disable
0
DC code control
Control disabled
Control disabled
10.
Select [File] [New].
11.
Select [Edit] [Add Protocol].
646
APPX
Appendix 8 Using MODBUS in a Redundant System
12.
Select "Predefined Protocol Library" for "Type," and select a protocol to be used in "Protocol to Add."
Protocol No.
Manufacturer Model Protocol name Purpose
1 Schneider Electric MODBUS 01: RD Coils Determination of the control system
Alive check 2 16: WR Multi Register
3 03: RD Holding Registers
13.
Right-click the added protocol, and select [Protocol Detailed Setting] from the shortcut menu.
Request data for control
14.
Set '10' for "Receive Wait Time."
Set the same item for protocol number 1 to 3.
A
APPX
Appendix 8 Using MODBUS in a Redundant System
647
15.
Select any cell of the added protocols in "Packet Setting."
Assign the following CPU devices to each protocol.
Protocol
No.
Protocol name Packet name Element name
1
2
3
01: RD Coils
16: WR Multi Register
03: RD Holding
Registers
01: RD Coils
NOR/01: RD Coils
ERR/01: RD Coils
16: WR Multi Register
NOR/16: WR Multi Register
Slave Address
Starting Address
Quantity of Coils
Slave Address
Coil Status
Slave Address
Exception Code
Slave Address
Starting Address
Quantity of Registers
Registers Value
Slave Address
Starting Address
Quantity of Registers
Slave Address ERR/16: WR Multi Register
03: RD Holding Registers
Exception Code
Slave Address
Starting Address
Quantity of Registers
NOR/03: RD Holding Registers Slave Address
Register Value
ERR/03: RD Holding Registers Slave Address
Exception Code
16.
Write the set protocol setting data to the module.
[Online] [Write to Module]
17.
Reset the CPU module or turn the power OFF and ON.
Device designation
Master station 1
[W0 - W0]
[W1 - W1]
[W2 - W2]
[W3 - W3]
[W4], [W5 - W81]
[W82 - W82]
[W83 - W83]
[W84 - W84]
[W85 - W85]
[W86 - W86]
[W87], [W88 - W104]
[W105 - W105]
[W106 - W106]
[W107 - W107]
[W108 - W108]
[W109 - W109]
[W10A - W10A]
[W10B - W10B]
[W10C - W10C]
[W10D - W10D]
[W10E], [W10F - W18B]
[W18C - W18C]
[W18D - W18D]
Master station 2
[W200 - W200]
[W201 - W201]
[W202 - W202]
[W203 - W203]
[W204], [W205 - W281]
[W282 - W282]
[W283 - W283]
[W284 - W284]
[W285 - W285]
[W286 - W286]
[W287], [W288 - W304]
[W305 - W305]
[W306 - W306]
[W307 - W307]
[W308 - W308]
[W309 - W309]
648
APPX
Appendix 8 Using MODBUS in a Redundant System
Setting for a slave station (control system)
The following shows the procedure for connecting to the CPU module on a slave station and setting parameters in an engineering tool.
1.
Set the CPU module as follows:
[Project] [New]
2.
Click the [Setting Change] button to set to use module labels.
3.
Click the [OK] button to add module labels of the CPU module.
4.
Set the R6RFM as follows:
[Navigation window] [Parameter] [System Parameter] [I/O Assignment] tab [I/O Assignment Setting]
A
APPX
Appendix 8 Using MODBUS in a Redundant System
649
5.
Set the RJ71C24 as follows:
[Navigation window] [Parameter] [Module Information] right-click [Add New Module]
6.
Click the [OK] button to add module labels of the RJ71C24.
7.
Set the RS-232 (CH1) of each of the slave stations (control system and standby system) as follows:
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter] [Basic Settings]
[Various control specification]
Item
Various control specification Communication protocol setting
Communication speed setting
Transmission setting
Station number setting
MODBUS station number setting
Operation setting
Data bit
Stop bit
Sum check code
Online change
Setting change
Description
MODBUS slave station (RTU)
230400 bps
Independent
8
None
0
1
1
None
Enable
Disable
*1 Set the same value as the master station.
8.
Write the set parameters to the CPU module on the slave station.
[Online] [Write to PLC]
9.
Reset the CPU module or turn the power OFF and ON.
650
APPX
Appendix 8 Using MODBUS in a Redundant System
Setting for a slave station (standby system)
Set a slave station (standby system) with the same procedure as a slave station (control system).
Page 649 Setting for a slave station (control system)
APPX
Appendix 8 Using MODBUS in a Redundant System
651
A
Program examples for master stations
Create a sample program for a master station so that it behaves in the following order:
• Program for master station 1 program for master station 2 program for communication to a slave station of the control system
■
Master station 1
The following shows a program to control an RJ71C24-R2 the start I/O number of which is 0H.
The control system can be determined and data for alive check can be updated.
Category
Module label
Label to be defined
Label name/FB name
C24_1
C24_1.bSts_UnitReady
C24_1.bSts_CommunicationProtocolPreparationCo
mpletion
RCPU.stSM.bAfter_RUN1_Scan_ON
Define the global label as shown below.
Description
Target module
Module READY
Predefined protocol ready
ON for one scan after RUN
Device
X1E
X1D
SM402
FB M+RJ71C24_ExeCommonProtocol Executes the protocol registered with GX Works3.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
652
APPX
Appendix 8 Using MODBUS in a Redundant System
APPX
Appendix 8 Using MODBUS in a Redundant System
653
A
(0)
(3)
Sets an initial value for data for alive check.
Waits for a slave station to start (500 ms).
(9) Reads special relays (SM1634 and SM1635), sends data for alive check, and performs communication with a slave station every three seconds.
(15) Reads special relays (SM1634 and SM1635) and turns a send execution trigger for data for alive check ON.
(18) Sets predefined protocol data to read special relays (SM1634 and SM1635).
• Sets '1' for the request destination slave station number.
• Sets the start coil number and the number of read points so that MODBUS devices (022115 and 022116) will be read.
(29) Sets predefined protocol data to send data for alive check.
• Sets '1' for the request destination slave station number.
• Sets the start register number, the number of write points, and the write size so that MODBUS device (412288) will be written.
• Sets data for alive check as writing data.
(41) Sets a value for the input label of M+RJ71C24_ExeCommonProtocol.
• Sets '2' for the number of consecutive protocol executions.
• Sets '1' and '2' for the execution protocol number specification.
(52) Executes M+RJ71C24_ExeCommonProtocol.
(111) Updates data for alive check after completion of M+RJ71C24_ExeCommonProtocol.
• Performs communication with a slave station if the control system is connected. (
Page 658 Communication to a slave station of the control system)
654
APPX
Appendix 8 Using MODBUS in a Redundant System
■
Master station 2
The following shows a program to control an RJ71C24-R2 the start I/O number of which is 20H.
The control system can be determined and data for alive check can be updated.
Category
Module label
Label to be defined
Label name/FB name
C24_2
C24_2.bSts_UnitReady
C24_2.bSts_CommunicationProtocolPreparationCo
mpletion
RCPU.stSM.bAfter_RUN1_Scan_ON
Define the global label as shown below.
Description
Target module
Module READY
Predefined protocol ready
ON for one scan after RUN
Device
X3E
X3D
SM402
FB M+RJ71C24_ExeCommonProtocol Executes the protocol registered with GX Works3.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
A
APPX
Appendix 8 Using MODBUS in a Redundant System
655
656
APPX
Appendix 8 Using MODBUS in a Redundant System
(0) Sets an initial value for data for alive check.
(3)
(9)
Waits for a slave station to start (500 ms).
Reads special relays (SM1634 and SM1635), sends data for alive check, and performs communication with a slave station every three seconds.
(15) Reads special relays (SM1634 and SM1635) and turns a send execution trigger for data for alive check ON.
(18) Sets predefined protocol data to read special relays (SM1634 and SM1635).
• Sets '1' for the request destination slave station number.
• Sets the coil number and the number of read points so that MODBUS devices (022115 and 022116) will be read.
(29) Sets predefined protocol data to send data for alive check.
• Sets '1' for the request destination slave station number.
• Sets the start register number, the number of write points, and the write size so that MODBUS device (412288) will be written.
• Sets data for alive check as writing data.
(41) Sets a value for the input label of M+RJ71C24_ExeCommonProtocol.
• Sets '2' for the number of consecutive protocol executions.
• Sets '1' and '2' for the execution protocol number specification.
(52) Executes M+RJ71C24_ExeCommonProtocol.
(111) Updates data for alive check after completion of M+RJ71C24_ExeCommonProtocol.
• Performs communication with a slave station if the control system is connected. (
Page 658 Communication to a slave station of the control system)
A
APPX
Appendix 8 Using MODBUS in a Redundant System
657
■
Communication to a slave station of the control system
Communication is performed in a master station connected to a slave station of the control system.
Category
Module label
Label to be defined
Label name/FB name
C24_1
C24_2
Define the global label as shown below.
Description
Target module
Device
FB M+RJ71C24_ExeCommonProtocol Executes the protocol registered with GX Works3.
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
658
APPX
Appendix 8 Using MODBUS in a Redundant System
(0) Sets protocol data for communication to a slave station.
• Sets '1' for the request destination slave station number.
• Sets the start register number and the number of read points so that MODBUS device (400001) will be read.
Sets a value for the input label of M+RJ71C24_ExeCommonProtocol.
• Sets '1' for the number of consecutive protocol executions.
• Sets '3' for the execution protocol number specification.
(16) Performs communication in master station 1.
(79) Performs communication in master station 2.
(142) Performs processing after communication is completed.
A
APPX
Appendix 8 Using MODBUS in a Redundant System
659
Program example for a slave station
The control system can be determined and data for alive check can be updated.
Category
Module label
Label to be defined
Label name
RCPU.stSM.bAlways_ON
RCPU.stSM.bUser_System_Switching_Availability
RCPU.stSM.bControl_System_Identification_Flag
RCPU.stSM.bStandby_System_Identification_Flag
RCPU.stSM.bAfter_System_Switching_One_SCAN_ON_Standby
_System_To_Control_System
Define the global label as shown below.
Description
Always ON
System switching by a user
Control system judgment flag
Standby system judgment flag
ON for one scan after system switching
(Standby system to control system)
Device
SM400
SM1646
SM1634
SM1635
SM1643
(1)
(2)
(7)
Turns SM1646 ON to execute the SP.CONTSW instruction.
Turns M0 ON to enable system switching after receiving the first data for alive check from the master station.
Monitors whether data for alive check can be received from the master station (for 10 seconds).
(24) Switches the system if no data can be received for 10 seconds.
(33) Resets the monitoring timer if the system is switched by a cause other than a MODBUS communication error.
660
APPX
Appendix 8 Using MODBUS in a Redundant System
Appendix 9
Using the Module in the Redundant
System with Redundant Extension Base
Unit
This section explains examples when using a C24 in a redundant system with a redundant extension base unit.
Restrictions
The following shows the restricted functions and specifications of when using a C24 in a redundant system with a redundant extension base unit.
Available modules
Use the following modules in a redundant system.
Model
RJ71C24
RJ71C24-R2
RJ71C24-R4
Type
Serial communication module
Firmware version
'14' or later
Restricted functions
The following functions have some restrictions applied when using a C24 in a redundant system with a redundant extension base unit.
The other functions can be used without restrictions.
Function
Data communication using the MC protocol
MELSOFT connection
Restriction
When executing a command that manages files, specify the I/
O number other than those of the control system (03D0H) and standby system (03D1H).
Specifying a connection destination has some restrictions.
When specifying "Not specified", the operation is performed in the same way as when specifying "Control System".
Operations involving file writing (such as 'Write to PLC') cannot be performed.
To perform operations involving file writing, connect an engineering tool via a module on the main base unit.
Reference
MELSEC Communication Protocol Reference Manual
GX Works3 Operating Manual
■
Considerations
• If the system is switched during the MELSOFT connection, MC protocol communications, or communications using dedicated instructions from other stations, a communication timeout may occur.
• If the system is switched during the simple CPU communications, a CPU response monitoring timer error (7A02H) may occur. Try again as necessary.
• If the system is switched during communications using MODBUS, a CPU response monitoring timer timeout (7380H) may occur. Try again as necessary.
Dedicated instructions
Dedicated instructions cannot be used.
Mount a serial communication module on the main base unit to use dedicated instructions.
A
For alternative dedicated instructions in the program using I/O signals, refer to the following section.
Page 662 Alternative program examples of dedicated instructions
Module FBs
Module FBs cannot be used.
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
661
Module parameter
• The module extended parameter and predefined protocol setting must be written to the C24, not to the CPU module.
• Data reception with an interrupt program cannot be used. Do not set the item in [Module Parameter] [Interrupt Settings].
Alternative program examples of dedicated instructions
The following shows the programs using I/O signals to alternate dedicated instructions.
Availability of alternatives using I/O signals
Dedicated instructions which can be replaced with the program using I/O signals are as follows:
: Available, : Not available, : Available with restriction
Dedicated instruction
ONDEMAND Sending data using the on-demand function
CPRTCL
OUTPUT
INPUT
BIDOUT
BIDIN
SPBUSY
BUFRCVS
PRR
CSET
PUTE
GETE
UINI
Executing the protocols registered for the predefined protocol support function
Sending data using the nonprocedural protocol
Receiving data using the nonprocedural protocol
Sending data using the bidirectional protocol
Receiving data using the bidirectional protocol
Reading the data send/receive status
Receiving data using an interrupt program
Sending data using user frames
Clearing receive data
Registering/canceling the programmable controller CPU monitoring
Initial setting
Registering user frames
Reading user frames
Switching the mode
Processing
Sends data using the on-demand function of MC protocol.
Executes the protocol registered using the engineering tool.
Sends data in user-specified message format through communications using the nonprocedural protocol.
Receives data in user-specified message format through communications using the nonprocedural protocol.
Sends the specified amount of data through communications using the bidirectional protocol.
Receives data through communications using the bidirectional protocol.
Reads the status of data sent/received by using the serial communication instruction.
Receives data using an interrupt program through communications under control of the nonprocedural protocol or bidirectional protocol.
Sends data with user frames according to the specification in the user frame specification area for sending, through communication with the nonprocedural protocol.
Clears receive data using the nonprocedural protocol.
Alternative Reference
Page 665 Alternative program example of the
Page 668 Alternative program example of the
Page 670 Alternative program example of the
Page 672 Alternative program example of the
Page 674 Alternative program example of the
Page 674 Alternative program example of the
Page 675 Alternative program example of the
Page 678 Alternative program example of the
CSET instruction (receive data clear)
Registers or cancels programmable controller CPU monitoring to use the programmable controller CPU monitoring function.
Sets the send/receive data quantity unit (word/byte) and data send/receive area.
Registers user frames.
Reads user frames.
Switches the serial communication module mode, transmission specifications, and self-station number.
Page 680 Alternative program example of the
CSET instruction (initial setting)
Page 682 Alternative program example of the
Page 684 Alternative program example of the
Page 685 Alternative program example of the
*1 Transmission processing must be stopped when clearing receive data.
*2 Station number or operating status (independent/linked) cannot be changed.
662
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
System configuration example
(1)
(4)
(5)
(3)
(2)
(6)
(1) Control system
(2) Standby system
(3) Tracking cable
(4) Extension cable
(5) RJ71C24 (start I/O number: 0100H)
(6) External device
Connect the master station of the control system and that of the standby system to a redundant extension base unit with extension cables.
Parameter settings of C24 mounted on a redundant extension base unit
The following shows the parameter settings required to be set in an engineering tool.
In this example, default values are used for parameters that are not shown below.
Change the module parameter according to the specifications of the target device.
1.
Select "R08P" for "Type" and "Redundant" for "Mode" to set the CPU module.
[Project] [New]
A
2.
Select the model name of a base unit in the system parameter.
[Navigation window] [Parameter] [System Parameter] [Base/Power/Extension Cable Setting]
Item
Base/Power/Extension Cable Setting Main
Extension 1
Description
Base Type
Main Base Unit
Extension Base Unit
Base Module Name
R35B
R68WRB
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
663
3.
Set the I/O assignment setting as follows:
[Navigation window] [Parameter] [System Parameter] [I/O Assignment Setting]
Item Description
Module Name
I/O Assignment Setting Main R08PCPU (Host Station)
R6RFM
Extension 1
4.
Click the [OK] button to add module labels of the RJ71C24.
RJ71C24
Start XY
3E00
0000
0100
"Signal Flow Memory Tracking Setting" must be set to "Transfer" (default) in [CPU Parameter] [Redundant
System Settings] [Tracking Setting] [Signal Flow Memory Tracking Setting] due to some instructions used in a program, such as PLS instruction.
664
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
Alternative program example of the ONDEMAND instruction
The following shows the program example to send data using the on-demand function of MC protocol.
■
Overview
An operation overview of sample program is as follows.
The data "12345678" is sent by using the following user frames.
User frame
Start frame (1st)
Start frame (2nd)
Final frame (1st)
User frame No.
02H(2)
3EBH(1003)
401H(1025)
Registered code
02H
F9H, 00H, 00H, FFH, FFH, 00H
03H, FFH, F1H
Registered data content
Data code from STX to self-station number matched to QnA compatible 3C frame, format 3
Data code of ETX, sum check code equivalent to QnA compatible 3C frame, format 3
The send data is as follows:
First frame (1st)
First frame (2nd)
User frame
Last frame (1st)
Send data
User frame
02H F9H 00H
S
T
X
F 9 0 0
00H FFH,FFH 00H
0 0 F F 0 0 1 2 3 4 5 6 7 8
Sum check
Code
H L
02H 46H 39H 30H 30H 30H 30H 46H 46H 30H 30H 31H 32H 33H 34H 35H 36H 37H 38H 03H 44H 32H
User frame registration code
Send data corresponding to registration code
Send data code
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Application settings
User frame specification
Communication protocol setting
Communication speed setting
On demand user frame specification
Start frame No. designation (1st)
Final frame No. designation (1st)
Start frame No. designation (2nd)
Final frame No. designation (2nd)
Description
MC protocol (any of "Format 1" to "Format 4")
Select other than "Automatically set" according to the communication destination.
2H(2)
401H(1025)
3EBH(1003)
0 (No specification)
3.
Set the module extended parameters.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Extended Parameter]
Item
User frame contents User frame Registration frame No.1003
Registration frame No.1025
Description
F90000FFFF00
03FFF1
(Control code: "ETX", Special code: "FFF1")
4.
Write the set parameters to the module.
[Online] [Write to PLC]
• When writing module extended parameters, an engineering tool must be connected to the control system.
• Specify "Intelligent Function Module" as the writing destination of module extended parameters.
5.
Reset the CPU module or turn the power OFF and ON.
A
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
665
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.stnCH1.bSts_TransmissionNormalCompletion
C24_1.stnCH1.bSts_TransmissionAbnormalEnd
C24_1.stnCH1.bSts_TransmissionProcessing
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_Transmission
C24_1.bSet_Req_ErrorInitialization
Define the global label as shown below.
Description
Start I/O No.
CH1 Transmission normal completion
CH1 Transmission abnormal completion
CH1 Transmission processing
Module READY
Watchdog timer error
CH1 Transmission request
Error initialization request
Device
X100
X101
X102
X11E
X11F
Y100
Y10E
666
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
(0) Executes the program when 'bSendInstruction' turns ON.
(3) Writes send data to the C24 buffer memory C00H (user setting area).
Writes the buffer memory address C00H and 2 (send data quantity) to the C24 buffer memory A0H (for designation of on-demand function).
(23) Turns 'CH1 Transmission request' ON.
(34) Turns 'bSuccess' ON when 'CH1 Transmission normal completion' turns ON.
Turns 'bFail' ON and reads the C24 buffer memory 256H (CH1 on-demand execution result) when 'CH1 Transmission abnormal completion' turns ON.
(46) Turns 'CH1 Transmission request' OFF.
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
667
A
Alternative program example of the CPRTCL instruction
The following shows the program example to execute the protocol registered in an engineering tool.
■
Overview
An operation overview of sample program is as follows.
A request message of the command 0401 is sent by using the MC protocol (4C frame, format 4) and data from the target device D100 is read.
The read data is stored in D6.
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Communication protocol setting
Communication speed setting
Description
Predefined protocol
Select other than "Automatically set" according to the communication destination.
3.
Write the set parameters to the module.
[Online] [Write to PLC]
4.
Start the predefined protocol support function from the [Tool] menu of engineering tool.
[Tool] [Predefined Protocol Support Function]
5.
Select a target module of the protocol setting data.
6.
Create new protocol setting data.
[File] [New]
7.
Add the following protocol in the protocol setting screen of predefined protocol support function.
Protocol No.
1
Manufacturer
MITSUBISHI ELECTRIC
Model
MC Protocol 4C Frame (Format 4)
Protocol Name
0401:Batch RD
8.
Right-click the added protocol, and select "Device Batch Setting".
9.
Enter 'D0' in "Device No." in the "Device Batch Setting" screen.
10.
Write the created protocol setting data to C24.
[Online] [Write to Module]
Specify "Intelligent Function Module" for "Target Memory".
If the CPU module is in the backup mode, protocol setting data cannot be written. Be sure to switch the CPU module to the separate mode before writing.
11.
Reset the CPU module or turn the power OFF and ON.
668
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.bSts_CommunicationProtocolPreparationCompletion
C24_1.stnCH1.bProtocolExecutionCompletion
C24_1.stnCH1.bSet_Req_ProtocolExecution
Define the global label as shown below.
Description
Start I/O No.
Predefined protocol ready
CH1 Protocol execution completion
CH1 protocol execution request
Device
X11D
X105
Y103
(0)
(6)
Executes the program when 'bStartInstruction' turns ON.
Sets the device code, start device number, and number of device points to be read.
Writes '1' to the C24 buffer memory 4000H (CH1 number of consecutive protocol executions).
Writes '1' to the C24 buffer memory 4004H (CH1 protocol number).
Turns 'CH1 Protocol execution request' ON.
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
669
A
(30) Reads the C24 buffer memory 4002H (CH1 data transmission result) when 'Protocol execution completion' turns ON.
Turns 'CH1 Protocol execution request' OFF.
Alternative program example of the OUTPUT instruction
The following shows the program to send data in user-specified message format through communications using the nonprocedural protocol.
■
Overview
An operation overview of sample program is as follows.
The data stored in D11 or later is sent by using the nonprocedural protocol.
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Communication protocol setting
Communication speed setting
Description
Nonprocedural protocol
Select other than "Automatically set" according to the communication destination.
3.
Write the set parameters to the module.
[Online] [Write to PLC]
4.
Reset the CPU module or turn the power OFF and ON.
670
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.stnCH1.bSts_TransmissionNormalCompletion
C24_1.stnCH1.bSts_TransmissionAbnormalEnd
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_Transmission
C24_1.bSet_Req_ErrorInitialization
Define the global label as shown below.
Description
Start I/O No.
CH1 Transmission normal completion
CH1 Transmission abnormal completion
Module READY
Watchdog timer error
CH1 Transmission request
Error initialization request
Device
X100
X101
X11E
X11F
Y100
Y10E
(0) Sets the send data, end code, and send data quantity.
Writes the above items to the C24 buffer memory 400H (send/receive area).
Turns 'CH1 Transmission request' ON.
(27) Turns 'CH1 Transmission request' OFF when 'CH1 Transmission normal completion' turns ON.
(29) Reads the C24 buffer memory 257H (CH1 data transmission result) when 'CH1 Transmission abnormal completion' turns ON.
Turns 'CH1 Transmission request' OFF.
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
671
A
Alternative program example of the INPUT instruction
The following shows the program example to receive data in user-specified message format through communications using the nonprocedural protocol.
■
Overview
An operation overview of sample program is as follows.
The data received from a target device is stored in D1 or later by using the nonprocedural protocol.
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Communication protocol setting
Communication speed setting
Description
Nonprocedural protocol
Select other than "Automatically set" according to the communication destination.
3.
Write the set parameters to the module.
[Online] [Write to PLC]
4.
Reset the CPU module or turn the power OFF and ON.
672
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_ReceptionReadCompletion
Define the global label as shown below.
Description
Start I/O No.
CH1 Reception data read request
CH1 Reception abnormal detection
Watchdog timer error
CH1 Reception data read completion
Device
X103
X104
X11F
Y101
(0) Reads the C24 buffer memory 600H (CH1 receive data quantity) and 601H (CH1 receive data) when data is received.
(14) Reads the C24 buffer memory 258H (CH1 data reception result) when abnormal reception is detected.
(22) Turns 'CH1 Reception data read completion' ON when data is received or abnormal reception is detected.
A
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
673
Alternative program example of the BIDOUT instruction
The following shows the program example to send data for the designated data count using the bidirectional protocol.
■
Overview
An operation overview of sample program is as follows.
The data stored in D11 or later is sent by using the bidirectional protocol.
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Communication protocol setting
Communication speed setting
Description
Bidirectional protocol
Select other than "Automatically set" according to the communication destination.
3.
Write the set parameters to the module.
[Online] [Write to PLC]
4.
Reset the CPU module or turn the power OFF and ON.
■
Program example
Alternative program example of the BIDIN instruction
The following shows the program example to receive data using the bidirectional protocol.
■
Overview
An operation overview of sample program is as follows.
The data received from a target device is stored in D1 or later by using the bidirectional protocol.
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Communication protocol setting
Communication speed setting
Description
Bidirectional protocol
Select other than "Automatically set" according to the communication destination.
3.
Write the set parameters to the module.
[Online] [Write to PLC]
4.
Reset the CPU module or turn the power OFF and ON.
674
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_ReceptionReadCompletion
C24_1.bSet_Req_ErrorInitialization
Define the global label as shown below.
Description
Start I/O No.
CH1 Reception data read request
Watchdog timer error
CH1 Reception data read completion
Error initialization request
Device
X103
X11F
Y101
Y10E
(0) Reads the C24 buffer memory 600H (CH1 receive data quantity), 601H (CH1 receive data), and 258H (CH1 data reception result) when data is received.
Turns 'CH1 Reception data read completion' ON.
Alternative program example of the PRR instruction
The following shows the program example to send data with a user frame using the nonprocedural protocol (according to the contents defined in the send user frame designation area).
■
Overview
An operation overview of sample program is as follows.
Data is sent by using the following user frames.
User frame
Send frame No. designation (1st)
User frame No.
3F2H(1010)
Registered code
02H, 51H, 0AH, FFH, 01H, 3BH
Send frame No. designation (2nd)
Send frame No. designation (3rd)
Send frame No. designation (4th)
Send frame No. designation (5th)
3F3H(1011)
8001H(32769)
8000H(32768)
41BH(1051)
54H, 4FH, 54H, 41H, 4CH, 3BH
2DH, 01H
34H, 12H, ABH, 56H
03H, FFH, F0H
Registered data content
[STX], "Q", Station No. of target device, Selfstation No., ";"
"TOTAL;"
Arbitrary data (021DH)
Arbitrary data in send area (1234H, 56ABH)
Data code of [ETX], sum check code
The send data is as follows:
A
S
T
X
Q ; T O T A L ;
(Total number)
Data in transmission area
(arbitrary data portion)
E
T
X
02H 51H 0AH
(012DH)
01H 3BH 54H 4FH 54H 41H 4CH 3BH 2DH 01H
(1234H)
34H 12H
(56ABH)
ABH 56H 03H 37H
Register No. of corresponding user frame
3F2H
(for first designated frame)
3F3H
(for second designated frame)
8001H
(for third designated frame)
8000H
(for fourth designated frame)
41BH
(for third designated frame)
* Four bytes of data in the transmission area are transmitted as is.
(Byte units in the left diagram.)
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
675
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Application settings
User frame specification
Description
Communication protocol setting
Communication speed setting
Transmission setting
Send user frame designation
Data bit
Nonprocedural protocol
Select other than "Automatically set" according to the communication destination.
8
Output start pointer designation 1
Output quantity designation 5
3F2H(1010) Send frame No. designation
(1st)
Send frame No. designation
(2nd)
3F3H(1011)
Send frame No. designation
(3rd)
Send frame No. designation
(4th)
Send frame No. designation
(5th)
8001H(32769)
8000H(32768)
41BH(1051)
3.
Set the module extended parameters.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Extended Parameter]
Item
User frame contents User frame Registration frame No.1010
Registration frame No.1011
Registration frame No.1051
Description
02510AFF013B
544F54414C3B
03FFF0
(Control code: "ETX", Special code: "FFF0")
4.
Write the set parameters to the module.
[Online] [Write to PLC]
• When writing module extended parameters, an engineering tool must be connected to the control system.
• Specify "Intelligent Function Module" as the writing destination of module extended parameters.
5.
Reset the CPU module or turn the power OFF and ON.
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.stnCH1.bSts_TransmissionNormalCompletion
C24_1.stnCH1.bSts_TransmissionAbnormalEnd
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.stnCH1.bSet_Req_Transmission
Define the global label as shown below.
Description
Start I/O No.
CH1 Transmission normal completion
CH1 Transmission abnormal completion
Module READY
Watchdog timer error
CH1 Transmission request
Device
X100
X101
X11E
X11F
Y100
676
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
(0)
(3)
Executes the program when 'bSendInstruction' turns ON.
Writes send data to the C24 buffer memory 400H (send/receive area).
Writes the user frame No.8001H to the C24 buffer memory 1B00H (for user registration).
Turns 'CH1 Transmission request' ON.
(30) Turns 'CH1 Transmission request' OFF when 'Transmission normal completion' turns ON.
(32) Reads the C24 buffer memory 257H (data transmission result) when 'Transmission abnormal completion' turns ON.
Turns 'CH1 Transmission request' OFF.
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
677
A
Alternative program example of the CSET instruction (receive data clear)
The following shows the program example to clear receive data using the nonprocedural protocol.
■
Overview
An operation overview of sample program is as follows.
Receive data is cleared for the OS area of the C24 by using the nonprocedural protocol.
• Do not execute a clear request of receive data during data transmission. Otherwise, the data transmission is canceled.
• Resume data communication with a target device after the receive data clear processing with C24 is completed.
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the following items for CH1 in the module parameter.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Parameter]
Item
Basic settings Various control specification
Communication protocol setting
Communication speed setting
Description
Nonprocedural protocol
Select other than "Automatically set" according to the communication destination.
3.
Write the set parameters to the module.
[Online] [Write to PLC]
4.
Reset the CPU module or turn the power OFF and ON.
678
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.stnCH1.bSet_Req_ReceptionRead
C24_1.stnCH1.bSts_ReceptionAbnormalDetection
Define the global label as shown below.
Description
Start I/O No.
CH1 Reception data read request
CH1 Reception abnormal detection
Device
X103
X104
(0) Executes the program when 'X50' turns ON.
(5) Writes '1' (requested) to the C24 buffer memory 0A8H (receive data clear request) when 'data clear request acknowledgement flag' turns ON.
(19) Reads the C24 buffer memory 0A8H (receive data clear status) when 'data clear request completion flag' turns ON.
Turns 'data clear request completion flag' OFF when the receive data clear status is '0' (not requested).
(32) When 'data clear request acknowledgement flag' and 'data clear request completion flag' are turned OFF, data communication becomes available.
A
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
679
Alternative program example of the CSET instruction (initial setting)
The following shows the program example to set the send/receive data quantity unit (word/byte) and data send/receive area.
■
Overview
An operation overview of sample program is as follows.
The following items for CH1 are set.
Item
Send/receive data quantity unit (word/byte)
On-demand function buffer memory start address
On-demand function buffer memory size
Sending area start address for nonprocedural/bidirectional protocols
Nonprocedural/bidirectional protocols sending area size
Nonprocedural/bidirectional protocols receiving area start address
Nonprocedural/bidirectional protocols receiving area size
Description
Word unit
400H
10H
C00H
100H
D00H
300H
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Write the set parameters to the module.
[Online] [Write to PLC]
3.
Reset the CPU module or turn the power OFF and ON.
680
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
■
Program example
Category
Module label
Label to be defined
Label name
C24_1.uIO
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
Define the global label as shown below.
Description
Start I/O No.
Module READY
Watchdog timer error
Device
X11E
X11F
(0)
(8)
Writes '1' (word unit) to the C24 buffer memory 96H (CH1 word/byte units designation).
Writes 400H to the C24 buffer memory A0H (CH1 on-demand function buffer memory start address designation) and 10H to A1H (CH1 on-demand function data length designation).
(22) Writes C00H to the C24 buffer memory A2H (CH1 send buffer memory start address designation) and 100H to A3H (CH1 send buffer memory length designation).
(36) Writes D00H to the C24 buffer memory A6H (CH1 receiving buffer memory start address designation) and 300H to A7H (CH1 receive buffer memory length designation).
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
681
A
Alternative program example of the PUTE instruction
The following shows the program example to register a user frame.
■
Overview
An operation overview of sample program is as follows.
F9H, 00H, 00H, FFH, FFH, and 00H are registered in the user frame No.3EBH (1003).
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Write the set parameters to the module.
[Online] [Write to PLC]
3.
Reset the CPU module or turn the power OFF and ON.
■
Program example
Category Label name
Module label
Label to be defined
C24_1.uIO
C24_1.bSts_WriteNormalCompletion_UserFlame_Flash
C24_1.bSet_Req_Write_UserFlame_Flash
Define the global label as shown below.
Description
Start I/O No.
User frame write completion to flash ROM
User frame write request to flash ROM
Device
X118
Y118
682
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
(0)
(4)
Executes the program when 'X50' turns ON.
Writes to the C24 buffer memory 2H (register/read/delete instructions), 3H (frame No. direction), 5H (number of registered data bytes), and 6H (user frame).
(28) Turns 'User frame write request to flash ROM' ON.
Reads the C24 buffer memory 4H (register/read/delete results) and turns 'User frame write request to flash ROM' OFF at the completion of writing.
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
683
A
Alternative program example of the GETE instruction
The following shows the program example to read a user frame.
■
Overview
The user frame No.3EBH (1003) is read.
■
Parameter settings
Set parameters in an engineering tool as follows:
1.
Set the following parameters.
Page 663 Parameter settings of C24 mounted on a redundant extension base unit
2.
Set the module extended parameters.
[Navigation window] [Parameter] [Module Information] [RJ71C24] [Module Extended Parameter]
Item
User frame contents User frame Registration frame No.1003
Description
F90000FFFF00
3.
Write the set parameters to the module.
[Online] [Write to PLC]
• When writing module extended parameters, an engineering tool must be connected to the control system.
• Specify "Intelligent Function Module" as the writing destination of module extended parameters.
4.
Reset the CPU module or turn the power OFF and ON.
■
Program example
Category Label name
Module label
Label to be defined
C24_1.uIO
C24_1.bSts_ReadNormalCompletion_UserFlame_Flash
C24_1.bSts_UnitReady
C24_1.bSts_WatchdogTimerError
C24_1.bSet_Req_Read_UserFlame_Flash
Define the global label as shown below.
Description
Start I/O No.
User frame read completion from flash ROM
Module READY
Watchdog timer error
User frame read request from flash ROM
Device
X117
X11E
X11F
Y117
684
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
(0)
(4)
Executes the program when 'X50' turns ON.
Writes to the C24 buffer memory 2H (register/read/delete instructions) and 3H (frame No. direction).
(17) Turns 'User frame read request to flash ROM' ON.
Reads the C24 buffer memory 4H (register/read/delete results) and turns 'User frame read request from flash ROM' OFF at the completion of reading.
Reads the C24 buffer memory 5H (registration data byte count designation) if the read result is '0' (normal completion).
Calculates the number of words of registration data for FROM instruction.
Reads the C24 buffer memory 6H (user frame).
Alternative program example of the UINI instruction
For the program examples of switching serial communication module mode and transmission specifications, refer to the following section.
Page 415 Mode Switching Method by Program
APPX
Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
685
A
Appendix 10
Added and Changed Functions
This section shows the added and changed functions of C24.
Added/changed contents Software version of an engineering tool
A redundant system is supported for remote head modules.
The MODBUS slave function is supported.
Firmware version
'07' or later
Reference
'11' or later
The following function is supported by the predefined protocol function:
• Redundant system
The following functions are supported by the
MODBUS slave function:
• Redundant system
• Interlink operation
• Mode switching using the dedicated instruction
(UINI)
• Mode switching using the MC protocol
The following function is supported by the MODBUS slave function:
• Access target specification for a CC-Link IE Field
Network remote head module
The simple CPU communication function is supported.
, RJ71C24-R2
• Communication destination device: MELSEC-A/
AnS (CPU COM)
A redundant extension base unit is supported.
'1.065T' or later
'1.070Y' or later
'13' or later
'14' or later
'1.075D' or later '15' or later
Page 661 Using the Module in the Redundant System with
The simple CPU communication function is supported.
• Supported model: RJ71C24(CH2), RJ71C24-R4
The following communication destination devices are supported by the simple CPU communication function:
• MODBUS (RTU)-compatible device
• MODBUS (ASCII)-compatible device
*1 Only CH1 (RS-232) is supported.
686
APPX
Appendix 10 Added and Changed Functions
INDEX
0 to 9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
A
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Additional code . . . . . . . . . . . . . . . . . . . . . . . . 358
Application setting . . . . . . . . . . . . . . . . . . . . . . 460
ASCII-binary conversion . . . . . . . . . . . . . . . . . 379
Auto modem initialization designation
Automatic removal of NULL character
B
Basic setting . . . . . . . . . . . . . . . . . . . . . . . . . . 455
. . . . . . . . . . . . . . . . . . . . . 89
. . . . . . . . . . . . . . 193,297,300,548
C
C/N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Check code . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Circuit trace . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Communication error status . . . . . . . . . . . . . . . 483
Condition match send . . . . . . . . . . . . . . . . . . . 157
Connection retry count designation . . . . . . . . . . 193
Connection retry interval designation . . . . . . . . . 193
Conversion variable . . . . . . . . . . . . . . . . . . . . . 45
CPU error monitoring designation
Current operation status reading
. . . . . . . . . . . . . . . . . . . 171
. . . . . . . . . . . . . . . 171
D
Data arrangement . . . . . . . . . . . . . . . . . . . . . . 162
Data communication using user frame
Data No. for connection designation
Data No. for initialization designation . . . . . . . . . 193
Data reception by receive end code . . . . . . . . . . 58
Data registration status for connection . . . . . . . . 195
Data registration status for initialization
. . . . . . . . . . . . . . . . . . . . . . . 271
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
DC2/DC4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
. . . . . . . . . . . . . . . . . . 142
. . . . . . . . . . . . . . . . . . . . 580
Default registration frame . . . . . . . . . . . . . . . . . 282
DTR/DSR (ER/DR) signal control . . . . . . . . . . . 269
E
Echo back . . . . . . . . . . . . . . . . . . . . . . . . . . . .436
ERR LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . .491
Erroneous noise signal reception prevention
. . . . . . . . . . . . . . . . . . . . . . . . . .519
Error information . . . . . . . . . . . . . . . . . . . . . . . .482
. . . . . . . . . . . . . . . . . . . .491
. . . . . . . . . . . . . . . . . . . . . . . .542
F
Fixed cycle send . . . . . . . . . . . . . . . . . . . . . . . .156
Full-duplex communication . . . . . . . . . . . . 107,275
H
Half-duplex communication . . . . . . . . . . . . . . . .275
Hardware test . . . . . . . . . . . . . . . . . . . . . . . . . .493
Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
I
I/O signals for handshake with CPU module
. . . . . . . . . . . . . . . . . . .429
. . . . . . . . . . . . . . . . . . . . .492
Information to be transmitted . . . . . . . . . . . . . . .161
Initialization command . . . . . . . . . . . . . . . . . . . .209
Initialization of modem/TA . . . . . . . . . . . . . . . . .217
Initialization/connection timeout designation
. . . . . . . . . . . . . . . . . . . .545
. . . . . . . . . . . . . . . . . . . . . . .430
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .400
. . . . . . . . . . . . . . . . . . . . . . . .471
L
Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
List of input/output signal for modem function
. . . . . . . . . . . . . . . . . . . . . . . . . .496
M
MC protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
. . . . . . . . . . . . . . . . . .112
. . . . . . . . . . . . . . . . . . . . . . . .409
Mode switching method by program . . . . . . . . . .415
Modem connection CH specification
Modem connection data . . . . . . . . . . . . . . . . . .477
Modem function error code . . . . . . . . . . . . . . . .194
. . . . . . . . . . . . . . . . .183
Modem function sequence status
. . . . . . . . . . . . . . . . . . .462
. . . . . . . . . . . . . . .207
. . . . . . . . . . . . . . . . . .476
687
I
688
Modem initialization DR (DSR) signal enable/disable designation . . . . . . . . . . . . . . . . 196
. . . . . . . . . . . . 434,475
. . . . . . . . . . . . . . . . . . . . . . . . . . 544
. . . . . . . . . . . . . . . . . . . 434,455
Monitoring condition . . . . . . . . . . . . . . . . . . . . 158
. . . . . . . . . . . . . . . . . . . . . . 154
. . . . . . . . . . . . . . . . . . . . . . 155
. . . . . . . . . . . . . . . . . . . . . . . . . 29
N
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
No-communication interval time designation
. . . . . . . . . . . . . . . . . . 42
. . . . . . . . . . . . . . . . . . . 56
. . . . . . . . . . . . . . . . . . . . 51
No-reception monitoring time (timer 0) . . . . . . . . 260
Number of data registration for connection . . . . . 195
Number of data registration for initialization
Number of initialization retries designation
O
On-demand data arrangement . . . . . . . . . . . . . 300
On-demand data communication . . . . . . . . . . . 299
On-demand function control procedure
On-demand function specification
On-demand user frame specification . . . . . . . . . 300
P
P/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Parameter registration to CPU module
. . . . . . . . . . . . . . . . . . . . . . 454
Parameter setting item for programmable controller
CPU monitoring function . . . . . . . . . . . . . . . . . 170
. . . . . . . . . . . . . . 454
. . . . . . . . . . . . . . . . . . . . . . 30
. . . . . . . . . . . . . . . . . 33
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Processing time . . . . . . . . . . . . . . . . . . . . . . . 603
Programmable controller CPU monitoring function
. . . . . . . . . . . . . . . . . . . . . . . . . . 151,463
Protocol execution count . . . . . . . . . . . . . . . . . 568
Protocol execution log storage function . . . . . . . 146
R
. . . . . . . . . . . . . . . . . . . . . . . . 60,91
. . . . . . . . . . . . . . . . . . . . 61,92,310
. . . . . . . . . . . . . . . . . . . . 70,98
. . . . . . . . . . . . . . . . . . . . . . . 77
Receive end data quantity . . . . . . . . . . . . . . . . . 77
Receive user frame setting details . . . . . . . . . . 324
Receiving data with interrupt program
. . . . . . . . . . . . . . . . . . . . . 57,90
. . . . . . . . . . . . . . . . 68,98
Reception method (method 0, method 1) . . . . . . 315
. . . . . . . . . . . . . . . . . . . . 320
Refresh setting . . . . . . . . . . . . . . . . . . . . . . . . .472
Register/read/delete data for connection . . . . . . .213
Register/read/delete data for initialization
Register/read/delete user frame
Registered bit block quantity designation . . . . . . .172
Registered word block quantity designation
Registration data byte count designation
Registration data byte count designation area . . .196
Remote password check . . . . . . . 182,188,199,203
Remote password function . . . . . . . . . . . . . . . . .29
Response monitoring time (timer 1) . . . . . . . . . .263
RS/CS control enable/disable designation
RS-232 CD terminal check designation
RS-232 communication method designation
RS-232 control signal status reading
RUN LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . .508
S
SD LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .502
SD WAIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . .484
. . . . . . . . . . . . . . . . . . . . . . .494
. . . . . . . . . . . . . . . . . . . . . . . . . 81,100
Send data . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
Send data arrangement . . . . . . . . . . . . . . . . . . .345
Send monitoring time (timer 2)
. . . . . . . . . . . . . .265
. . . . . . . . . . . . . . .348
Send/receive data monitoring . . . . . . . . . . . . . . .419
. . . . . . . . . . . . . . . . . . . . . . 80,99
. . . . . . . . . . . . . . .321
. . . . . . . . . . . . . . . . .347
Simple CPU communication setting
. . . . . . . . . . . . . . . .107
Simultaneous transmission priority/non-priority designation
. . . . . . . . . . . . . . . . . . . . . . . . . . .280
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .484
Startup of Modem Function . . . . . . . . . . . . . . . .204
Static data . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
T
Terminator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Transmission control . . . . . . . . . . . . . . . . . . . . .268
. . . . . . . . . . . . 87,106
. . . . . . . . . . . . . . . . . .346
Transmission timing of monitoring result . . . . . . .156
. . . . . . . . . . . . . . . . . . .267
. . . . . . . . . . . . . . . . . . . . . . .358
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . .482
Troubleshooting by symptom . . . . . . . . . . . . . . .500
U
Unauthorized access . . . . . . . . . . . . . . . . . 187,200
User frame . . . . . . . . . . . . . . . . . . . . . . . . 282,298
User frame content . . . . . . . . . . . . . . . . . . . . . .475
User frame registration status
. . . . . . . . . . . . . .298
. . . . . . . . . . . . . . . . . .461
. . . . . . . . . . . . . . 196
. . . . . . . . . . . . . . . . . . . . . . . 282
V
Variable data . . . . . . . . . . . . . . . . . . . . . . . . . 283
Various control specification . . . . . . . . . . . . . . . 456
W
Word/byte units setting . . . . . . . . . . . . . . . . . . 257
689
I
REVISIONS
*The manual number is given on the bottom left of the back cover.
Revision date
June 2014
September 2014
June 2015
May 2016
December 2016
October 2019
May 2020
October 2020
April 2021
May 2022
*Manual number
SH(NA)-081251ENG-A
SH(NA)-081251ENG-B
SH(NA)-081251ENG-C
SH(NA)-081251ENG-D
SH(NA)-081251ENG-E
SH(NA)-081251ENG-F
SH(NA)-081251ENG-G
SH(NA)-081251ENG-H
SH(NA)-081251ENG-I
SH(NA)-081251ENG-J
Description
First edition
Partial correction
■ Added or modified parts
Section 7.1, Section 26.2, Section 27.4
■ Added or modified parts
TERMS, Appendix 7, Appendix 8
■ Added or modified parts
SAFETY PRECAUTIONS, Section 3.1, Section 27.4
■ Added function
MODBUS slave function
■ Added or modified parts
SAFETY PRECAUTIONS, RELEVANT MANUALS, TERMS, Chapter 1, Chapter 5, Chapter 12,
Chapter 20, Section 20.1, Section 20.2, Section 20.3, Section 22.2, Chapter 23, Section 27.2, Section
28.1, Section 28.3, Section 28.4, Section 28.5, Section 28.6, Appendix 3, Appendix 4, Appendix 7,
Appendix 8
■ Added function
Simple CPU communication function
■ Added or modified parts
Chapter 5, Section 5.1, Section 5.2, Section 5.3, Chapter 6, Chapter 21, Section 21.2, Section 23.2,
Section 28.2, Section 28.3, Section 29.1, Section 29.2, Section 29.3, Section 29.4, Appendix 3,
Appendix 4, Appendix 7, Appendix 8, Appendix 9
■ Added or modified parts
SAFETY PRECAUTIONS, CONDITIONS OF USE FOR THE PRODUCT, TERMS, Section 3.1, Section
3.2, Section 4.1, Section 4.2, Section 5.5, Section 5.6, Section 9.5, Section 10.5, Section 16.4, Section
17.3, Section 17.5, Section 18.4, Section 18.6, Section 19.4, Section 19.6, Chapter 24, Section 27.4,
Section 27.6, Section 29.4, Appendix 8, Appendix 9, Appendix 10
■ Added or modified parts
Section 5.1, Chapter 6, Section 28.3, Section 29.3, Appendix 10
■ Added or modified parts
SAFETY PRECAUTIONS, Section 3.1, Section 3.2, Section 3.3, Section 4.1, Section 4.2, Section 4.4,
Section 9.3, Section 10.5, Appendix 2, Appendix 10
Japanese manual number: SH-081249-J
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
2014 MITSUBISHI ELECTRIC CORPORATION
690
WARRANTY
Please confirm the following product warranty details before using this product.
1. Gratis Warranty Term and Gratis Warranty Range
If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service
Company.
However, if repairs are required onsite at domestic or overseas location, expenses to send an engineer will be solely at the customer's discretion. Mitsubishi shall not be held responsible for any re-commissioning, maintenance, or testing on-site that involves replacement of the failed module.
[Gratis Warranty Term]
The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place.
Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months, and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs.
[Gratis Warranty Range]
(1) The range shall be limited to normal use within the usage state, usage methods and usage environment, etc., which follow the conditions and precautions, etc., given in the instruction manual, user's manual and caution labels on the product.
(2) Even within the gratis warranty term, repairs shall be charged for in the following cases.
1. Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused by the user's hardware or software design.
2. Failure caused by unapproved modifications, etc., to the product by the user.
3. When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if functions or structures, judged as necessary in the legal safety measures the user's device is subject to or as necessary by industry standards, had been provided.
4. Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced.
5. Failure caused by external irresistible forces such as fires or abnormal voltages, and Failure caused by force majeure such as earthquakes, lightning, wind and water damage.
6. Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi.
7. Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user.
2. Onerous repair term after discontinuation of production
(1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued.
Discontinuation of production shall be notified with Mitsubishi Technical Bulletins, etc.
(2) Product supply (including repair parts) is not available after production is discontinued.
3. Overseas service
Overseas, repairs shall be accepted by Mitsubishi's local overseas FA Center. Note that the repair conditions at each FA
Center may differ.
4. Exclusion of loss in opportunity and secondary loss from warranty liability
Regardless of the gratis warranty term, Mitsubishi shall not be liable for compensation to:
(1) Damages caused by any cause found not to be the responsibility of Mitsubishi.
(2) Loss in opportunity, lost profits incurred to the user by Failures of Mitsubishi products.
(3) Special damages and secondary damages whether foreseeable or not, compensation for accidents, and compensation for damages to products other than Mitsubishi products.
(4) Replacement by the user, maintenance of on-site equipment, start-up test run and other tasks.
5. Changes in product specifications
The specifications given in the catalogs, manuals or technical documents are subject to change without prior notice.
691
TRADEMARKS
The company names, system names and product names mentioned in this manual are either registered trademarks or trademarks of their respective companies.
In some cases, trademark symbols such as '
' or '
' are not specified in this manual.
This Product uses the Source Code of T-Kernel under T-License granted by the TRON Forum (www.tron.org).
692
SH(NA)-081251ENG-J(2205)KWIX
MODEL: R-C24-U-OU-E
MODEL CODE: 13JX21
HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN
When exported from Japan, this manual does not require application to the
Ministry of Economy, Trade and Industry for service transaction permission.
Specifications subject to change without notice.
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 3 SAFETY PRECAUTIONS
- 13 CONDITIONS OF USE FOR THE PRODUCT
- 14 INTRODUCTION
- 15 CONTENTS
- 23 RELEVANT MANUALS
- 24 TERMS
- 27 PART 1 BASIC FUNCTIONS
- 28 1 DATA COMMUNICATION USING MC PROTOCOL
- 28 1.1 Accessing to CPU Module Using MC Protocol
- 29 File access method
- 29 1.2 Data Communication
- 29 Formats and codes
- 30 Frames
- 30 Parameter settings for MC protocol communication
- 30 Applicability of multiple CPU systems
- 31 Applicability of remote password function
- 31 Using MX Component
- 32 2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
- 33 2.1 Data Communication Procedure
- 40 2.2 Communication Type of Protocols
- 41 2.3 Packet
- 41 Packet elements
- 54 2.4 Execution Condition of Predefined Protocol Communication
- 58 3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
- 59 3.1 Receiving Data from Target Device
- 59 Receiving methods
- 62 Receive area and receive data arrangement
- 66 Program for data reception
- 70 Reception error detection and check methods
- 72 Receive data clear
- 79 Receive end data quantity and receive end code settings
- 82 3.2 Transmitting Data to Target Device
- 82 Sending methods
- 83 Send area and send data arrangement
- 85 Program for data transmission
- 89 Transmission error detection and check methods
- 90 3.3 Considerations for Data Communication
- 91 4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL
- 92 4.1 Receiving Data from Target Device
- 92 Receiving methods
- 93 Receive area, receive data arrangement and contents
- 97 Program for data reception
- 100 Reception error detection and check methods
- 100 Receive data clear
- 101 4.2 Transmitting Data to Target Device
- 101 Sending methods
- 102 Send area and send data arrangement
- 104 Program for data transmission
- 108 Transmission error detection and check methods
- 109 4.3 Processing when Simultaneous Transmission is Performed during Full-Duplex Communications
- 109 Processing when simultaneous transmissions occur
- 110 Processing of transmitted/received data when simultaneous transmissions occur
- 112 4.4 Considerations for Data Communication
- 114 5 DATA COMMUNICATION USING MODBUS
- 114 5.1 MODBUS Master Function
- 114 5.2 MODBUS Slave Function
- 115 Automatic response function
- 116 MODBUS device assignment function
- 117 5.3 Interlink Function
- 117 5.4 MODBUS Devices
- 117 5.5 Frame Specifications
- 118 5.6 Function List
- 120 6 DATA COMMUNICATION IN SIMPLE CPU COMMUNICATION
- 121 6.1 Communication with a MELSEC-A Series CPU
- 122 6.2 Communication with a MODBUS Slave Device
- 123 6.3 Data Communication Procedure
- 123 6.4 Devices that can be Specified
- 125 6.5 Operations When Performing Simple CPU Communication
- 125 Operations when selecting "Fixed Interval" for the communication setting
- 130 Operations when selecting "On Request" for the communication setting
- 133 Broadcast operation
- 134 6.6 Checking Simple CPU Communication Status
- 136 Exception codes
- 137 6.7 Communication Example
- 142 6.8 Considerations
- 144 7 DEBUG SUPPORT FUNCTION
- 144 7.1 Circuit Trace
- 144 Procedure for the circuit trace
- 145 Performing circuit trace
- 146 Circuit trace option setting
- 148 7.2 Protocol Execution Log Storage Function (for Predefined Protocol only)
- 149 Checking with Engineering tool
- 150 Checking with the buffer memory
- 151 PART 2 ADDITIONAL FUNCTIONS
- 153 8 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION
- 153 8.1 Overview
- 154 8.2 Programmable Controller CPU Monitoring Function
- 154 Data registration for using the programmable controller CPU monitoring function
- 155 CPU module monitoring information
- 157 Monitoring timing of CPU module
- 158 Timings of transmitting monitoring results to the target device
- 161 Transmission methods of monitoring results and data transmitted to the target device
- 164 Data arrangement of device information and programmable controller CPU status information
- 171 Execution order for using the programmable controller CPU monitoring function
- 172 8.3 Settings for Using the Programmable Controller CPU Monitoring Function
- 172 Parameter setting items for the programmable controller CPU monitoring function
- 176 How to register and cancel the programmable controller CPU monitoring function
- 180 8.4 Considerations for Using the Programmable Controller CPU Monitoring Function
- 182 9 COMMUNICATIONS BY THE MODEM FUNCTION
- 182 9.1 Overview
- 183 Features
- 185 Function list
- 186 9.2 System Configuration
- 186 System configuration when performing data communication with target device
- 187 Considerations for system configurations
- 189 9.3 Specifications of Modem Function
- 189 Applicability of remote password function
- 194 List of input/output signals for the modem function
- 195 Buffer memory
- 200 Considerations for using the modem function
- 206 9.4 Startup of the Modem Function
- 206 Startup procedure of the modem function
- 208 Initial settings of Serial communication module
- 211 Register/read/delete data for initialization
- 215 Register/read/delete data for connection
- 219 Initialization of modem/TA (terminal adapter)
- 224 Line connection
- 233 Data communication
- 236 Line disconnection
- 240 9.5 Sample program
- 240 Program for data communication
- 253 10 RECEIVING DATA WITH AN INTERRUPT PROGRAM
- 253 10.1 Settings for Receiving Data Using an Interrupt Program
- 253 10.2 Interrupt Program Startup Timing
- 254 10.3 Reception Control Method Using an Interrupt Program
- 255 10.4 Program Example
- 257 10.5 Considerations when Receiving Data with an Interrupt Program
- 259 11 CHANGING DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTE UNITS SETTING)
- 261 12 CHANGING DATA COMMUNICATION MONITORING TIME
- 262 12.1 No-reception Monitoring Time (timer 0) Setting
- 262 C24 operation by no reception monitoring time (timer 0)
- 263 Changing the no-reception monitoring time (timer 0)
- 265 12.2 Response Monitoring Time (timer 1) Setting
- 265 C24 operation by response monitoring time (timer 1)
- 266 Changing the response monitoring time (timer 1)
- 267 12.3 Send Monitoring Time (timer 2) Setting
- 267 C24 operation by send monitoring time (timer 2)
- 268 Changing the send monitoring time (timer 2)
- 269 12.4 Transmission Wait Time Setting
- 269 C24 operation by transmission wait time
- 269 Changing the transmission wait time
- 270 13 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL
- 271 13.1 Control Contents of DTR/DSR (ER/DR) Signal Control
- 271 C24 DTR control contents and free OS area specification
- 272 C24 DSR control
- 273 13.2 Control Contents of DC Code Control
- 273 DC1/DC3 transmission control, DC1/DC3 reception control
- 275 DC2/DC4 transmission control, DC2/DC4 reception control
- 276 13.3 Considerations for Using Transmission Control Functions
- 277 14 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS
- 277 14.1 Half-duplex Communications
- 278 14.2 Data Transmission and Reception Timing
- 282 14.3 Changing the Communication Method
- 282 14.4 Connector Connections for Half-duplex Communications
- 283 14.5 Considerations for Half-duplex Communications
- 284 15 CONTENTS AND REGISTRATION OF USER FRAMES FOR DATA COMMUNICATION
- 284 15.1 User Frame Types and Contents During Communication
- 284 User frames to be registered and used by the user
- 292 Default registration frame (read only)
- 293 15.2 Transmission/Reception Processing Using User Frame Registration Data
- 293 Transmitting data
- 294 Receiving data
- 296 15.3 Considerations for Registering, Reading, and Deleting User Frames
- 298 15.4 Registering/Reading/Deleting User Frames
- 301 16 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES
- 301 16.1 Data Communication Function Using User Frame
- 302 16.2 User Frame On-Demand Data Transmission and Buffer Memory Used
- 304 16.3 On-Demand Function Control Procedure During User Frame Use
- 304 Data communication using the ASCII code
- 306 Data communications using the binary code
- 308 16.4 Example of On-Demand Data Transmission Program Using User Frames
- 310 17 DATA COMMUNICATIONS USING USER FRAMES
- 311 17.1 Procedure of Data Communication
- 312 17.2 Data Reception
- 312 Receive data
- 318 Timing for start/completion of data reception
- 322 Reception procedure
- 323 Setting of receive user frames
- 329 17.3 Program for Data Reception with User Frame
- 337 Application program for data reception using a combination that specifies the start frame
- 344 Application program for data reception using a combination that does not specify the start frame
- 347 17.4 Data Transmission
- 347 Send data
- 348 Transmission procedure
- 349 Settings of send user frames
- 352 17.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame
- 360 18 TRANSPARENT CODES AND ADDITIONAL CODES
- 360 18.1 Handling Transparent Code and Additional Code Data
- 361 18.2 Registering Transparent Codes and Additional Codes
- 362 18.3 Handling Transparent and Additional Codes for Nonprocedural Protocol Data Communication
- 365 18.4 Data Communication Using Nonprocedural Protocol
- 366 Example of data reception
- 369 Example of data transmission
- 373 18.5 Handling Transparent and Additional Codes for Bidirectional Protocol Data Communication
- 376 18.6 Data Communication Using Bidirectional Protocol
- 377 Example of data reception
- 379 Example of data transmission
- 381 19 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
- 381 19.1 ASCII-Binary Conversion
- 381 19.2 Settings for ASCII-BIN Conversion
- 382 19.3 ASCII-BIN Conversion for Data Communicated with Nonprocedural Protocol
- 384 19.4 Data Communication Using Nonprocedural Protocol
- 385 Example of data reception
- 389 Example of data transmission
- 393 19.5 ASCII-BIN Conversion for Data Communicated with Bidirectional Protocol
- 395 19.6 Data Communication Using Bidirectional Protocol
- 396 Example of data reception
- 398 Example of data transmission
- 400 20 DATA COMMUNICATIONS BETWEEN TARGET DEVICE AND CPU MODULE IN M:N BASIS
- 400 20.1 Considerations on Data Communications
- 402 20.2 Arrangement for Interlock among Target Devices
- 402 Maximum communication time per target device station
- 403 Message structure when communicating data among target devices
- 405 20.3 Examples of Procedure for Data Communications with CPU Module
- 405 Sequential data communications between target devices and the CPU module
- 408 Data communications between target devices and CPU module by designating a master station and slave stations
- 411 21 SWITCHING THE MODE AFTER STARTING
- 413 21.1 Mode Switching Operation and Contents that can be Changed
- 413 Settings that can be changed with mode switching
- 413 Operation for mode switching
- 414 21.2 Considerations for Mode Switching
- 415 21.3 I/O Signals for Handshake with CPU Module and Buffer Memory
- 417 21.4 Mode Switching Method by Program
- 419 21.5 How to Switch Mode from Target Device
- 421 22 USING SEND/RECEIVE DATA MONITORING FUNCTION
- 421 22.1 Send/receive Data Monitoring Function
- 421 Overview
- 422 Send/receive data monitoring operation
- 424 22.2 Send/receive Data Monitoring Function Settings
- 425 Buffer memory for send/receive data monitoring function
- 428 22.3 Send/receive Data Monitoring Example
- 431 23 INDEPENDENT/LINKED OPERATION OF INTERFACE
- 431 23.1 Setting and Data Flow of Independent Operation
- 432 23.2 Setting and Data Flow of Interlink Operation
- 435 Setting example for MELSOFT connection via C24
- 436 24 PARAMETER REGISTRATION TO CPU MODULE
- 438 25 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT SPECIFICATION
- 440 26 ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION FUNCTION
- 440 26.1 Erroneous Noise Signal Reception Prevention Function
- 441 26.2 Setting for the Erroneous Noise Signal Reception Prevention Function
- 442 27 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA
- 442 27.1 Automatic Removal of NULL Characters during Data Transmission
- 442 27.2 Setting for NULL Character Automatic Removal Function
- 443 27.3 NULL Character Removal to Send Data using Nonprocedural Protocol
- 445 27.4 Program Example
- 445 Program example of data communication using the nonprocedural protocol
- 450 27.5 NULL Characters Removal for Send Data using Bidirectional Protocol
- 452 27.6 Program Example
- 452 Program example of data communication using the bidirectional protocol
- 455 PART 3 PARAMETER SETTINGS AND TROUBLESHOOTING
- 456 28 PARAMETER SETTING
- 456 28.1 Parameter Setting Procedure
- 457 28.2 Module Parameters
- 457 Basic settings
- 462 Application settings
- 467 MODBUS slave settings
- 473 Interrupt settings
- 474 Refresh setting
- 477 28.3 Module Extended Parameter
- 477 User frame contents
- 478 Modem initialization data
- 479 Modem connection data
- 480 Simple CPU communication setting
- 484 29 TROUBLESHOOTING
- 484 29.1 Checking Module Status
- 484 Error information
- 485 Module information list
- 489 Intelligent function module monitor
- 493 Error information clear
- 494 Individual station test
- 498 Loopback test
- 500 29.2 How to Clear Programmable Controller CPU Information
- 502 29.3 Troubleshooting by Symptom
- 504 SD LED does not flash even after a send request was made
- 504 RD LED does not flash even though the target device is transmitting a message
- 505 No response message is returned even though the target device transmitted a message and the RD LED flashes
- 507 Read request signal does not turn ON even though the target device transmitted a message and the RD LED flashes
- 509 The CPRTCL instruction execution is not completed although the RD LED flashes, or a receive wait timeout error (7D13H) occurs
- 510 The target device transmitted a message and the RD LED flashes, but a time-out error (7A00H) occurs.
- 510 RUN LED turns OFF
- 510 ERR LED flashes
- 511 ERR LED turns ON
- 512 C ERR LED turns ON
- 513 Hardware information communication error "SIO" occurs
- 514 Hardware information communication error "PRO." occurs
- 515 Hardware information communication error "P/S" occurs
- 515 Hardware information communication error "C/N" occurs
- 516 Hardware information communication error "NAK" occurs
- 516 Communication is intermittent
- 517 Undecodable data are transmitted or received
- 518 Whether the communication error is caused on C24 or target device is unclear
- 518 Communication is not established via modem
- 519 Communication is not established with the ISDN sub-address when using a modem
- 519 Fixed cycle send is not performed normally
- 519 Condition match send is not performed normally
- 519 Data cannot be received by an interrupt program
- 520 Data cannot be written to flash ROM
- 521 29.4 Error Code List
- 544 29.5 Event History List
- 545 29.6 MODBUS Exception Code List
- 546 APPENDIX
- 546 Appendix 1 Module Label
- 547 Appendix 2 Input/Output Signal List
- 550 Appendix 3 Buffer Memory
- 552 Buffer memory list
- 582 Appendix 4 Dedicated Instructions
- 582 Dedicated instruction list
- 583 Appendix 5 Operation Image and Data Structure of Predefined Protocol
- 583 Operation image of each communication type of protocol
- 588 Verification operation of receive packet
- 589 Data examples of packet elements
- 605 Appendix 6 Processing Time
- 607 Appendix 7 When Connecting the Module to a Remote Head Module
- 607 Restrictions
- 608 Communication example
- 626 Appendix 8 Using MODBUS in a Redundant System
- 626 Restrictions
- 627 Redundant master station (single line)
- 628 Redundant master station (redundant line)
- 629 Redundant slave station (redundant line)
- 630 Communication examples for a redundant master station (single line)
- 644 Communication examples for a redundant slave station (redundant line)
- 663 Appendix 9 Using the Module in the Redundant System with Redundant Extension Base Unit
- 663 Restrictions
- 664 Alternative program examples of dedicated instructions
- 688 Appendix 10 Added and Changed Functions
- 689 INDEX
- 692 REVISIONS
- 693 WARRANTY
- 694 TRADEMARKS