Mitsubishi Electric MELSEC iQ-R Series User Manual

Mitsubishi Electric MELSEC iQ-R Series User Manual

Serial communication module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents
MELSEC iQ-R Serial Communication Module
User's Manual (Application)
-RJ71C24
-RJ71C24-R2
-RJ71C24-R4
Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELSEC iQ-R Series

  • Page 1 MELSEC iQ-R Serial Communication Module User's Manual (Application) -RJ71C24 -RJ71C24-R2 -RJ71C24-R4...
  • Page 3: Safety Precautions

    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.
  • Page 4 [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/reserve rotations or upper/lower limit positioning) must be configured external to the programmable controller.
  • Page 5 [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.
  • Page 6 [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 ●...
  • Page 7 [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.
  • Page 8 [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.
  • Page 9 [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.
  • Page 10 [Startup and Maintenance Precautions] CAUTION ● Before handling the module, touch a conducting object such as a grounded metal to discharge the static electricity from the human body. Failure to do so may cause the module to fail or malfunction. [Operation Precautions] CAUTION ●...
  • Page 11: Conditions Of Use For The Product

    CONDITIONS OF USE FOR THE PRODUCT (1) Mitsubishi 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; 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.
  • Page 12: Introduction

    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.
  • Page 13: Table Of Contents

    CONTENTS SAFETY PRECAUTIONS ..............1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 14 Receive data clear............... . 95 Transmitting Data to Target Device .
  • Page 15 Startup of the Modem Function ............172 Startup procedure of the modem function .
  • Page 16 12.3 Changing the Communication Method ........... . . 248 12.4 Connector Connections for Half-duplex Communications .
  • Page 17 Example of data transmission ............. . 345 CHAPTER 17 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) 17.1 ASCII-Binary Conversion .
  • Page 18 CHAPTER 23 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT SPECIFICATION CHAPTER 24 ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION FUNCTION 24.1 Erroneous Noise Signal Reception Prevention Function ........405 24.2 Setting for the Erroneous Noise Signal Reception Prevention Function .
  • Page 19 The CPRTCL instruction execution is not completed although the RD LED flashes..... 462 RUN LED turns OFF ..............463 ERR LED flashes.
  • Page 20: Relevant Manuals

    A memory of an Intelligent function module to store data (including setting value and monitored value) sent to/ receive from CPU module BUFRCVS An abbreviation for Z.BUFRCVS Another term for the MELSEC iQ-R series Serial Communication Module CPRTCL An abbreviation for G.CPRTCL or GP.CPRTCL CPU module...
  • Page 21 Terminology Description MC protocol 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 Multidrop connection 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 Nonprocedural protocol...
  • Page 22 MEMO...
  • Page 23: Part 1 Basic Functions

    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 DEBUG SUPPORT FUNCTION...
  • Page 24: Chapter 1 Data Communication Using Mc Protocol

    DATA COMMUNICATION USING MC PROTOCOL MC protocol is a communication method for the programmable controller. Using this protocol, the target devices can read or write device data and programs from or to the CPU module via a C24. C24 returns a response message automatically based on requests from the target devices. Thus, programs for response messages are not required.
  • Page 25: File Access Method

    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. Specify the password with a request message. Perform the password authentication by using the specified password. For command requiring the password authentication, specify "0040"...
  • Page 26: Frames

    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 Feature and purpose Compatible message format Format...
  • Page 27: Applicability Of Remote Password Function

    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...
  • Page 28: Chapter 2 Data Communication Using Predefined Protocol

    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.
  • Page 29: Data Communication Procedure

    Data Communication Procedure By using the Predefined protocol support function, data can be communicated with a target device in the following procedure. Operating procedure Select a protocol in "Predefined Protocol Support Function", and write the protocol setting data. Page 28 Creating protocol setting data Set the module parameter to "Predefined protocol".
  • Page 30 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 a new protocol setting data.
  • Page 31 ■Adding protocols Add a protocol. [Edit]  [Add Protocol] Item Description Setting range Type Select a protocol type to be added. • Predefined Protocol Library • User Protocol Library • Add New Protocol No. Set the number of the protocol to be added. 1 to 128 ...
  • Page 32 ■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 Description Connected Device Manufacturer Set a manufacturer's name of the connected device. Information Type Set a device type of the connected device.
  • Page 33 ●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.
  • Page 34 ■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.
  • Page 35 ■Writing protocol setting data Write data of the protocol settings to a CPU module or C24. [Online]  [Module Write] 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.
  • Page 36: Communication Type Of Protocols

    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.
  • Page 37: Packet

    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 527 Data examples of packet elements Header Use this element when a specific code or character string exists at the head of a packet.
  • Page 38 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 Description Remarks  Element Name Set a name of the element.
  • Page 39 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.
  • Page 40 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 Description Element Name...
  • Page 41 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". •...
  • Page 42 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.
  • Page 43 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.
  • Page 44 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. Data Storage Area Specify a start device to store variable value. Specification The following explains the configuration of the data storage area.
  • Page 45 ■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 Numeric data ●"Conversion Unit": Word, "Number of Decimals": Variable point For 'Variable Point', the decimal point position is set in the data storage area.
  • Page 46 ■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.
  • Page 47 • 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 Conversion content Upper limit of number data to be received...
  • Page 48 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 Description Remarks...
  • Page 49 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 Description Element Name Set a name of the element. Data Length 0 (variable number of Set this item when the number of characters not to be verified varies in each of communication.
  • Page 50: Execution Condition Of Predefined Protocol Communication

    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...
  • Page 51 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.
  • Page 52 ■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. processing processing processing processing Program UINI instruction execution UINI instruction Completion device Abnormal completion Status indication...
  • Page 53 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. processing processing processing processing Program UINI instruction execution UINI instruction Completion device Abnormal completion Status indication device at...
  • Page 54: Chapter 3 Data Communication Using Nonprocedural Protocol

    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.
  • Page 55: Receiving Data From Target Device

    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 three methods for receiving data: the "reception by the receive end code" for receiving variable length messages, and the "reception by the receive end data quantity"...
  • Page 56  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...
  • Page 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.
  • Page 58 ■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...
  • Page 59: Receive Area And Receive Data Arrangement

    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.
  • Page 60 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.
  • Page 61 Reception operation ■Data reception when the receive data storage area > receive data length 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 100 words...
  • Page 62 ■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) >...
  • Page 63: Program For Data Reception

    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 520 Dedicated Instructions) (CH1) Read request Create control data from D0 Abnormal detection...
  • Page 64 (CH1) Module READY (X1E) Ò Ó Ó Reception data read request (X3) ON during abnormal ON during abnormal Reception abnormal reception detection reception detection detection (X4) INPUT instruction INPUT INPUT Ô Ô Õ Õ INPUT instruction completion (M0) device INPUT instruction completion (M1) device + 1 (Normal completion/abnormal...
  • Page 65 Specify the reception channel. Specify the allowable number of data to be received. Specify the execution instruction. Address Buffer memory Un\G600 Data reception result For normal completion I/O No. Interface number Un\G1536 Receive data count Allowable number of data to be received (10) Un\G1537 Reception result...
  • Page 66 • Received data can also be read using interrupt programs. (Page 219 RECEIVING DATA WITH AN INTERRUPT PROGRAM) Note that if the reading of data received from the same interface is performed, it is not possible to combine the reading of data received by the main program and reading of data received by the interrupt program. Accordingly, use either of the above program to read the data received.
  • Page 67: Reception Error Detection And Check Methods

    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 possible primary causes of errors during data reception are shown below. Cause of reception error Reference A transmission error occurred due to noise.
  • Page 68 Reception area Reception error occurred data (buffer memory) CPU module Head data Receive complete code Receive data count Reception Target device abnormal detection INPUT ) (41 ) (42 ) (43 ) (44 ) (45 ) (46 ) (47 ) (48 ) (03 instruction Received data...
  • Page 69: Receive Data Clear

    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.
  • Page 70 ■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. Set the execution type. Set the request type (receive data clear). Execute receive data clear.
  • Page 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.
  • Page 72 ■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 520 Dedicated Instructions) Category Label name Description Device Module label C24_1 Target module  C24_1.bSts_UnitReady Module READY C24_1.bSts_WatchdogTimerError Watchdog timer error C24_1.stnCH1.bSet_Req_ReceptionRead...
  • Page 73 3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL 3.1 Receiving Data from Target Device...
  • Page 74 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. (35) Set the transmission request. (37) Designate the transmission channel. Set the send data quantity.
  • Page 75 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 Register C24 in "Intelligent Function Module Monitor".
  • Page 76: Receive End Data Quantity And Receive End Code Settings

    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 Default Allowable range...
  • Page 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 ●...
  • Page 78 Specify the reception channel. Specify the allowable number of data to be received. Set the receive end data quantity. Set the receive end code. (63) Normal completion (66) Abnormal completion 3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL 3.1 Receiving Data from Target Device...
  • Page 79: Transmitting Data To Target Device

    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 ) (41 ) (42 ) (43 ) (44...
  • Page 80: Send Area And Send Data Arrangement

    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.
  • Page 81 Send data arrangement The arrangement of data to be stored in the send area when transmitted to the target device is as shown in the example below. When transmitting 'ABCDEFG123' (The send area is the default value.) address Buffer memory 5 or 10 Transmission data count designation Un\G1536...
  • Page 82: Program For Data Transmission

    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 520 Dedicated Instructions) (CH1) Transmission instruction Create transmission data from D11 Create control data from D0 G.OUTPUT...
  • Page 83 ■Program example Category Label name Description Device  Module label C24_1 Target module Label to be defined Define the global label as shown below. 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.2 Transmitting Data to Target Device...
  • Page 84 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. (69) Reset the completion flag by an external command. 3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL 3.2 Transmitting Data to Target Device...
  • Page 85 Address Buffer memory Un\G599 Data transmission result For normal completion I/O No. Interface number Transmission data count Un\G1024 Transmission data count designation (4241 Un\G1025 Transmission data Transmission data designation (0A0D Un\G1535 Transmission result D101 For abnormal completion I/O No. Interface number Transmission data count (4241 Transmission data...
  • Page 86: Transmission Error Detection And Check Methods

    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 possible primary causes of errors during data transmission are shown below. Cause of transmission error Reference A timeout occurred for the send monitoring time (timer 2).
  • Page 87: Considerations For Data Communication

    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. •...
  • Page 88: Chapter 4 Data Communication Using Bidirectional Protocol

    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.
  • Page 89: Receiving Data From Target Device

    Receiving Data from Target Device This section explains the 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.
  • Page 90: Receive Area, Receive Data Arrangement And Contents

    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.
  • Page 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). •...
  • Page 92 Contents of received data The following shows the contents of data to be received, including data to be transmitted. (Page 97 Send area and send data arrangement) ■Control codes The types of control codes are shown in the table below. Signal Code Description...
  • Page 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.
  • Page 94: Program For Data Reception

    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 520 Dedicated Instructions) (CH1) Reception data read request Create control data from D0 G.BIDIN...
  • Page 95 ■Program example Category Label name Description Device  Module label C24_1 Target module C24_1.stnCH1.bSet_Req_ReceptionRead CH1 Reception data read request Label to be defined Define the global label as shown below. For information on the module FB to be used, refer to the following manual. MELSEC iQ-R Serial Communication Module Function Block Reference Specify the reception channel.
  • Page 96 Address Buffer memory Un\G600 Data reception result For normal completion I/O No. Interface number Un\G1536 Receive data count Allowable receive data count (10) Un\G1537 Reception result Receive data count (n) Received data Un\G2047 Received data Dm 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.
  • Page 97: Reception Error Detection And Check Methods

    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 Reference A transmission error occurred due to noise.
  • Page 98: Transmitting Data To Target Device

    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 Buffer memory Program...
  • Page 99: Send Area And Send Data Arrangement

    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 90 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.
  • Page 100 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. When transmitting "ABCDEFG123" Transmission area (buffer memory) Transmission data Transmission data count designation Data check length...
  • Page 101: Program For Data Transmission

    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 520 Dedicated Instructions) (CH1) Transmission instruction Create transmission data from D11 Create control data from D0 G.BIDOUT Processing for normal completion...
  • Page 102 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 Description Device ...
  • Page 103 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. (67) Reset the completion flag by an external command. 4 DATA COMMUNICATION USING BIDIRECTIONAL PROTOCOL 4.2 Transmitting Data to Target Device...
  • Page 104 Address Buffer memory Un\G599 Data transmission result For normal completion I/O No. Interface number Transmission data count Un\G1024 Transmission data count designation (4241 Un\G1025 Transmission data Transmission data designation (0A0D Un\G1535 Transmission result D101 For abnormal completion I/O No. Interface number Transmission data count (4241 Transmission data...
  • Page 105: Transmission Error Detection And Check Methods

    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 Reference A transmission error occurred due to noise.
  • Page 106: Processing When Simultaneous Transmission Is Performed During Full-Duplex Communications

    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.
  • Page 107: Processing Of Transmitted/Received Data When Simultaneous Transmissions Occur

    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 231 Response Monitoring Time (timer 1) Setting Send data: Enable, Receive data: Enable Ó-1...
  • Page 108 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 239 Control Contents of DC Code Control) During message transmission processing, time check by timer 1 (response monitoring time) is performed. ●...
  • Page 109: Considerations For Data Communication

    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. •...
  • Page 110 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.
  • Page 111: Chapter 5 Debug Support Function

    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) Circuit Trace The communication data and communication control signal between C24 and target device are traced.
  • Page 112: Performing 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 Select [Tool][Intelligent Function Module Tool][Serial Communication Module][Circuit Trace] in Engineering tool. Click the [Module Selection] button to select the module to be traced in the "Module Selection (Circuit Trace)" screen. Select the channel to be traced from "Channel Selection", and click the [Start Trace] button.
  • Page 113: Circuit Trace Option Setting

    Displayed items Item Display/setting content Trace Result Currently Displayed Data Displays the model name, measurement time, and extraction date/time of the module on which the circuit trace is executed. [Find] button Searches the trace data. Send/Receive Packet Select the display format of the send/receive packets. The hexadecimal or ASCII code can be selected.
  • Page 114 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 Display/Setting content Circuit Trade Data Start Address Set the start address of the C24 buffer memory. Storage Area Input the setting in hexadecimal.
  • Page 115: Protocol Execution Log Storage Function (For Predefined Protocol Only)

    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.
  • Page 116: Checking With Engineering Tool

    Checking with Engineering tool Check the protocol execution logs and protocol execution results in the "Protocol Execution Log" screen of Engineering tool. Operating procedure Select a module to be debugged. • Display the "Protocol Setting" screen. (Page 27 Data Communication Procedure) •...
  • Page 117: Checking With The Buffer Memory

    Checking with the buffer memory Check the protocol execution logs in the execution log storage area. Operating procedure 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 Log registration condition 0(OFF) : Register failed protocols only.
  • Page 118 MEMO 5 DEBUG SUPPORT FUNCTION 5.2 Protocol Execution Log Storage Function (for Predefined Protocol only)
  • Page 119: Part 2 Additional Functions

    PART 2 ADDITIONAL FUNCTIONS This part explains the additional functions of C24. 6 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION 7 COMMUNICATIONS BY THE MODEM FUNCTION 8 RECEIVING DATA WITH AN INTERRUPT PROGRAM 9 CHANGING DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTE UNITS SETTING) 10 CHANGING DATA COMMUNICATION MONITORING TIME 11 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL 12 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS...
  • Page 120 24 ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION FUNCTION 25 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA...
  • Page 121: Chapter 6 Using The Programmable Controller Cpu Monitoring

    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. Overview This section explains an overview of the programmable controller CPU monitoring function. Transmitting data without a program •...
  • Page 122: Programmable Controller Cpu Monitoring Function

    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.
  • Page 123: Cpu Module Monitoring Information

    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. •...
  • Page 124 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 type...
  • Page 125: Monitoring Timing Of Cpu Module

    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.
  • Page 126: Timings Of Transmitting Monitoring Results To The Target Device

    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;...
  • Page 127 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.
  • Page 128 ■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.
  • Page 129: Transmission Methods Of Monitoring Results And Data Transmitted To The Target Device

    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"...
  • Page 130 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".) •...
  • Page 131 ■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 Device information for the block registered in Number 1 number n...
  • Page 132: Data Arrangement Of Device Information And Programmable Controller Cpu Status Information

    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.
  • Page 133 ■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. •...
  • Page 134 When user frame No. B061H is designated Programmable controller CPU status information (for one block) is transmitted as the following data: Item Communicating with Communicating with Remarks ASCII code binary code Device code '01' All fixed value Number of registered points '0001' 0001H Monitoring start device...
  • Page 135 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.
  • Page 136 • (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 6 USING THE PROGRAMMABLE CONTROLLER CPU MONITORING FUNCTION 6.2 Programmable Controller CPU Monitoring Function...
  • Page 137 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. 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...
  • Page 138 • (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 W100 W101 W102...
  • Page 139: Execution Order For Using The 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.
  • Page 140: Settings For Using The Programmable Controller Cpu Monitoring Function

    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.
  • Page 141 Setting items and requirement for communication using the nonprocedural protocol : Required, : Not required Setting item Fixed cycle Condition Reference send match send   Programmable controller CPU monitoring function designation Page 139 Programmable controller CPU monitoring function designation Cycle time units designation ...
  • Page 142 ■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.
  • Page 143 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. 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.
  • Page 144: How To Register And Cancel The Programmable Controller Cpu Monitoring Function

    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.
  • Page 145 ■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).
  • Page 146 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 method to data transmission.
  • Page 147 ■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. Set the command pulse. Execute the programmable controller CPU monitoring registration.
  • Page 148: Considerations For Using The Programmable Controller Cpu Monitoring Function

    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. •...
  • Page 149 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.
  • Page 150: Chapter 7 Communications By The Modem Function

    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.
  • Page 151: Features

    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).
  • Page 152 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 155 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.
  • Page 153: Function List

    Function list The overview of the modem function are as follows. Function Overview Modem/TA initialization Initializes the modem/TA using the user-designated initialization data (AT command). (Auto initialization of the modem/TA is possible.) Line connection (dialing) Dials the target telephone number according to the user-designated data for connection and enables data communication after establishing the line connection.
  • Page 154: System Configuration

    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.
  • Page 155: Considerations For System Configurations

    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. •...
  • Page 156 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.
  • Page 157: Specifications Of Modem Function

    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 158 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) •...
  • Page 159 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).
  • Page 160 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. •...
  • Page 161 ■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. •...
  • Page 162: List Of Input/Output Signals For The Modem Function

    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 493 Input/Output Signal List The start I/O number of C24 is '0030'.
  • Page 163: Buffer Memory

    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. Page 498 Buffer memory list 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.
  • Page 164 ■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. •...
  • Page 165 ■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 166 ■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 Registration number (Decimal (Hex.)) Initialization data Flash ROM...
  • Page 167 ■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).
  • Page 168: Considerations For Using The Modem Function

    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.
  • Page 169 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. •...
  • Page 170 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.
  • Page 171 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.3 Specifications of Modem Function...
  • Page 172 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.3 Specifications of Modem Function...
  • Page 173 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. 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: ...
  • Page 174: Startup Of The Modem Function

    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.
  • Page 175 Procedure for data communication indicates processing performed by the user. Line Connection Waiting side Line Connection Side target Modem Modem device Perform the processing up to Perform the processing up to the modem/TA initialization. the modem/TA initialization. Modem initialization Modem initialization Line connection wait state Modem Modem initialization completion signal (X10)=ON initialization completion signal (X10 = ON)
  • Page 176: Initial Settings Of Serial Communication Module

    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 Data communication Test mode setting No specification Communication protocol setting •...
  • Page 177 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"...
  • Page 178 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.
  • Page 179: Register/Read/Delete Data For Initialization

    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.
  • Page 180 Registration contents before shipment • The data for initialization registered in the flash ROM of C24 are listed below: Registration Initialization command Devices number Hexadec Decimal Manufacturer Model imal 7D0H 2000 ATQ0V1E1X1\J0\Q2\V2\N3S0=1 Iwa Corporation PV-AF2881WW, PV-BF288M2 7D1H 2001 ATQ0V1E1X1\Q2\V2\N3S0=1 Micro Research Institute, Inc. MC288XE, MC288X1 7D2H 2002...
  • Page 181 Method to register/read/delete data for initialization The applicable registration area is shown below. Applicable area Method Remarks Flash ROM in C24 Register/read/delete operations are The data for initialization, which is stored in the flash ROM of C24 before executed with Engineering tool. shipment, cannot be deleted.
  • Page 182 ■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 Description Device Module label C24_1.bSts_UnitReady Module READY C24_1.bSts_WatchdogTimerError Watchdog timer error C24_1.wnForUserRegistrationNo8001H_D[0] For user registration number 8001H...
  • Page 183: Register/Read/Delete Data For Connection

    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.
  • Page 184 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, : Configurable, : Not required Setting item Data communication (MC, nonprocedural, bidirectional)
  • Page 185 • 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.
  • Page 186 ■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 Description Device Module label C24_1.bSts_UnitReady Module READY C24_1.bSts_WatchdogTimerError Watchdog timer error C24_1.wnForUserRegistrationNo8002H_D[0] For user registration number 8002H U0\G6953...
  • Page 187: Initialization Of Modem/Ta (Terminal Adapter)

    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 beforehand. • C24 initial settings (Page 174 Initial settings of Serial communication module) •...
  • Page 188 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"...
  • Page 189 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. 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...
  • Page 190 ■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 Label name Description Device Module label C24_1.bSts_ModemInitializationCompletion...
  • Page 191 Turn the READY flag ON. Turn the modem initialization applicable flag ON. (11) Issue the modem initialization command. (14) Set the initialization request signal. Set the initialization request flag. (18) Set the initialization completion flag. Read the error code at initialization abnormal completion. (34) Reset the flag with the clear command.
  • Page 192: Line Connection

    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 174 Initial settings of Serial communication module) •...
  • Page 193 Input/output signals used for line connection 'Connection request' (Y11), 'Dialing' (X11), 'Connection' (X12) and 'Initialization/connection abnormal completion' (X13) are used. When performing the line connection only from the C24 side after the completion of initialization Buffer memory for 3000 connection (Un\G53) Normal completion Connection...
  • Page 194 When performing the initialization and the line connection from the C24 side simultaneously Buffer memory for initialization (Un\G52) Buffer memory for 3000 connection (Un\G53) Normal completion Connection request Modem initialization completion Dialing Connecting RS-232 CD terminal Set "Display a result code using the AT command"...
  • Page 195 When performing the line connection from the target device after the completion of initialization Buffer memory for connection (Un\G53) (OFF) Connection request (ON) Modem initialization completion (OFF) Dialing (Normal connection) Connecting (Normal connection) RS-232 CD terminal Unlock processing for Result code the remote password Reception receive...
  • Page 196 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 Label name Description...
  • Page 197 Registration of data for initialization Registration of data for connection Modem/TA initialization Turn the READY flag ON. Turn the line connection available flag ON. (11) Register data for initialization. Page 180 Program example (14) (41) Register data for connection. Page 184 Program example (44) (75) Modem/TA initialization...
  • Page 198 ■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 Label name Description Device Module label C24_1.bSts_ModemInitializationCompletion Modem initialization completion C24_1.bSts_ConnectionProcessing...
  • Page 199 Registration of data for initialization Registration of data for connection Turn the READY flag ON. Turn the line connection available flag ON. (12) Register data for initialization. Page 180 Program example (15) (42) Register data for connection. Page 184 Program example (45) (76) Issue the line connection command.
  • Page 200 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 201: Data Communication

    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.
  • Page 202 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 Modem RS-232 Modem cable RS-232 cable...
  • Page 203 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. •...
  • Page 204: Line Disconnection

    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...
  • Page 205 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.
  • Page 206 Registration of data for initialization Registration of data for connection Modem/TA initialization Line connection 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.4 Startup of the Modem Function...
  • Page 207 Turn the READY flag ON. (11) Register data for initialization Page 180 Program example (14) (41) Register data for connection Page 184 Program example (44) (76) Modem/TA initialization Page 188 Program example (91) (107) Line connection Page 194 Program example (When establishing the line connection from the C24 side following the completion of initialization) (130) (133) Turn the data update available flag ON.
  • Page 208: Sample Program

    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.
  • Page 209 ■Program example Category Label name Description Device  Module label C24_1 Target module C24_1.stnCH1.bSts_TransmissionNormalCompletion CH1 Transmission normal completion C24_1.stnCH1.bSts_TransmissionAbnormalEnd CH1 Transmission abnormal completion C24_1.bSts_ModemInitializationCompletion Modem initialization completion C24_1.bSts_DialProcessing Dialing C24_1.bSts_ConnectionProcessing Connection C24_1.bSts_Initialization_Connection_AbnormalCompletion Initialization/connection abnormal completion C24_1.bSts_DisconnectionCompletion Modem disconnection completion C24_1.bSts_UnitReady Module READY C24_1.bSts_WatchdogTimerError Watchdog timer error...
  • Page 210 Category Label name Description Device Label to be defined Define the global label as shown below. For information on the module FB to be used, refer to the following manual. MELSEC iQ-R Serial Communication Module Function Block Reference 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 211 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 212 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 213 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 214 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 215 Accessible Modem initialization Data communication available (15) Data transmission available Modem disconnection available (26) Convert the modem initialization and line connection command into pulse. (32) Jump to the subroutine of the modem initialization and line connection processing. (36) Convert the data communication (transmission) command into pulse. (41) Jump to the subroutine of the data reception processing.
  • Page 216 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 Setting content Basic settings Communication protocol setting Nonprocedural protocol Communication speed setting 19200 bps Transmission setting...
  • Page 217 Category Label name Description Device Label to be defined Define the global label as shown below. For information on the module FB to be used, refer to the following manual. MELSEC iQ-R Serial Communication Module Function Block Reference 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 218 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 219 7 COMMUNICATIONS BY THE MODEM FUNCTION 7.5 Sample program...
  • Page 220 Accessible Initialize the modem. (31) 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)
  • Page 221: Chapter 8 Receiving Data With An Interrupt Program

    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.
  • Page 222: Reception Control Method Using An Interrupt Program

    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. FEND SM400 Z.BUFRCVS...
  • Page 223: Program Example

    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.
  • Page 224 Data register Buffer memory D200 D201 Reception area Receive data count Receive data D2nn • For communication using either the nonprocedural protocol or bidirectional protocol, BUFRCVS instruction is used to receive data with an interrupt program. (Page 520 Dedicated Instructions) •...
  • Page 225: Considerations When Receiving Data With An Interrupt Program

    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.
  • Page 226 For the CH1 side, designate the receive interrupt-issued designation. (63) Processing at normal completion (67) Processing at abnormal completion (71) Initialize the error information of the CH1 side. (75) Execute the receive interrupt program. 8 RECEIVING DATA WITH AN INTERRUPT PROGRAM 8.5 Considerations when Receiving Data with an Interrupt Program...
  • Page 227: Chapter 9 Changing Data Length Units To Byte Units (Word/Byte Units Setting)

    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 ...
  • Page 228 MEMO 9 CHANGING DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTE UNITS SETTING)
  • Page 229: Chapter 10 Changing Data Communication Monitoring Time

    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.
  • Page 230: Reception Monitoring Time (Timer 0) Setting

    10.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.
  • Page 231: Changing The No-Reception Monitoring Time (Timer 0)

    ■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. •...
  • Page 232 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. Td × Vbps No-reception monitoring time (timer 0) = 1 + 12000 (Round up fractions below decimal point.) Td : Maximum delay time for target device output processing (ms) Vbps: Transmission rate (bps) Calculation of no-reception monitoring time (timer 0)
  • Page 233: Response Monitoring Time (Timer 1) Setting

    10.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.
  • Page 234: Changing The Response Monitoring Time (Timer 1)

    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" ...
  • Page 235: Send Monitoring Time (Timer 2) Setting

    10.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.
  • Page 236: Changing The Send Monitoring Time (Timer 2)

    ■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.
  • Page 237: Transmission Wait Time Setting

    10.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.
  • Page 238: Chapter 11 Data Communications Using Dc Code Transmission Control

    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.
  • Page 239: Control Contents Of Dtr/Dsr (Er/Dr) Signal Control

    11.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.
  • Page 240: C24 Dsr Control

    Specification of free OS area For the DTR/DSR (ER/DR) signal control, the size of the free 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" ...
  • Page 241: Control Contents Of Dc Code Control

    11.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. •...
  • Page 242 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.
  • Page 243: Dc2/Dc4 Transmission Control, Dc2/Dc4 Reception 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. •...
  • Page 244: Considerations For Using Transmission Control Functions

    11.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.
  • Page 245: Chapter 12 Data Communications Using Half-Duplex Communications

    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.
  • Page 246: Data Transmission And Reception Timing

    12.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.
  • Page 247 ■When C24 is designated to "Non-priority" Continue data transmission. Data B Data A Target device CPU module Data C-1 Data C-2 Retransmission Since the C24 does not have priority, when the CD(DCD) signal is turned ON, it terminated transmission. (*1) Data C-1 Data C-2 SD(TXD) (Send Data)
  • Page 248 Timing when transmitting data from C24 Transmit data by controlling C24 RS (RTS) signal according to the setting value for "simultaneous transmission priority/non- priority designation" of the parameter. ■When C24 is designated to "priority" Terminate data Retransmission transmission. Data C-1 Data C Target device CPU module...
  • Page 249 ■When C24 is designated to "Non-priority" Continue data transmission. Data C Target device CPU module Data B Data B Data A (*2) Since the C24 does not have priority, Send Send request Time for request when the CD(DCD) signal is turned ON, it terminated transmission.
  • Page 250: Changing The Communication Method

    12.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".
  • Page 251: Considerations For Half-Duplex Communications

    12.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) (Half-duplex communications cannot be designated) Target device...
  • Page 252: Chapter 13 Contents And Registration Of User Frames For Data Communication

    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.
  • Page 253 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 Maximum Frame No. Application Remarks number of frames can be registered CPU module...
  • Page 254 ■Variable data designation contents, data contents transmitted and received, and handling by 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 Data contents transmitted and received/C24 handling Calculating...
  • Page 255 ■Calculating ranges for the registered codes The following shows the calculating ranges for the registered codes. Range 4 Range 4 Range 3 Range 3 User frame User frame User frame User frame User frame User frame Arbitrary data (1st) (2nd) ("n-1"th) ("n"th) (First frame)
  • Page 256 ■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.
  • Page 257 ■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.
  • Page 258 ■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 Data contents transmitted and received FFH + EEH or FFH + F4H The lower 2 bytes of the calculated sum check code are transmitted and received as 2-byte binary code data.
  • Page 259 ■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.
  • Page 260: Default Registration Frame (Read Only)

    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.
  • Page 261: Transmission/Reception Processing Using User Frame Registration Data

    13.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.
  • Page 262: Receiving Data

    ■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 When message transmitted from the station No.1 C24 1 A ;...
  • Page 263 ■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.
  • Page 264: Considerations For Registering, Reading, And Deleting User Frames

    13.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.
  • Page 265 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.
  • Page 266: Registering/Reading/Deleting User Frames

    13.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 User frame No. Registration destination Remarks Data communication Default registration frame 1H to 3E7H ROM for C24 operating system Read enabled function (1 to 999)
  • Page 267 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  [Parameters]  [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...
  • Page 268 ■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.
  • Page 269: Chapter 14 On-Demand Data Communications Using User Frames

    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.
  • Page 270: User Frame On-Demand Data Transmission And Buffer Memory Used

    14.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.
  • Page 271 ■Combination Only the following combinations can be used for arrangement of on-demand data by user frame specification. : designated data Combination Data name Start frame (1st) Start frame (2nd) Send data Final frame (1st) Final frame (2nd)    ...
  • Page 272: On-Demand Function Control Procedure During User Frame Use

    14.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 •...
  • Page 273 Added by C24 First frame (1st) Target device First frame (2nd) Last frame (1st) User frame User frame Send data (Data name) User frame FFH,FFH registration code CPU module Send data corresponding to check registration code Code (Example) Send data code 30H 30H 31H 32H 33H 34H 35H 36H 37H 38H 03H 44H 32H ONDEMAND command...
  • Page 274: Data Communications Using The Binary Code

    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. •...
  • Page 275 Added by C24 Target device First frame Last frame (1st) (1st) User frame User frame Send data (Data name) User frame FFH,01H FFH,F0H 0DH 0AH registration code CPU module Send data corresponding to check ; code registration code (Example) 3BH 12H 34H 56H 78H 03H 0DH 0AH Send data code ONDEMAND command...
  • Page 276: Example Of On-Demand Data Transmission Program Using User Frames

    14.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.
  • Page 277 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. (61) Normal completion (63) Abnormal completion...
  • Page 278: Chapter 15 Data Communications Using User Frames

    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.
  • Page 279: Procedure Of Data Communication

    15.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 Parameter setting with Engineering tool (When only default registration frame is used) (When registering user frames) Registration using module extended parameter or *1,*2...
  • Page 280: Data Reception

    15.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 User frame Arbitrary data...
  • Page 281 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.
  • Page 282 ■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.
  • Page 283 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.
  • Page 284 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.
  • Page 285 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)) •...
  • Page 286: Timing For Start/Completion Of Data Reception

    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.
  • Page 287 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 Timing pattern number...
  • Page 288 ■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) Target device Arbitrary data Arbitrary data CPU module Equaling the For the received data received data count...
  • Page 289 ■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 Arbitrary data Arbitrary data CPU module For the received data count Pattern No. 2-A 3) Pattern No.
  • Page 290: Reception Procedure

    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) ...
  • Page 291: Setting Of Receive User Frames

    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"...
  • Page 292 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. •...
  • Page 293 ■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 User frame receiving method Method 1 dedicated receive Remarks designation end data quantity  (Final frame only) Method 0 The receive end data...
  • Page 294 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 (Default 0H)
  • Page 295 ■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. (Default All 0H) Buffer memory address Un\G174/334...
  • Page 296 ■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. (Page 293 Start frame No. designation area and final frame No.
  • Page 297: Program For Data Reception With User Frame

    15.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.
  • Page 298 ■Registration contents in user frame User frame No. Registered code Registered data content 3E8H/8001H 02H, 51H, 20H, 0AH, 3BH STX, Q, (SP), Station No. of target device, ; 3E9H/8002H 02H, 41H, 3BH STX, A, ; 41BH/8005H 03H, FFH, F0H ETX, Sum check code Program example when setting with Engineering tool ■Program example Category...
  • Page 299 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. (14) Execute reception (60) Set normal completion flag. (62) Set abnormal completion flag. 15 DATA COMMUNICATIONS USING USER FRAMES 15.3 Program for Data Reception with User Frame...
  • Page 300 Address Buffer memory Un\G173 User frame use enable/disable designation (program) Un\G174 (1st) Sets the receive user frame First frame 1st set registration No. No. designation Un\G177 (4th) Un\G178 (1st) 4th set Last frame No. designation Un\G181 Receive user frame (4th) Un\G600 Data reception result Data reception result...
  • Page 301 Program example when setting by a program ■Program example Category Label name Description Device  Module label C24_1 Target module C24_1.bSts_UnitReady Module READY C24_1.stnCH1.bSet_Req_ReceptionRead CH1 Reception data read request C24_1.stnCH1.bSts_ReceptionAbnormalDetection CH1 Reception abnormal detection C24_1.stnCH1.uSet_UserFrameUse_Enable_disable_Recei CH1_Receive user frame use enable/disable U0\G173 veUserFrame_D designation...
  • Page 302 For information on the module FB to be used, refer to the following manual. MELSEC iQ-R Serial Communication Module Function Block Reference 15 DATA COMMUNICATIONS USING USER FRAMES 15.3 Program for Data Reception with User Frame...
  • Page 303 15 DATA COMMUNICATIONS USING USER FRAMES 15.3 Program for Data Reception with User Frame...
  • Page 304 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".
  • Page 305: Application Program For Data Reception Using A Combination That Specifies The Start 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...
  • Page 306 Category Label name Description Device Label to be defined Define the global label as shown below. For information on the module FB to be used, refer to the following manual. MELSEC iQ-R Serial Communication Module Function Block Reference Read the combinations of user frames received. Set the reception channel to CH1.
  • Page 307 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 When STX is handled as transparent code Receive data count Word units 10H 02H Number of received byte excluding frame Head data...
  • Page 308 ■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. Receive data count Word units 10H 02H Number of received byte excluding frame and additional code (12)/2=6 Head data Byte units Number of received byte excluding frame and additional code (12)
  • Page 309 ■When receiving with user frame only (reception using Method 0) Head data (For reception using the combination Since there is no arbitrary data portion, of first frame and last frame) the receive data count is [0]. The following diagram is for reception using Target the combination of first frame and last frame.
  • Page 310 ■When receiving with first start only (reception using Method 1) Head data 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. Target device User frame use enable/ Un\G173 disable designation First frame...
  • Page 311 ■When receiving with a combination of the start frame and arbitrary data (method 1 dedicated receive end data quantity) (reception using Method 1) Receive data count Head data 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...
  • Page 312: Application Program For Data Reception Using A Combination That Does Not Specify The Start Frame

    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...
  • Page 313 Category Label name Description Device Label to be defined Define the global label as shown below. For information on the module FB to be used, refer to the following manual. MELSEC iQ-R Serial Communication Module Function Block Reference Read the combinations of user frames received. Set the reception channel to CH1.
  • Page 314 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. Receive data count 10H 02H Head data 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)
  • Page 315: Data Transmission

    15.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.
  • Page 316: Transmission Procedure

    Transmission procedure The following describes the transmission procedure when a message containing user frames is transmitted to the target device. Procedure Target device User frame User frame Arbitrary data User frame User frame CPU module(*1) (1st) (nth) (mth) (±th) Transmission area data (*2) CPU module...
  • Page 317: Settings Of Send User Frames

    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 ...
  • Page 318 ■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.
  • Page 319 • '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.
  • Page 320: Application Program For Data Transmission Using A Combination That Does Not Specify The Start

    15.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...
  • Page 321 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 Description Device  Module label C24_1 Target module C24_1.bSts_UnitReady Module READY C24_1.bSts_WatchdogTimerError Watchdog timer error C24_1.stnCH1.uSet_TransmissionDataCount_D...
  • Page 322 15 DATA COMMUNICATIONS USING USER FRAMES 15.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame...
  • Page 323 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.
  • Page 324 Target device Four bytes of data in the Data in transmission area (Total number) transmission area are (arbitrary data portion) transmitted as is. CPU module (Byte units in the left diagram.) (012DH) (1234H) (56ABH) 02H 51H 54H4FH 54H 41H 4CH 3F2H 3F3H 8001H...
  • Page 325 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 Description Device  Module label C24_1 Target module C24_1.bSts_UnitReady Module READY C24_1.bSts_WatchdogTimerError Watchdog timer error C24_1.stnCH1.wnSet_OutputFrameNum_UserFrame_D...
  • Page 326 15 DATA COMMUNICATIONS USING USER FRAMES 15.5 Application Program for Data Transmission using a Combination that does not Specify the Start Frame...
  • Page 327 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.
  • Page 328: Chapter 16 Transparent Codes And Additional Codes

    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 Description Transparent code...
  • Page 329: Registering Transparent Codes And Additional Codes

    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.
  • Page 330: Handling Transparent And Additional Codes For Nonprocedural Protocol Data Communication

    16.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.
  • Page 331 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. •...
  • Page 332 When ASCII-BIN conversion is performed Target device (Communicating in an arbitrary format) Head data Buffer memory (transmission area/reception area) Transmission data count/Receive (0002H) Arbitrary data Send 00H , 02H data count (0212H) 02H , 12H Transmission (BC3AH) data/ BCH , 3AH receive data Receive (The data count is in word units)
  • Page 333: Data Communication Using Nonprocedural Protocol

    16.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". (Page 422 PARAMETER SETTING) Setting item Setting content Basic...
  • Page 334: Example Of Data Reception

    Example of data reception Program example The following shows an example of storing received data in the data register. Category Label name Description Device  Module label C24_1 Target module C24_1.stnCH1.bSet_Req_ReceptionRead CH1 Reception data read request C24_1.stnCH1.bSts_ReceptionAbnormalDetection CH1 Reception abnormal detection Label to be defined Define the global label as shown below.
  • Page 335 Reception example based on the receive end data quantity When C24 receives data from the target device when the transparent code designation is enabled Transparent code designation: Additional code: 10H (DLE), Transparent code: 02H (STX), Receive end data quantity designation: 6-word or 12-word Additional code (C24 deletes) Transparent code Head data...
  • Page 336 Operation example of reception by the receive end code When C24 receives data from the target device when the transparent code designation is enabled Additional code: 10H(DLE), Transparent code: 02H(STX), End code: 0D0AH(CR+LF) Additional code (C24 deletes) Transparent code Head data For word unit: Received byte count excluding additional code (12)/2=6 For byte unit:...
  • Page 337: Example Of Data Transmission

    Example of data transmission The following shows an example of data transmission. Transmission by transparent code for sending specification, 1st Transparent code designation: Additional code: 10H (DLE), Transparent code: 02H (STX) Additional code (added by C24) Target device Transparent code Head data For word unit: 0 1 1 2 3...
  • Page 338 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 (65) Normal completion (67) Abnormal completion 16 TRANSPARENT CODES AND ADDITIONAL CODES 16.4 Data Communication Using Nonprocedural Protocol...
  • Page 339 Transmission by 1st/2nd combinations of transparent code for sending specification Transparent code designation (1st): Additional code: 10H (DLE),Transparent code: 02H (STX) Transparent code designation (2nd): Additional code: 10H (DLE),Transparent code: 03H (ETX) Additional Additional code code (2nd) (1st) Target Transparent Transparent device Head data...
  • Page 340 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. (65) Normal completion (67) Abnormal completion 16 TRANSPARENT CODES AND ADDITIONAL CODES 16.4 Data Communication Using Nonprocedural Protocol...
  • Page 341: Handling Transparent And Additional Codes For Bidirectional Protocol Data Communication

    16.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.
  • Page 342 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 Buffer memory Data length Data section Additional code...
  • Page 343 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 Target device Head data Arbitrary data Buffer memory (transmission area/reception area) Transmission data (0002H) Send Data length...
  • Page 344: Data Communication Using Bidirectional Protocol

    16.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". (Page 422 PARAMETER SETTING) Setting item Setting content Basic...
  • Page 345: Example Of Data Reception

    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 Transparent code designation: Additional code: 10H (DLE), Transparent code: 02H (STX) Additional code (C24 deletes) Transparent code Data Data portion...
  • Page 346 Set the reception channel to CH1. Set the allowable number of data to be received to 6. Set the reception direction. Execute reception (54) Normal completion (56) 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.
  • Page 347: Example Of Data Transmission

    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 Transparent code designation (1st): Additional code: 10H (DLE), Transparent code: 02H (STX) Transparent code designation (2nd): Additional code: 10H (DLE), transparent code: 03H (ETX) Transparent code (2nd) Target device...
  • Page 348 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. (20) Execute transmission. (65) Normal completion (67) Abnormal completion 16 TRANSPARENT CODES AND ADDITIONAL CODES 16.6 Data Communication Using Bidirectional Protocol...
  • Page 349: Chapter 17 Communicating With Ascii Code (Ascii-Bin Conversion)

    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. 17.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.
  • Page 350: Ascii-Bin Conversion For Data Communicated With Nonprocedural Protocol

    17.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 User frame...
  • Page 351 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.
  • Page 352: Data Communication Using Nonprocedural Protocol

    17.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. (Page 422 PARAMETER SETTING) Setting item Setting content Remarks...
  • Page 353: Example Of Data Reception

    Example of data reception Program example The following shows an example of data reception. Category Label name Description Device  Module label C24_1 Target module C24_1.stnCH1.bSet_Req_ReceptionRead CH1 Reception data read request C24_1.stnCH1.bSts_ReceptionAbnormalDetection CH1 Reception abnormal detection Label to be defined Define the global label as shown below.
  • Page 354 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) End code: 9H (code after ASCII-BIN conversion) For word units Head data Data Number of bytes after Two bytes of received data is read to...
  • Page 355 Operation example of reception based on the receive end data quantity When C24 receives data from the target device when ASCII-BIN conversion is enabled (Reception based on the receive end data quantity) For word units Head data Number of bytes after Two bytes of receive data is read to ASCII-BIN conversion: C24 as one-byte data.
  • Page 356 Operation example of reception using user frames When C24 receives data from the target device when ASCII-BIN conversion is enabled (Reception using user frames) Receive data count For word units Number of bytes after ASCII-BIN conversion of Head data 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)
  • Page 357: Example Of Data Transmission

    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) Target device (arbitrary data) Eight characters of data in the transmission area are sent in two characters per byte through...
  • Page 358 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. (10) Execute transmission. (55) Normal completion (57) Abnormal completion 17 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) 17.4 Data Communication Using Nonprocedural Protocol...
  • Page 359 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) Target device Data in transmission area Eight characters of data (Total number) (arbitrary data) in the transmission area are sent in two characters (012 DH)
  • Page 360 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.
  • Page 361: Ascii-Bin Conversion For Data Communicated With Bidirectional Protocol

    17.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: Applicable data range at transmission/reception (Arbitrary data) Sum check...
  • Page 362 Calculation of sum check code Buffer memory (When word units are used) Message Data length Data portion Transmission data check count/Receive data count 00H , 02H (0002) code 34H , 12H Transmission data/ receive data BCH , 5AH ASCII-BIN conversion Calculation of sum check code 30H+32H+30H+30H+31H+32H+33H+34H+35H+41H+42H+43H=0287H (H)(L)
  • Page 363: Data Communication Using Bidirectional Protocol

    17.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. (Page 422 PARAMETER SETTING) Setting item Setting content Basic...
  • Page 364: Example Of Data Reception

    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. Data length Data area check (0004H) code Target device 34H 30H 30H 33H 34H 35H 41H 42H 45H 46H 30H 41H Set to even byte except for additional code...
  • Page 365 Set the reception channel to CH1. Set the allowable number of data to be received to 6. Set the reception direction. Execute reception. (52) Normal completion (54) 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...
  • Page 366: Example Of Data Transmission

    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. Target device Data length Data area check (0004) code 34H 30H 30H 33H 34H 35H 41H 42H 45H 46H 30H 41H Transmission...
  • Page 367 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. (20) Execute transmission. (65) Normal completion (67) Abnormal completion 17 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) 17.6 Data Communication Using Bidirectional Protocol...
  • Page 368: Chapter 18 Data Communications Between Target Device And Cpu Module In M:n Basis

    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).
  • Page 369 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 Communications with 1C frame Station No.
  • Page 370: Arrangement For Interlock Among Target Devices

    18.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.
  • Page 371: Message Structure When Communicating Data 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.
  • Page 372 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.
  • Page 373: Examples Of Procedure For Data Communications With Cpu Module

    18.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.
  • Page 374 (Before Ö) (Before Ö) Target device Target device Target device Target device (Station No.:1BH) (Station No.:1CH) (Station No.:1DH) (Station No.:1EH) Data communications Õ Ö with arbitrary × CPU module (Station No.:0H) (Station No.:15H) (Station No.:1H) (Station No.:2H) : Target device that obtained the line ownership The above C24 includes Q series C24, L series C24, QC24(N), and UC24.
  • Page 375 Target device that obtains the line ownership (1CH) (1F) (1C) (ZZ) (0A) 31H 46H 31H 43H 5AH 5AH 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. •...
  • Page 376: Data Communications Between Target Devices And Cpu Module By Designating A Master Station And Slave Stations

    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. Time Permission granted...
  • Page 377  The master station transmits a permission response to the slave station that issued the communications request. Massage of Ò Command "ZX" is a communications Target device of request command for description purpose. slave station that The user should select the command that wants to obtain the requests communications.
  • Page 378  The master station that received the communication complete report transmits a response to the slave station that transmitted the communication complete report. Massage of Ö Command "ZY" is a communications complete report command for description purpose. Target device of The user should select the communications complete report command.
  • Page 379: Chapter 19 Switching The Mode After Starting

    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.
  • Page 380: Mode Switching Operation And Contents That Can Be Changed

    19.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.
  • Page 381: Considerations For Mode Switching

    19.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 •...
  • Page 382: I/O Signals For Handshake With Cpu Module And Buffer Memory

    19.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 I/O signal Signal name Device turned ON/ Timing ...
  • Page 383 ■Switching mode No. designation (Un\G144/304) Write the mode No. after mode switching (0001H to 0007H, 0009H, 00FFH). When "0000H" is designated, the operation will be matched with the setting in MELSOFT. Buffer memory address Un\G144/304 (Default 0000H) 0001H : MC protocol (Format 1) 0002H : MC protocol (Format 2) 0003H : MC protocol (Format 3) 0004H : MC protocol (Format 4)
  • Page 384 *2 It indicates the setting value for the communication speed. Communication speed Bit position Communication speed Bit position Remarks (units: bps) (units: bps) b15 to b8 b15 to b8 1200 38400 Decrease the communication speed when data cannot be 2400 57600 communicated normally due 4800...
  • Page 385: Mode Switching Method By Program

    19.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. Mode switching request Y2/Y9 Mode switching in progress X6/XD Module READY Mode switching area...
  • Page 386 ■Program example The following shows an example of program for mode switching of the CH1 side interface. Category Label name Description Device  Module label C24_1 Target module C24_1.stnCH1.bSet_Req_ReceptionRead CH1 Reception data read request C24_1.stnCH1.bSts_ReceptionAbnormalDetection CH1 Reception abnormal detection C24_1.stnCH1.bSts_ModeSwitchingProcessing CH1 Switching mode C24_1.stnCH1.bSet_Req_ModeSwitching CH1 Mode switching request...
  • Page 387: How To Switch Mode From Target Device

    19.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. Mode switching *For the message format, refer to the MELSEC Communication Protocol Reference Manual. command Target device message...
  • Page 388 ■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 Label name Description Device Module label C24_1 Target module  C24_1.stnCH1.bSet_Req_ModeSwitching CH1 Mode switching request C24_1.stnCH1.bSts_ModeSwitchingProcessing CH1 Switching mode C24_1.uSts_ModeSwitching_ParameterSetting_D...
  • Page 389: Chapter 20 Using Send/Receive Data Monitoring Function

    USING SEND/RECEIVE DATA MONITORING FUNCTION The following describes C24 send/receive data monitoring function. 20.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.
  • Page 390: Send/Receive Data Monitoring Operation

    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) •...
  • Page 391 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".
  • Page 392: Send/Receive Data Monitoring Function Settings

    20.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 ...
  • Page 393: Buffer Memory For Send/Receive Data Monitoring Function

    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 388 Send/receive data monitoring operation Buffer memory address Un\G8216/8472 (Default: 0000H)
  • Page 394 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.
  • Page 395 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 394 Send/receive Data Monitoring Example Received data When receiving data (DCD) (CTS)
  • Page 396: Send/Receive Data Monitoring Example

    20.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...
  • Page 397 Clear the monitor data area to '0'. During monitor start instruction (24) During monitoring (002H) Monitor setting error (100FH) (46) During monitor stop (1002H) (52) During monitor stop instruction (61) Monitor stopped (0000H) 20 USING SEND/RECEIVE DATA MONITORING FUNCTION 20.3 Send/receive Data Monitoring Example...
  • Page 398 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 393 Monitor data area (Un\G9730 to 13055/13058 to 16383(default)) Monitoring example when the following data is transmitted from CH1 for data communication using the nonprocedural protocol.
  • Page 399: Chapter 21 Independent/Linked Operation Of Interface

    INDEPENDENT/LINKED OPERATION OF INTERFACE This chapter explains the independent/linked operation of C24. 21.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 Setting content ...
  • Page 400: Setting And Data Flow Of Interlink Operation

    21.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.
  • Page 401 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.
  • Page 402: Setting Example For Melsoft Connection Via C24

    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 Station 1 • Setting at station No.0 Setting item Setting content  Basic Transmission Test mode setting settings setting ...
  • Page 403: Chapter 22 Parameter Registration To Cpu Module

    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...
  • Page 404 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. Place the CPU module in the STOP state. On the "Module extended parameter setting " screen for RJ71C24(-R2/4) of Engineering tool, restore the default setting value of module extended parameter.
  • Page 405: Chapter 23 Rs-422/485 Interface Echo Back Enable/Prohibit Specification

    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.
  • Page 406 MEMO 23 RS-422/485 INTERFACE ECHO BACK ENABLE/PROHIBIT SPECIFICATION...
  • Page 407: Chapter 24 Erroneous Noise Signal Reception Prevention Function

    ERRONEOUS NOISE SIGNAL RECEPTION PREVENTION FUNCTION This chapter explains the erroneous noise signal reception prevention function of C24. 24.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.
  • Page 408: Setting For The Erroneous Noise Signal Reception Prevention Function

    24.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. Setting to disable the reception with Engineering tool Set "Communication data reception enable/disable designation" to "Receive disable". Navigation window ...
  • Page 409: Chapter 25 Automatic Removal Of Null Characters Included In Send Data

    AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA This chapter explains the automatic removal of NULL characters in data transmission of C24. 25.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.
  • Page 410: Null Character Removal To Send Data Using Nonprocedural Protocol

    25.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: •...
  • Page 411 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. •...
  • Page 412: Program Example

    25.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.
  • Page 413 Example of arbitrary data transmission C24 transmits a string data using the NULL character automatic removal function to the target device. Transmitting given data with OUTPUT dedicated instruction Target device (Arbitrary data) 31H 32H 33H 41H 42H 43H Transmission command CPU module OUTPUT Completion device...
  • Page 414 Set the transmission channel to CH1. Set the send data quantity to 4. Set the data to be transmitted. Set the transmission direction. (65) Normal completion (67) Abnormal completion 25 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA 25.4 Program Example...
  • Page 415 Example of transmission using user frame C24 transmits a string data using the NULL character automatic removal function to the target device. Transmitting given data in combination with a user frame with PRR dedicated instruction Target device Data in transmission area (Total (arbitrary data portion) number)
  • Page 416 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.
  • Page 417: Null Characters Removal For Send Data Using Bidirectional Protocol

    25.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.
  • Page 418 Example of data transmission after automatic removal of NULL characters using the bidirectional protocol Target device Buffer memory (transmission area/reception area) Head data Arbitrary data (Data transmission) (0008H) Transmission data count Data Data Send (3231H) NULL check length portion characters code (0033H) automatic...
  • Page 419: Program Example

    25.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.
  • Page 420 Example of data transmission C24 transmits a string data using the NULL character automatic removal function to the target device. Transmitting given data with BIDOUT dedicated instruction Target device Data length Data area check (0006) code Transmission command BIDOUT CPU module Completion device Abnormal Status display device...
  • Page 421 Set the transmission channel to CH1. Set the send data quantity to 8. Set the data to be transmitted. Set the transmission direction. (65) Normal completion (67) Abnormal completion 25 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA 25.6 Program Example...
  • Page 422 MEMO 25 AUTOMATIC REMOVAL OF NULL CHARACTERS INCLUDED IN SEND DATA 25.6 Program Example...
  • Page 423: Part 3 Parameter Settings And Troubleshooting

    PART 3 PARAMETER SETTINGS TROUBLESHOOTING This part explains parameters and troubleshooting of C24. 26 PARAMETER SETTING 27 TROUBLESHOOTING...
  • Page 424: Chapter 26 Parameter Setting

    PARAMETER SETTING This section explains parameter settings necessary for data communication between C24 and a target device. 26.1 Parameter Setting Procedure This section explains the parameter setting procedure to use RJ71C24. Add C24 to Engineering tool. Select [Parameters]  [Module Information] from Navigation window, and right click and select [Add New Module]. Module parameters and module extended parameters are included in parameters.
  • Page 425: Module Parameters

    26.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.
  • Page 426 Various control specification Specify the various controls. Item Description Setting range Test mode setting Sets the test mode. • No specification (other When a problem occurs during data communication with a target device, check than test mode) whether or not there is any problem in the operation of the C24. •...
  • Page 427 Item Description Setting range Signal specification RTS (RS) signal status designation Sets the ON/OFF state of RTS(RS) signal. • OFF • ON (Default: ON) DTR (ER) signal status designation Sets the ON/OFF state of DTR (ER) signal. • OFF • ON (Default: ON) Transmission Transmission control...
  • Page 428 Item Description Setting range Half-duplex Simultaneous transmission priority/non- Sets whether the transmission from C24 is continued or 0.0 to 25.5 communication priority designation discontinued when C24 and a target device stat data (Default: 0.0: Priority) control transmission at the same time. specification 0.0: Priority 0.1 to 25.5: Non-priority...
  • Page 429 Item Description Setting range Receiving area Receiving buffer memory start address Set the start address of the area used as the receive area. 1024 to 6911 (400H to specification designation 1AFFH), 9728 to 16383 (2600H to 3FFFH) (Default (CH1): 1536 (600H)) (Default (CH2): 2560 (A00H)) Receiving buffer memory size Set the size of the area used as the receive area.
  • Page 430: Application Settings

    Application settings Configure the settings such as the user frame specification. Item Description Reference User frame specification Sets the system setting value for data communication using a user frame. Page 429 User frame specification Modem function setting Sets the system setting value for data communication using the modem function. Page 430 Modem function setting Programmable controller...
  • Page 431 User frame specification Set the system setting value for data communication using a user frame. Item Description Setting range On-demand user Start frame No. Sets the user frame number to be used. 0000H to 801FH frame specification designation (nth) (Default: 0000H) Final frame No.
  • Page 432 Modem function setting Set the system setting value for data communication using the modem function. Item Description Setting range Modem function Modem connection Sets a channel to connecting a modem/TA • None specification 1 CH specification • CH1 • CH2 (Default: None) Connection re-try Sets a number of retries for the connection request.
  • Page 433 Programmable controller CPU monitoring function setting Set the system setting value to use the programmable controller CPU monitoring function. Item Description Setting range Programmable controller CPU monitoring function designation Sets the timing to transmit the programmable controller • Do not use the function CPU monitoring results to a target device.
  • Page 434 Item Description Setting range Block monitoring n-th block Monitoring condition Sets the condition and numeric value for the monitoring ■When the monitoring device monitoring device value designation condition. device is a word device 0000H to FFFFH ■When the monitoring device is a bit device •...
  • Page 435: Interrupt Settings

    Interrupt settings Configure the settings to receive data with an interrupt program. Item Description Reference Interrupt factor Sets the condition for interruption occurrence. • No specification • BUFRCVS instruction data reception (Default: No specification) Interrupt pointer Sets the interrupt pointer to be used by the program. I0 to I15, I50 to I2023, label (up to 256 characters) (Default: ...
  • Page 436: Refresh Setting

    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". •...
  • Page 437 Setting item Item Description Reference Transfer to intelligent function Send data_send area A refresh setting for the send data storage area. Page 77 Transmitting module Data to Target Device Page 96 Transmitting Data to Target Device Page 441 Checking error Transfer to CPU LED lighting status, A refresh setting for confirmation of LED lighting status and...
  • Page 438 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: •...
  • Page 439: Module Extended Parameter

    26.3 Module Extended Parameter Set a module extended parameter. The Module extended parameter includes user frame contents, modem initialization data, modem connection data, 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.
  • Page 440: Modem Initialization Data

    Modem initialization data In the modem initialization data, the data for initialization of the data number from 2500 to 2529 is set. Item Description Setting range Initialization command Sets a data code for initialization command. 78 (maximum number of characters that can be entered) User control data Sets an arbitrary data for a user to control the data to be registered.
  • Page 441: Modem Connection Data

    Modem connection data In the modem connection data, the data for connection of data number from 3000 to 3029 is set. Item Description Setting range External line outgoing number Sets an external line outgoing number of the C24 side for line connection to the •...
  • Page 442: Chapter 27 Troubleshooting

    TROUBLESHOOTING This chapter explains the errors which may occur when using C24 and the corrective actions. 27.1 Checking Module Status The following functions can be used in the "Module Diagnostics" screen of C24. Function Description Error Information 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.
  • Page 443: Module Information List

    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 444 Displayed items ■Buffer memory area for the display contents (Information on the CH1 side) Un\G513 Buffer memory address Un\G514 (Information on the CH2 side) For system SD WAIT PRO. ACK. NEU. 1: LED ON, error 0: LED OFF, no error ■SD WAIT SD WAIT indicates "Transmission wait status".
  • Page 445 ■C/N C/N indicates 'Access status with the CPU module'. Value Status Description 0001(ON) Error occurred • 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.
  • Page 446 Checking transmission setting Details of transmission settings can be monitored. Window Displayed items Item Description Operation setting Independent, Interlink Data bit 7, 8 Parity bit None, Yes Odd/even parity Odd, Even Stop bit 1, 2 Sum check code None, Yes Online change Disable, Enable Setting change...
  • Page 447: Intelligent Function Module Monitor

    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.
  • Page 448 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.
  • Page 449 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. Page 422 PARAMETER SETTING ■Operation mode status storage area The current operation status of C24 is stored in the following buffer memory areas.
  • Page 450: Error Information Clear

    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.
  • Page 451: Individual Station Test

    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: •...
  • Page 452 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 Test mode setting (Page 422 PARAMETER SETTING) • Set the test mode setting to "Hardware test". •...
  • Page 453 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 Connecting cable •...
  • Page 454 Completing self-loopback test • When the result is normal Start data communication with the target device.  Configure the parameter settings with Engineering tool. (Page 422 PARAMETER SETTING)  Turn OFF the power for the station with C24, and connect the cable to communicate with the target device. ...
  • Page 455: Loopback Test

    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.
  • Page 456 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 Two characters (hexadecimal): Designate the number of characters (1 to 254) of return data to be sent immediately afterward. by the target device Designate with a character string consisting of "0"...
  • Page 457: How To Clear Programmable Controller Cpu Information

    27.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. C24 obtains this information from the access target CPU module at the time of initial access, and stores it inside the C24.
  • Page 458 Executing the programmable controller CPU information clear request In the "Intelligent Function Module Monitor" screen, set "4C43H" to the 'Programmable controller CPU information clear request' (Un\G128). Check the 'Programmable controller CPU information clear request' (Un\G128) turns to "0000H" with the Buffer Memory Batch Monitor function.
  • Page 459: Troubleshooting By Symptom

    27.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 Protocol...
  • Page 460 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.
  • Page 461: Sd Led Does Not Flash Even After A Send Request Was Made

    SD LED does not flash even after a send request was made Symptom Cause Corrective action SD LED does not flash even The CS(CTS) signal is in the • While the CS(CTS) signal is OFF, C24 does not transmit  ...
  • Page 462: No Response Message Is Returned Even Though The Target Device Transmitted A Message And The Rd Led Flashes

    No response message is returned even though the target device transmitted a message and the RD LED flashes Symptom Cause Corrective action  The target device transmitted Communication protocol • Review the communication protocol setting. a message and RD LED setting is incorrect.
  • Page 463: Read Request Signal Does Not Turn On Even Though The Target Device Transmitted A Message And The Rd Led Flashes

    Read request signal does not turn ON even though the target device transmitted a message and the RD LED flashes Symptom Cause Corrective action   CH Reception data read Communication protocol • Review the communication protocol setting. request' (X3/XA) does not setting is incorrect.
  • Page 464: The Cprtcl Instruction Execution Is Not Completed Although The Rd Led Flashes

    The CPRTCL instruction execution is not completed although the RD LED flashes Symptom Cause Corrective action  When the CPRTCL Incorrect protocol number is • Review the protocol number specified in the control data for instruction was executed for specified in the control data. the CPRTCL instruction.
  • Page 465: Run Led Turns Off

    (Page 380 I/O Signals for Handshake with CPU Module and Buffer Memory)  The protocol setting data • Write the protocol setting data for MELSEC iQ-R series C24 stored in the CPU module is to the CPU module. not for MELSEC iQ-R series C24.
  • Page 466: Err Led Turns On

    ERR LED turns ON Symptom Cause Corrective action     ERR LED turns ON. The online mode switching • Read the error code from the buffer memory, and check the designation is incorrect. error contents and correct the designation contents. ...
  • Page 467: C Err Led Turns On

    • Remarks The error code when ERR LED turns ON is stored in the buffer memory shown below. Error factor Error code storage buffer memory Address Name Modern function error Un\G545 Modern function error Monitoring device error Un\G8709 Un\G8965 Programmable controller CPU monitoring function execution result Predefined protocol function error Un\G16450...
  • Page 468: Hardware Information Communication Error "Sio" Occurs

    Hardware information communication error "SIO" occurs Symptom Cause Corrective action     Hardware information The stop bit settings do not • Match the stop bit settings of C24 to that of the target communication error "SIO" match. device. occurs.
  • Page 469: Hardware Information Communication Error "Pro." Occurs

    Hardware information communication error "PRO." occurs Symptom Cause Corrective action Hardware information Communications were Check the data transmitted from the target device with the  communication error signal performed with a control Circuit Trace function of Engineering tool, and take the "PRO."...
  • Page 470: Hardware Information Communication Error "P/S" Occurs

    Hardware information communication error "P/S" occurs Symptom Cause Corrective action     Hardware information The parity bit settings do not • Review the data format between C24 and the target device, communication error signal match. and match the settings. "P/S"...
  • Page 471: Hardware Information Communication Error "Nak" Occurs

    Hardware information communication error "NAK" occurs Symptom Cause Corrective action Hardware information Refer to section which • Take corrective action corresponding to the contents of the  communication error signal describes the communication error. "NAK" turns ON. error signal ("C/N", "P/S", "PRO", "SIO") that are turned ON simultaneously when the "NAK"...
  • Page 472: Undecodable Data Are Transmitted Or Received

    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.
  • Page 473: Whether The Communication Error Is Caused On C24 Or Target Device Is Unclear

    Whether the communication error is caused on C24 or target device is unclear Symptom Cause Corrective action      Whether the communications Perform the following tests on the C24 side to investigate error is caused on the C24 where the cause is.
  • Page 474: Communication Is Not Established With The Isdn Sub-Address When Using A Modem

    Communication is not established with the ISDN sub-address when using a modem Symptom Cause Corrective action   Data cannot be Sub-address is incorrect. • Review the sub-address. communicated with ISDN   The modem does not support • Use modem supporting ISDN sub-address. sub-address ISDN sub-address.
  • Page 475: Error Code List

    27.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.
  • Page 476 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined  7140H Request data • The request exceeded the • Check and correct the error limit of processing points transmission message from that are predetermined for the target device and restart each command and data communications.
  • Page 477 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 714AH Cannot execute a • A write command was • Change the setting to enable  command during designated when the the 'Online change' and restart 'Online change' is data communications.
  • Page 478 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined  7169H CPU error • Communication with the • If the CPU module side has an CPU module cannot be error, remove the error and established normally.
  • Page 479 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 7D11H Protocol • The CPRTCL instruction • Correct the program not to  simultaneous and 'CH1 protocol ERR. execute the CPRTCL execution error execution request' (Y3) or instruction and 'CH1 protocol 'CH2 protocol execution execution request' (Y3)/'CH2...
  • Page 480 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined  7D17H Packet size error • A packet of more than • Check the data length of the 2048 bytes was received. ERR. packet sent from the target device.
  • Page 481 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 7D21H Decimal point • An out-of-range decimal • Correct the decimal point  place point position is set when ERR. position. specification error the number of decimals is •...
  • Page 482 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined  7E48H Request error • A request was received • Wait for awhile and transmit during parameter the request again. communication.   7E4FH Number of device •...
  • Page 483 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 7E60H Device monitoring • Programmable controller  • Cancel the programmable   duplicate CPU monitoring controller CPU monitoring and registration error registration was perform the programmable performed twice.
  • Page 484 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined     7EC4H Transmission • Data exceeding the send • Make the send data quantity data count error, buffer memory size was smaller than the buffer Send and receive transmitted.
  • Page 485 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 7F20H ASCIIBIN • When the nonprocedural • Check and correct the   conversion error or bidirectional protocol is transmission message from used, an ASCII code that the target device and restart cannot be converted to data communications.
  • Page 486 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined  7F25H Data length error • The length of the received • Correct the "data length" that data exceeds the receive ERR. is transmitted from the target area size.
  • Page 487 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 7F68H Framing error • The stop bit settings do • Match the settings of C24 with     not match. that of the target device. •...
  • Page 488 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined  Page 490 Corrective actions 7FCFH System error • The operating system of C24 detected some error. for system error    7FD1H Modem function •...
  • Page 489 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 7FDEH Modem function • Connection to the modem/ • Check if the modem/TA has    error TA failed, or a modem/TA ERR. any failure by referring to the is not connected.
  • Page 490 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined   7FE7H Remote password • The remote password is • A remote password error not registered. processing command is not • The remote password necessary when a remote processing command was password is not registered.
  • Page 491 Error code Error Description Signal Corrective action Protocol (hexadecima name Nonpr Bidire Prede ocedu ctiona fined 7FFCH System error • The operating system of  Page 490 Corrective actions C24 detected some error. for system error    7FFDH NULL character •...
  • Page 492 Corrective actions for system error Check if the C24, the power module, and the CPU module are mounted correctly. Check if the environment of the C24 usage is within the range of the general specifications for the CPU module. Check if the power supply capacity is sufficient. Check if the hardware of the C24 and the CPU module is normal according to the respective module manual.
  • Page 493: Event History List

    27.5 Event History List The table below shows the events saved by C24. Event code Event type Description Cause 00700 System The contents of error code for error The causes of error code for error occurred occurred 10200 Security Remote password lock The remote password is locked.
  • Page 494: Appendix

    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 C24_1.stnCH1.uSet_ReceivedDataCount_Reception_D...
  • Page 495: Appendix 2 Input/Output Signal List

    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.
  • Page 496 Input signals Device number Signal name Reference  CH1 Transmission normal completion CH1 Transmission abnormal completion CH1 Transmission processing CH1 Reception data read request Page 53 Receiving Data from Target Device CH1 Reception abnormal detection Page 87 Receiving Data from Target Device CH1 Protocol execution completion ...
  • Page 497 Output signals Device number Signal name Reference CH1 Transmission request  CH1 Reception data read completion CH1 Mode switching request Page 377 SWITCHING THE MODE AFTER STARTING  CH1 protocol execution request Y4 to Y6 Use prohibited CH2 Transmission request CH2 Reception data read completion CH2 Mode switching request Page 377 SWITCHING THE MODE...
  • Page 498: Appendix 3 Buffer Memory

    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.
  • Page 499 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. •...
  • Page 500: Buffer Memory List

    Buffer memory list Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  0, 1 Use prohibited System area (0H, 1H)   For flash ROM Register/read/delete instructions (2H) (user frame) 0: No request access 1: Registration request 2: Read request 3: Deletion request Frame No.
  • Page 501 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  Programmable controller CPU information clear Page 455 How to (80H) programmable request Clear Programmable controller CPU 0: No request Controller CPU information clear 4C43H: Requested Information  129 to 143 Use prohibited System area...
  • Page 502 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi For designation DTR/DSR (ER/DR), DC control designation Page 236 DATA (93H) (133H) of transmission • Transmission control (b0) COMMUNICATIONS control 0: DTR/DSR control USING DC CODE 1: DC code control TRANSMISSION •...
  • Page 503 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  For designation Buffer memory start address designation CH1:40 Page 267 ON- (A0H) (140H) of on-demand (400H to 1AFFH, 2600H to 3FFFH) DEMAND DATA function CH2:80 COMMUNICATIONS USING USER FRAMES Data length designation MELSEC...
  • Page 504 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  For designation Transmission wait time designation Page 235 (11EH) (1BEH) of send wait 0: No wait time Transmission Wait time 1H to FH: Wait time (unit: 10 ms) Time Setting ...
  • Page 505 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi For confirmation Station number (parameter setting) Depend Page 441 Module (200H) of station s on information list number setting paramet status setting For confirmation CH1 side LED lighting status and Depend (201H) of LED lighting...
  • Page 506 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi   For confirmation Number of registered user frames Depend (204H) of user frame 0: No registration 1 to 200: Number of s on registered frames registrat status. 517 to 541 User frame registration status (for registration Depend...
  • Page 507 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  For confirmation Test mode setting status Depend (24EH) of test mode 0000H: No specification s on status 0001H: Hardware Tests paramet 0002H: Self-loopback test setting. For confirmation Station number (instruction setting) Depend Page 445 Intelligent...
  • Page 508 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  For confirmation Transmission setting status (parameter setting) Depend (251H) (261H) of transmission • Operation setting (b0) s on control status 0: Independent 1: Interlink paramet • Data bit (b1) 0: 7 bits 1: 8 bits setting.
  • Page 509 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  For confirmation Transmission sequence status (For Page 445 Intelligent (255H) (265H) confirmation of MC protocol communication function module communication status) monitor result 0: Waiting for receiving command message 1: Receiving command message 2: Command message reception complete 3: Waiting to access CPU module...
  • Page 510 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi 6912 to 6952 For user For registration No. 8001H The user registration area is used Page 161 Buffer (1B00H to 1B28H) registration together for the following usage, with memory data written by the user according to 6953 to 6993...
  • Page 511 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi 7814 to 7854 For user For registration No. 8017H The user registration area is used Page 161 Buffer (1E86H to 1EAEH) registration together for the following usage, with memory data written by the user according to 7855 to 7895...
  • Page 512 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi 8210 8466 For designation Transmission control start free space Page 237 C24 DTR (2012H) (2112H) of transmission designation control contents and control 64 to 4095: transmission control start free free OS area space specification...
  • Page 513 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  8256 8512 For designation Cycle time units designation Page 138 Settings for (2040H) (2140H) 0: 100 ms 1: s 2: min Using the programmable Programmable 8257 8513 Cycle time designation (programmable controller CPU Controller CPU...
  • Page 514 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  8277 8533 For designation 1st block monitoring device Page 138 Settings for (2055H) (2155H) Monitoring condition value designation Using the programmable • At bit device Programmable controller CPU 0: OFF 1: ON Controller CPU monitoring...
  • Page 515 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  8425 to 8681 to Use prohibited System area 8458 8703 (20E9H (21E9H 210AH) 21FFH)  8704 to 8960 to Use prohibited System area 8707 8963 (2200H to (2300H to 2203H) 2303H)
  • Page 516 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  9728 to 16383 For user User setting area 2 (6656 words) (2600H to 3FFFH) (Send/receive data monitoring function default buffer) Usage is determined by the user.  16384 16416 For designation...
  • Page 517 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  16518 Protocol setting Protocol No. Page 35 Packet (4086H) data error 1 to 128: Protocol No. elements information 65535: Unidentified Page 473 Error Code List 16519 Setting type (4087H) 0: Packet setting or element setting 1: Protocol detailed setting...
  • Page 518 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  16640 18432 For confirmation Number of stored protocol execution logs Page 113 Protocol (4100H) (4800H) of protocol 0: No log Execution Log execution 1 to 32: Number of stored logs Storage Function (for history Predefined Protocol...
  • Page 519 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  16682 18474 For confirmation Execution log 1 start time and date Page 113 Protocol (412AH) (482AH) of protocol 0: No log Execution Log execution Upper 8 bits: Month Storage Function (for history Lower 8 bits: Last 2 digits of year...
  • Page 520 Address Purpose Name Defaul Protocol Reference Dec (Hex) t value Non Bi  20224 to 20231 Error address Stores the buffer memory address of which Page 448 Error (4F00H to 4F07H) storage area parameter setting value is set outside the information clear range.
  • Page 521 Monitoring device areas for the programmable controller CPU monitoring function ■CH1 side buffer memory address: decimal (hexadecimal) N-th block monitoring device Name 8272 8281 8290 8299 8308 8317 8326 8335 8344 8353 Monitoring device designation (2050H) (2059H) (2062H) (206BH) (2074H) (207DH) (2086H) (208FH)
  • Page 522: Appendix 4 Dedicated Instructions

    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 (Instructions, Standard Functions/Function Blocks) Dedicated instruction list List of dedicated instruction The following table lists the dedicated instructions explained.
  • Page 523: Appendix 5 Operation Image And Data Structure Of Predefined Protocol

    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"...
  • Page 524 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. Receive data 1 Header Station No. 1 Predefined receive packet Target Receive data 2 Header Station...
  • Page 525 ■Error completion (receive wait timeout error) Error occurred Execute dedicated instruction module (G(P).CPRTCL) Completion device ON at error completion Status display device at completion (Receive buffer clear) * Only if it is specified t: Reception waiting time Verification mismatch Receive packet Receive packet Target device •...
  • Page 526 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.
  • Page 527 ■Error completion (receive wait timeout error) Error occurred Execute dedicated instruction module (G(P).CPRTCL) Completion device ON at abnormal completion Status display device at completion (Receive buffer clear) t: Reception waiting time * Only if it is specified Send packet Verification mismatch Send packet Receive packet Receive packet...
  • Page 528: Verification Operation Of Receive Packet

    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.
  • Page 529: Data Examples Of Packet Elements

    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. (Data flow) (Code type) (Data length) (Calculating range) Forward direction (upper byte lower →...
  • Page 530 ■Calculating range The following shows specification examples of the calculating range of Length. Packet Packet Packet Packet Packet Packet element 1 element 2 element 3 element n-2 element n-1 element n Packet Check code Header Length Static data Variable Terminator format Calculating range when specifying 1 to n Example 1...
  • Page 531 Non-conversion variable ■Processing procedure C24 processes non-conversion variable according to the following procedure. (Byte swap) (Fixed length/Variable length) (Data length/Maximum data length) (Unit of stored data) When "Byte swap" is ’Disable’ Unit of Lower byte + Upper byte Lower bytes only stored data (42h) (41h)
  • Page 532 ■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 Description Fixed length/Variable length Fixed length Data length 4 bytes Start address of data storage area...
  • Page 533 Conversion variable ■Processing procedure C24 processes conversion variable according to the following procedure. • When "Conversion" is 'HEX  ASCII hexadecimal' or 'ASCII hexadecimal  HEX' (Delimiter) (Number of digits) (Conversion) (Fixed number of data/ (Blank-padded character) Variable number of data) (Conversion unit) Digits are filled No delimiter...
  • Page 534 • For conversion "HEX  ASCII decimal", "ASCII decimal  HEX" (Delimiter) (Number of digits) (Number of decimals) (Sign) (Fixed number of data/ (Blank-padded character) (Sign character) Variable number of data) (Conversion) (Conversion unit) Bin → ASCII Digits are filled ASCII decimal(Unsigned) conversion of No delimiter...
  • Page 535 ■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...
  • Page 536 Check code ■Processing procedure C24 processes check code according to the following procedure. Calculates value according to the selection of "Processing method". 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. When "Code type"...
  • Page 537  Data flow: Forward direction • "No Complement Calculation" is designated (58H in hexadecimal is 88 in decimal) Code type Data length 1 byte 2 bytes 3 bytes 4 bytes ASCII hexadecimal "8" (38H) "58" (35H 38H) "058"(30H 35H 38H) "0058"...
  • Page 538  Data flow: Reverse direction • "No Complement Calculation" is designated (58H in hexadecimal is 88 in decimal) Code type Data length 1 byte 2 bytes 3 bytes 4 bytes ASCII hexadecimal  "85" (38H 35H) "850" (38H 35H 30H) "8500"...
  • Page 539  Data Flow: Byte swap • "No Complement Calculation" is designated (58H in hexadecimal is 88 in decimal) Code type Data length 1 byte 2 bytes 3 bytes 4 bytes ASCII hexadecimal    "0085" (30H 30H 38H 35H) ...
  • Page 540 ■Calculation procedure for sum check The following show procedures for calculating sum check codes using the following sample data. “R” “J” “7” “1” “C” “2” “4” check Calculating range For the data shown above Sum check value=52H+4AH+37H+31H+43H+32H+34H+03H=1B0H  Data flow: Forward direction •...
  • Page 541  Data flow: Reverse direction • "No Complement Calculation" is designated (1B0H in hexadecimal is 432 in decimal) Code type Data length 1 byte 2 bytes 3 bytes 4 bytes ASCII hexadecimal  "0B" (30H 42H) "0B1" (30H 42H 31H) "0B10"...
  • Page 542  Data Flow: Byte Swap • "No Complement Calculation" is designated (1B0H in hexadecimal is 432 in decimal) Code type Data length 1 byte 2 bytes 3 bytes 4 bytes ASCII hexadecimal    "100B" (31H 30H 30H 42H) ...
  • Page 543 The calculation example of 16-bit CRC (for MODBUS) Packet example: Station number Function code 16-bit CRC Calculation method of 16-bit CRC (for MODBUS) for the above packet example CRC error checking procedure 16-bit register (MSB) Flag Calculating procedure (Load a 16-bit register whose bits are all '1') 1111 1111 1111 1111 1 to 2...
  • Page 544 ■Check code calculation range The following shows specification examples of the check code calculation code. Packet Packet Packet Packet Packet element 1 element 2 element n-2 element n-1 element n Packet Non-conversion Header Static data Terminator Check code format variable Calculating range when specifying 1 to (n-1) Example 1 Calculating range when specifying 2 to (n-1)
  • Page 545: Appendix 6 Processing Time

    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.
  • Page 546 ■INPUT instruction Tp = Sr+0.09  Dr+T2 : 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) : Scan time : Number of bytes of reception data : C24 T2=6.3 *1 This indicates the range of processing time (Tp).
  • Page 547: Appendix 7 When Connecting The Module To A Remote Head Module

    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 programs •...
  • Page 548: Communication Example

    Communication example This section describes the communication example for when connecting the C24 to a remote head module. System configuration example Device configuration Network Protocol  R04CPU RJ71GF11-T2 CC-Link IE Field Network   RJ72GF15-T2 CC-Link IE Field Network RJ71C24 ...
  • Page 549 Communication procedure The following shows the procedure to send/receive data. ■Data communication using the predefined protocol  Writes the send data to the link register (W) of CPU module to store the send data in the data storage area set in the packet setting of the predefined protocol support function.
  • Page 550 ■Data communication using the nonprocedural or bidirectional protocol • Receiving procedure  Checks the data reception from an external device by 'CH1 reception data read request' (X3).  The data received from the external device is transferred from the buffer memory of C24 to the device of the remote head module by refresh (remote head module ...
  • Page 551 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. Set the CPU module as follows. [Project]  [New] Click the [OK] button to add the module labels of the CPU module. Set the CC-Link IE Field Network master/local module as follows.
  • Page 552 Click the [OK] button to add the module labels of the CC-Link IE Field Network master/local module. Set the items in "Required Settings" of "Module Parameter" as follows. [Navigation window]  [Parameter]  [Module Information]  [RJ71GF11-T2]  [Module Parameter]  [Required Settings] Set the network configuration as follows.
  • Page 553 Set the refresh settings as follows. [Navigation window]  [Parameter]  [Module Information]  [RJ71GF11-T2]  [Module Parameter]  [Basic Settings]  [Refresh Setting] 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.
  • Page 554 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. Set the remote head module as follows. [Project] ...
  • Page 555 Click the [OK] button. Set parameters of C24 according to the protocol to be used. Page 554 Program example of predefined protocol Page 559 Program example of nonprocedural protocol or bidirectional protocol APPENDICES APPENDIX Appendix 7 When Connecting the Module to a Remote Head Module...
  • Page 556 Program example of predefined protocol The following shows the program examples to connect an external device (temperature controller) to the CH2 of C24, and to execute the predefined protocol. ■Module parameter setting of C24 Set the items in "Basic Settings" of "Module Parameter" as follows. [Navigation window] ...
  • Page 557 Select [File]  [New] on the "Predefined Protocol Support Function" screen. Select [Edit]  [Add Protocol] on the "Protocol Setting" screen. Select "Predefined Protocol Library" in "Type" on the "Add Protocol" screen, and select the protocol to be used in "Protocol to Add".
  • Page 558 Click the "Variable unset error" cell on the "Packet Setting" screen Enter 'W0' to "Send Data Storage Area" on the "Element Setting" screen. 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).
  • Page 559 ■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 Label name Description Device Module label GF11_1.bSts_DataLinkError Data link error status of own station SB0049 GF11_1.bnSts_DataLinkError_Station[1] Data link status of each station (station...
  • Page 560 (6) Sets the send data and writes the number of continuous protocol executions and the protocol number to be executed to the buffer memory of C24 by 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 C24 by the REMFR instruction when the execution of the predefined protocol completes.
  • Page 561 Program example of nonprocedural protocol or bidirectional protocol The following shows the program examples to connect an external device (personal computer) to the CH1 of C24, and to send/receive data by using the nonprocedural protocol or bidirectional protocol with input/output signals. ■Module parameter setting of C24 Set the items in "Basic Settings"...
  • Page 562 ■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 Label name Description Device Module label GF11_1.bSts_DataLinkError Data link error status of own station SB0049 GF11_1.bnSts_DataLinkError_Station[1] Data link status of each station (station...
  • Page 563 (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.) APPENDICES APPENDIX Appendix 7 When Connecting the Module to a Remote Head Module...
  • Page 564 ■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 Label name Description Device Module label GF11_1.bSts_DataLinkError Data link error status of own station SB0049 GF11_1.bnSts_DataLinkError_Station[1] Data link status of each station (station...
  • Page 565 (6) Sets the send data and issues the send request. (32) Performs the processing when the send processing completes normally. (35) Performs the processing when the send processing completes abnormally. APPENDICES APPENDIX Appendix 7 When Connecting the Module to a Remote Head Module...
  • Page 566: Appendix 8 Added And Changed Functions

    Appendix 8 Added and Changed Functions This section shows the added and changed functions of C24. Added/changed contents Firmware version Reference  A remote head module redundant system is supported. '07' or later APPENDICES APPENDIX Appendix 8 Added and Changed Functions...
  • Page 567: Index

    INDEX 0 to 9 ......24 ......403 1C frame Echo back .
  • Page 568 ......434 Modem initialization DR (DSR) signal Refresh setting ....164 .
  • Page 569 ......251 Variable data ....424 Various control specification .
  • Page 570: Revisions

    Japanese manual number: SH-081249-E This manual confers no industrial property 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.
  • Page 571: Warranty

    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.
  • Page 572: Trademarks

    TRADEMARKS Ethernet is a registered trademark of Fuji Xerox Corporation in Japan. 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.
  • Page 574 SH(NA)-081251ENG-E(1612)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.

Table of Contents