Q Corresponding Serial Communication Module U User's Manual (Application) Q Corresponding Serial Communication Module User's Manual (Application) Q Corresponding Serial Communication Module User's Manual (Application) MODEL QJ71C24-U-OU-E MODEL CODE 13JL87 SH(NA)-080007-D(0301)MEE HEAD OFFICE : 1-8-12, OFFICE TOWER Z 14F HARUMI CHUO-KU 104-6212,JAPAN NAGOYA WORKS : 1-14 , YADA-MINAMI 5 , HIGASHI-KU, NAGOYA , JAPAN When exported from Japan, this manual does not require application to the Ministry
• SAFETY PRECAUTIONS • (Always read these instructions before using this equipment.) Before using this product, please read this manual and the relevant manuals introduced in this manual carefully and pay full attention to safety to handle the product correctly. The instructions given in this manual are concerned with this product. For the safety instructions of the programmable controller system, please read the user's manual for the PLC module to use.
[Design Precautions] ! CAUTION • Do not bunch the control wires or communication cables with the main circuit or power wires, or install them close to each other. They should be installed 100mm(3.9inch) or more from each other. Not doing so could result in noise that may cause malfunction. • When using the module while values, such as buffer memory set values, are registered in the Flash ROM, do not turn off the power supply for the module loading station nor reset the PLC CPU.
[Wiring Precautions] ! CAUTION • When turning on the power and operating the module after installation and wiring are completed, always attach the terminal cover that comes with the product. There is a risk of electric shock if the terminal cover is not attached. • Perform correct pressure-displacement, crimp-contact or soldering for external wire connections using the tools specified by the manufactures. Incorrect connection may cause short circuits, fire, or malfunction.
[Starting and Maintenance Precautions] ! CAUTION • Do not disassemble or modify each module. Doing so could cause failure, malfunction injury or fire. • Switch all phases of the external power supply off when mounting or removing the module. Not doing so may cause failure or malfunction of the module. • Do not touch the connector while the power is on. Doing so may cause malfunction.
REVISIONS The manual number is given on the bottom left of the back cover. Print Date Dec., 1999 Oct., 2000 Manual Number Revision SH (NA)-080007-A First Printing SH (NA)-080007-B Add the contents of the function version B. ® Put Windows base software products together from Mitsubishi Programmable Logic Controller MELSEC series to Mitsubishi integrated FA software MELSOFT series. Standardize the name from software package (GPP function) to product name (GX Developer).
REVISIONS The manual number is given on the bottom left of the back cover. Print Date Sep., 2004 Manual Number SH(NA)-080007-G Revision Correction Section 1.2, Section 6.1, Section 9.1.1 Addition Section 17.8 Japanese Manual Version SH-080002-J This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses.
INTRODUCTION Thank you for purchasing the MELSEC-Q series PLC. Before using the equipment, please read this manual carefully to develop full familiarity with the functions and performance of the Q series PLC you have purchased, so as to ensure correct use. Please forward a copy of this manual to the end user. CONTENTS (This manual) SAFETY PRECAUTIONS..............................................................................................................................A- 1 REVISIONS ...................
3.3.4 Compatibility with the callback function........................................................................................... 3-22 3.3.5 I/O signals with the PLC CPU.......................................................................................................... 3-31 3.3.6 Buffer memory.................................................................................................................................. 3-33 3.3.7 Precautions when using the modem function ....................
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION 9- 1 to 9-20 9.1 User Frame Types and Contents During Communication .................................................................... 9- 1 9.1.1 User frames to be registered and used by the user........................................................................ 9- 1 9.1.2 Default registration frame (read only) .............................................................................................. 9- 9 9.
.4.1 Example of data reception ........................................................................................................... 12- 9 12.4.2 Example of data transmission...................................................................................................... 12-11 12.5 Handling Transparent Codes and Additional Codes During Bidirectional Protocol Data Communication .......................................................................................................................
16.1.2 Communication data monitoring operation ................................................................................. 16- 2 16.2 Communication Data Monitoring Function Settings .......................................................................... 16- 4 16.3 Communication Data Monitoring Example......................................................................................... 16- 8 17 DEDICATED INSTRUCTIONS 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.
(Related Manual-1) … Q Corresponding Serial Communication Module User's Manual (Basic) SH-080006-H 1 OVERVIEW 1.1 Overview of the Serial Communication Module 1.2 Features of the Serial Communication Module 1.3 About Added/Changed Functions in Function Version B 2 SYSTEM CONFIGURATION AND AVAILABLE FUNCTIONS 2.1 Applicable Systems 2.2 Combinations of PLC CPU and External Device, and Available Functions 2.3 For Use in Multiple CPU System 2.4 For Use with Q00J/Q00/Q01CPU 2.
(Related Manual-2) … Q Corresponding MELSEC Communication Protocol Reference Manual SH-080008-F 1 OVERVIEW 1.1 Overview of the MELSEC Communication Protocol 1.2 Features of the MELSEC Communication Protocol 2 DATA COMMUNICATION USING THE MELSEC COMMUNICATION PROTOCOL 2.1 Types and Applications of Data Communication Frames 2.2 Accessible Range of Each Data Communication Frames 2.3 How to Read the Control Procedures of the MC Protocol 2.4 Access Timing of the PLC CPU Side 2.
About the Manuals The following manuals are available for this product. Please order the desired manuals using the chart below.
The Manual's Use and Structure How to use this manual This manual describes the use of special functions for the Q series C24 (QJ71C24N, QJ71C24N-R2, QJ71C24N-R4, QJ71C24, QJ71C24-R2), with each chapter covering a specific function. Please read this manual and use the contents below as a reference. (1) To read an overview of special functions • An overview of the major special functions is describes in Chapter 1.
(8) To use the function that performs the data communication in ASCII code with the external device • Chapter 13 describes the handling of binary code on the PLC CPU and ASCIIBIN conversion function for communicating ASCII code data for an external device. (9) To use dedicated instructions • Chapter 17 describes the dedicated instructions that are used to execute the functions explained in this manual.
About the Generic Terms and Abbreviations This manual uses the following generic terms and abbreviations to describe the Q series C24 unless otherwise specified. (1) Generic terms and abbreviations In this manual, the following generic terms and abbreviations are used to indicate the PLC CPU and the Q series C24 used for the data-communication functions of the serial communication modules. The model names of serial communication modules are used to identify the specific models.
(2) Other generic terms and abbreviations This manual uses the following generic terms and abbreviations to explain the data-communication devices for the Q series C24. The names/model names are provided when it is necessary to explicitly identify the model being discussed.
Definitions and Descriptions of Terminology The following table lists the definitions and descriptions of terminology used in this manual and related manuals for the Q series C24. Terminology Description One of the message formats for the serial communication modules for performing communication using the MC protocol and ASCII code data. This is the same message format as when communicating using the protocol for the A series A compatible 1C frame (Formats 1 to 4) computer link modules.
Terminology QnA compatible 4C frame User frame A - 20 Description One of the message formats for the serial communication modules for performing communication using the MC protocol and binary code data. This is the same message format as the communication frame using the protocol for the QnA (Format 5) series serial communication modules. • QnA compatible 4C frame (Format 5): QnA extension frame (Format 5) Details are explained in Chapter 3 of the Reference Manual.
MEMO A - 21 A - 21
1 OVERVIEW MELSEC-Q 1 OVERVIEW 1 1.1 Overview This manual explains special functions of the MELSEC-Q series C24. When applying the following program examples to the actual system, make sure to examine the applicability and confirm that it will not cause system control problems. This chapter provides an overview of these special functions. The primary special functions of the Q series C24 and a functional overview are indicated below.
1 OVERVIEW MELSEC-Q (2) Communicating with the external device at a remote location via a modem (detailed explanation in Chapter 3) 1) Connecting a modem or TA (terminal adapter) to the RS-232 interface facilitates communication via a public line/private line/digital line (ISDN), such as data communication with a device at a remote location (listed below) and calling a pager device.
1 OVERVIEW MELSEC-Q (3) Receiving data with an interrupt program (detailed explanation in Chapter 4) 1) In data communication between the Q series C24 and the external device, data can be received using an interrupt program with the following data communication functions. • Data reception during communication using the non procedure protocol • Data reception during communication using the bidirectional protocol 2) Receiving data using an interrupt program expedites data reception by the PLC CPU.
1 OVERVIEW MELSEC-Q (5) Converting binary code data to ASCII code data to communicate with the external device specification (detailed explanation in Chapter 13) 1) Binary code data that is processed by the PLC CPU can be converted to ASCII code data for communication. 2) ASCII-BIN conversion is performed by the Q series C24 according to user settings.
1 OVERVIEW MELSEC-Q The following table shows which special functions are available for the main data communication functions of the Q series C24.
1 OVERVIEW MELSEC-Q 1.2 Functions Added/Changed by Function Version B Of the special functions for the Q series C24 described in this manual, functions added/changed in the Q series C24 of the function version B and communication functions that can use those functions are listed below. See Section 2.6 for the function version, serial NO. and software version of products (CPU module, GX Developer, GX Configurator-SC) related to the Q Series C24 which can use added/changed functions. See Appendix 1.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2 USING THE PLC CPU MONITORING FUNCTION This chapter explains the PLC CPU monitoring function with which the Q series C24 monitors the PLC CPU based on the monitoring information reregistered by the user. 2.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (3) Notification of an error in the PLC CPU In the condition agreement transmission and notification, error information can be sent to the external device without a sequence program whenever a PLC CPU error occurs. Q25HCPU MELSEC POWER MODE RUN QJ71C24 External device CH2. CH1. ERR. CH1. USER 2 BAT. BOOT CPU error information RS-232 Monitoring device information CH.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2.2 About the PLC CPU Monitoring Function This section explains the PLC CPU monitoring function. 2.2.1 Data registration for using the PLC CPU monitoring function The following explains the data registration by the user to use the PLC CPU monitoring function. (1) PLC CPU monitor registration for the Q series C24 that is required to use the PLC CPU monitoring function is described in the following sections.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (Example1) For a block in which 10 points of word devices from D100 to D109 are registered Monitoring target: Numeric value stored in D100 Data transmitted: Numeric values stored in D100 to D109 (Example2) For a block in which two points of bit devices from M100 to M131 are registered Monitoring target: ON/OFF status of M100 Data transmitted: ON/OFF status of M100 to M131 (4) The word and bit devices that can be designated as the monitoring targets and the
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2.2.3 Timing for PLC CPU monitoring The following explains the timing for PLC CPU monitoring when the PLC CPU monitoring function is executed. (1) PLC CPU monitoring using the Q series C24 is performed continuously at cycle time intervals registered by the user. (2) Values from 1 to 65535 (unit: 100ms/s/min) can be registered as the cycle time. Use the following expressions as a reference when registering the cycle time.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (3) To monitor the PLC CPU, the Q series C24 reads monitoring information (device information, PLC CPU status information) from the PLC CPU at time intervals set by the user. POINT (1) Since the Q series C24 reads the monitoring information (device data, PLC CPU status) at the time of the next PLC CPU END process after the cycle time elapses, make the cycle time as long as possible. (2) The following should be considered if the cycle time is short.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (2) Condition agreement transmission (a) 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 PLC CPU are compared. The monitoring results are sent or notified when there is a block where the monitoring conditions match.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (c) In the condition agreement transmission for device monitoring, the head device for each block is the monitoring target for condition monitoring of each block device. For the condition agreement transmission, 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 shown in the table below.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2.2.5 Transmission methods of monitoring results and transmission data to the external device The following explain the method of transmitting the PLC CPU monitoring results and data to the external device.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (d) When sending the monitoring results as data during condition agreement transmission, head data (header) and end data (footer) for the on-demand function are added to the device information for a block with matched monitoring conditions and the PLC CPU status information upon the occurrence of an error. The header and footer are added to each clock, and then the monitoring result data is transmitted.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (c) When sending the monitoring results as data during condition agreement transmission, the device information of two or more user frame No. and PLC CPU status information that have been currently designated by the Q series C24 for the condition agreement transmission of the block where the monitoring conditions match are transmitted in batch mode.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (f) Device information and PLC CPU status information are sent using the data arrangement shown below. The ASCII-BIN conversion designation is designated in buffer memory address 121H/1C1H. Note that when the user frame has been designated by setting to on the value for bit 14, which indicates the user frame No., there will be ASCII-BIN conversion of corresponding send data. It will be sent as binary data. (See Section 13.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q • When data for bit device (M16 to M175, (10 point)) is sent When the word/device unit designation is word unit, the device data will be sent in a (H) (L) sequence. The number of registered points is the number of points in word units. (When ASCII-BIN conversion is not performed) The total number of bytes for the device data section is the number of device points 2.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2) When user frame No.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 4) When user frame No. B081H is designated Information on monitoring results for all blocks are sent as follows: Results are sent in the following order: the device information registered in the word block, the device information registered in the bit block and then PLC CPU status information.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q L H 0 0 0 1 0 L H 0 0 0 0 L L 4 0 0 0 H L 0 0 1 0 H L 0 0 2 0 H L 0 0 3 0 H H 0 M L H 0 0 0 0 0 L H 0 0 0 0 Device data Number of registered points Monitoring head device Device code Number of registered points Monitoring head device Device code H W Device data (When ASCII-BIN conversion is performed) The total number of bytes for the device data section is the number of device points 4.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 5) When user frame No. B082H is designated Information on the monitoring results for the condition agreement blocks are sent for each block. Results are sent in the following order: The PLC CPU status information, the device information registered in the word block and then the device information registered in the bit block.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (When ASCII-BIN conversion is performed) The total number of bytes for the device data section is the number of device points 4.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (3) Notification to the interface side using the modem function (a) The notification message (text string data) contained in the user registered data for connecting the modem function is conveyed using the modem function. The device information and the CPU status information read from the PLC CPU are not sent to the external device in the notification message.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2.2.6 Execution sequence for using the PLC CPU monitoring function The following explains the execution sequence for using the PLC CPU monitoring function. (1) When transmitting the monitoring results through data transmission/notification messages using the modem function, perform the following settings in order to use the modem function. Setting item Initial setting using the GX Configurator-SC Registration of data No. for initialization and data No.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2.3 Settings for Using the PLC CPU Monitoring Function This section describes system settings required for constant cycle transmission and condition agreement transmission. 2.3.1 System setting items for the PLC CPU monitoring function The following explains system setting items for the PLC CPU monitoring function. POINT The PLC CPU monitoring function setting screens from the GX Configurator-SC are shown.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (2) Setting items and requirement when performing communication using the non procedure protocol Constant cycle transmission Setting item Cycle time units Cycle time PLC CPU monitoring function PLC CPU monitoring transmission measure Constant cycle transmission Transmission pointer Output count Data transmission Notification (1H: Constant cycle) (Data) (Notification) Condition agreement transmission Data Notification transmission Reference section (3
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (3) Contents of setting items The data items to be set by the GX Configurator-SC in order to use the PLC CPU monitoring function and the setting contents are explained below. (a) Cycle time units • Designates the unit for "(b) cycle time" below for reading information from the PLC CPU using the PLC CPU monitoring function.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (g) Monitoring device, head device No., read point (Number of registered points) When performing device data monitoring or transmission, designate the device range for each block for the number of blocks designated by setting item (e), number of registered word blocks and number of registered bit blocks. The target of device data monitoring for condition agreement transmission is the head device for each block.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (4) The following is an example of setting items and data transmission when sending the monitoring results of the PLC CPU monitoring function execution to the external device using the non procedure protocol. (Example) This example shows a case in which the D0 to D3 device information and user frame data are sent by the edge trigger method using a condition of D0 = 0.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2.3.2 How to register and cancel the PLC CPU monitoring function The following describes the method for registering and canceling the PLC CPU monitoring function from the PLC CPU. POINT (1) For details on the method for registering and canceling the PLC CPU monitoring function with the GX Configurator-SC, see Section 8.4.9 of the User's Manual (Basic).
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (a) Example of a program for performing PLC CPU monitoring registration This example shows a program that registers PLC CPU monitoring for the CH1 side interface. This registration is for transmitting the contents of M0 to M15 and D100 to D109 to the external device using constant cycle transmission (cycle time is 3 min).
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q 2.4 Precautionary Notes for Using the PLC CPU Monitoring Function (1) The cycle time will be affected by the following factors. Keep these in mind when setting the cycle time. 1) When the PLC CPU is accessed by a module other than the Q series C24. 2) When a data communication function other than the PLC CPU monitoring function is used. 3) When transmission stops by DTR/DSR control.
2 USING THE PLC CPU MONITORING FUNCTION MELSEC-Q (9) When transmitting the monitoring information as data using the modem function, a modem connection error will occur if a modem connection is requested for the following reasons. • A connection request by Y11 • A notification-issued request by Y14 If possible, provide a dedicated Q series C24 for using the PLC CPU monitoring function.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3 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 external devices and paging pager terminals. 3.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.1.1 Features The following explains the features of the modem function. (1) Interface that can use the modem function 1) The modem function can be used with the Q series C24 using an RS-232 interface. 2) For the QJ71C24(N)-R2, the modem function can only be used by one of the two existing RS-232 interfaces.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (4) Notification to the pager receiver 1) In order to notify to the pager receiver of the PLC system maintenance information, the Q series C24 performs calling and message transmission according to the user-designated connection data when the output signal from PLC CPU is turned from ON to OFF.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (6) Remote password check If the remote password check has been set for the Q series C24 installed in the QCPU, the Q series C24 executes a remote password check when the PLC is accessed from an external device using the Q series C24 modem function. The following is an overview of the QCPU remote password function. See Section 3.3.3 for more details.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.1.2 Function list The following describes the overview of the modem function: Function Modem/TA initialization Overview Initializes the modem/TA using the user-designated initialization data (AT command). (Auto initialization of the modem / TA is possible.) Dials the partner telephone number according to the user-designated connection data and Line connection (dialing) enables data communication after establishing the line connection.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.1.3 Comparisons with related devices The following shows a comparison with the related products which supports data communication with the PLC using the modem and public line, etc., similarly to the communication performed via the modem function.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.2 System Configuration This section describes system configurations when the modem function is used to call a pager receiver or to perform data communication with an external device via public lines. 3.2.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.2.2 System configuration when using the notification function The following describes the system configuration example when calling the pager receiver by the notification function. Q25HCPU MODE QJ71C24-R2 CH1. CH2. RUN ERR. USER BAT. BOOT Modem CH1. RS-232 cable USB Public line Pager receiver CH2. RS-232 The public line indicated above is compatible with the office telephone system as well.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.2.3 System configuration when connecting GX Developer The following describes the system configuration when GX Developer performs data communication with a remote station PLC via Q series C24. Q25HCPU MODE GX Developer QJ71C24-R2 CH1. CH2. RUN ERR. USER BAT. BOOT Modem CH1. RS-232 cable USB Public line Modem RS-232 cable CH2. RS-232 The above public lines is compatible with the office telephone system as well.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.2.4 Precautions for system configurations The following describes the precautionary items when configuring the system to perform data communication with an external device or call a pager receiver via public line, an office telephone system or digital line (ISDN) using the Q series C24 modem function. (1) Usable Q series C24 interface 1) The modem function can be used with the RS-232 interface only.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (5) Modem/TA installation 1) Install the modem/TA according to the modem/TA manual. When installed in an area in which a lot of noises exists, malfunctions may occur. 2) In order to prevent the effects of noise and power surges, do not connect near or tie the cable together with a main circuit line, high-voltage line or load line other than for the PLC with the modem/TA connection cable.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.3 Specifications This section explains the transmission specification on the Q series C24 side, connectable modems/TA's (terminal adapter), I/O signals related to the modem function, and buffer memory for the usage of the modem function. 3.3.1 Transmission specifications The transmission specifications on the Q series C24 side for use of the modem function are as shown below.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.3.2 Specification of connectable modems/terminal adapters The specification of modems/TA's that can be connected to the Q series C24 side when using the modem function is shown below.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 1) The modem transmits data to the partner by storing the data from the terminal in the modem buffer. 2) When the buffer in the modem becomes almost full, the modem outputs a data-transmission temporary stop request (CS signal = OFF) to the terminal. The terminal then stops data transmission to the modem when the data-transmission temporary stop request (CS signal = OFF) is received.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (2) Specification and precautions for the connectable TA's (terminal adapters) (a) TA specification Item Specification Remarks ISDN (INS net 64) equivalent High-speed digital dedicated line DSU and TA are required Initialization Hayes AT command compatible See Section 3.4.3 Communication standard B-channel line exchange (V.110) D-channel packet exchange Connection line TA-to-TA communication specification Electrical condition V.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.3.3 Compatibility with the QCPU remote password function This section explains the Q series C24 data communication for the QCPU remote password function. See Section 3.1.1 (6) for an overview of the Q series C24 check function for the QCPU remote password. The remote password function is a function that has been added to the QCPU as a means of preventing improper access (such as destroying a program or data) from an external device.
3 COMMUNICATIONS BY THE MODEM FUNCTION (When accessing other station QCPU) (When accessing the local station QCPU) 1) Unlock processing A station ( 1) Modem Modem 2) Access Remote password QCPU MELSEC-Q 1) Unlock processing Modem Modem 3) Lock processing ( 2) 3) Lock processing ( 2) Remote password check (Local station) Q series C24 A station ( 1) Remote password QCPU Remote password check Q series C24 ( 3) Ethernet module (Local station) Ethernet 1 Unlock and lock processing for the
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (2) Remote password check processing performed by the Q series C24 (a) Communication in which a remote password check is performed 1) When the following parameters are set for the Q series C24 installed in the QCPU station, the Q series C24 performs a remote password check for communication requests listed below.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (c) Stations that can be accessed when the remote password check is performed 1) If the external device performs the remote password unlock processing with respect to the Q series C24 of the directly connected station (local station) after line connection for the modem function, it can access the local station QCPU.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (4) How to set the remote password On the screen below for setting parameters (remote password) using the GX Developer, set the remote password in the QCPU and specify the Q series C24 that performs the check. Set the remote password as the following instructions.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (5) Setting from the GX Configurator-SC When the Q series C24 performs a remote password check for the remote password set in the QCPU, the remote password check setting as well as the present check results can be monitored with respect to the screen items listed in the table below. See Section 3.3.6 for an explanation of each area.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.3.4 Compatibility with the callback function The following describes the Q Series C24 callback function that can be used when accessing the QCPU from the GX Developer connected to the Q Series C24. (1) About the Callback function (a) What is the Callback function The callback function is a function that makes it possible to access the QCPU from the GX Developer by reconnection (callback) of the line from the Q Series C24.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (2) Data communications procedure Here, the procedure for data communications when using the callback function is shown. (a) Q series C24 side procedure Carry out procedure of starting the modem function and data communications in accordance with Section 3.4.1. 1) Set the callback function by the GX Configurator-SC. (See (4).) 2) Initialize the Q Series C24 side modem. (See Section 3.4.
3 COMMUNICATIONS BY THE MODEM FUNCTION (d) If callback processing was not executed normally, an error message screen is displayed on the GX Developer side. Perform the processing operation (reconnection operation, etc.) corresponding to the displayed message. The operating state on the Q Series C24 side can be confirmed by the following items in the GX Configurator-SC monitor/test screen.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (4) Setting and monitoring by the GX Configurator-SC for use of the callback function (a) Setting, monitoring / test items Carry out setting, monitoring and testing of the callback function using the following GX Configurator-SC screen. 1) Setting items through the "modem function system setting" screen This shows the callback function setting items. See Section 3.3.6 for the modem function setting items, including the following items.
3 COMMUNICATIONS BY THE MODEM FUNCTION (b) MELSEC-Q Callback function designation and callback operation outline Here the setting values for "Callback function designation" items in the "Modem function system setting" screen and an outline of the corresponding Q Series C24 callback operation are explained. Values in parentheses are values when the set values are stored in buffer memory (Address: 2001H).
3 COMMUNICATIONS BY THE MODEM FUNCTION 3) MELSEC-Q If it is being made possible to change the callback destination GX Developer (Setting 2 (BH) or Setting 5 (3H)) • Select the callback destination telephone No. if it is being specified at the time when line connections are being made from the initial GX Developer side. • The Q Series C24 calls back the GX Developer with the callback destination telephone No. received from the GX Developer side.
3 COMMUNICATIONS BY THE MODEM FUNCTION 4) MELSEC-Q If the maximum number of callback destination GX Developer is limited to 10 modules. (Setting 3 (FH) or Setting 6 (7H)) • Select the GX Developer to be called back if the Q Series C24 limits the callback destination to a maximum of 10 modules. • Specify the callback destination telephone No. when making line connection from the initial GX Developer side. • If the Q Series C24 checks the callback destination telephone No.
3 COMMUNICATIONS BY THE MODEM FUNCTION 5) MELSEC-Q If line connections from the GX Developer are made with "Auto (Callback: during fixed/Callback: during designated number)" as the connection system (Setting 1 (9H) to Setting 3 (FH)) • When accessing the QCPU from the GX Developer, select whether to use the callback function to make line connections or to make line connections without using the callback function.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q REMARK If the GX Configurator-SC’s "Callback function designation" setting is performed in the Q Series C24, line connections to the GX Developer are possible by the connection system shown below. The correspondence between the GX Configurator-SC "Callback function designation" setting items and the GX Developer connection system setting items is shown.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.3.5 I/O signals with the PLC CPU The I/O signals with the PLC CPU for the modem function are described. See Section 3.8 of User's Manual (Basic) for the I/O signals not related to the modem function.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (2) Function and description of each I/O signal I/O signal Signal name Function/description X10 Modem initialization completion Indicates normal completion of the Q series C24's initialization of the modem/TA connected to itself according to the initialization data designated. X11 Dial in progress Indicates that the Q series C24 is dialing (connection processing) the partner side according to the data for connection designated.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.3.6 Buffer memory The buffer memory (area shown with ) that can be used with modem function is described. See Section 3.9 for the buffer memory not related to the modem function. POINT The writing and reading of setting values to and from the buffer memory are performed using the special utility package ("GX Configurator-SC") of the Q series C24. Perform settings and monitoring according to Chapter 8 of the User's Manual (Basic).
3 COMMUNICATIONS BY THE MODEM FUNCTION Address Dec. (Hex.
3 COMMUNICATIONS BY THE MODEM FUNCTION Address Dec. (Hex.) CH1 CH2 Application 6912 to 6952 (1B00H to 1B28H) (For registration No. 8001H) : : For user registration 8142 to 8182 (1FCEH to 1FF6H) (For registration No. 801FH) 8183 to 8191 (1FF7H to 1FFFH) 8192 (2000H) Use prohibited 8201 (2009H) 0: No auto initialization 0: DR signal is not ignored.
3 COMMUNICATIONS BY THE MODEM FUNCTION Address Dec. (Hex.) CH1 CH2 Application 8207 (200FH) Use prohibited 8449 to 8458 (2101H to 210AH) For callback Function Name Data No.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (2) Details of the buffer memory (for modern function) (a) Modem connection channel designation area (address 46 (2EH)) The interface on the Q series C24 side to which a modem/TA is connected is designated. (b) Notification execution designation area (address 47 (2FH)) Whether or not to perform notification (message transmission) to the pager receiver during the fall of the notification-issued request signal Y14 is designated.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (g) Data number for initialization designation area (address 52 (34H)) 1) The registration number for the initialization data transmitted with the initialization request to the modem on the Q series C24 side is designated. The registration number for the Q series C24 is used. 2) For details on the designation using GX Configurator-SC, see Section 8.4.4 of the User's Manual (Basic). An example of designations using the program is shown in Section 3.4.5.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q REMARK The overview of the RS · CS controls are described. (1) When transmission data 1) The Q series C24 detects the modem/TA data reception capability from on/off of the CS signal. 2) When the CS signal is on, data transmission from the Q series C24 starts or continues. When the CS signal is off, data transmission from the Q series C24 is interrupted.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (n) Number of data registrations for connection storage area (address 547 (223H)) 1) Stores in Flash ROM the number of registered data for connection used by the Q series C24 for the connection processing with the partner device in order to perform data communication/notification. The number of registrations is the number of data for connection registered to the Flash ROM by the user. 2) The registration of data for connection is described in Section 3.4.4.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (r) Number of notification execution storage area (address 553 (229H)) 1) Stores the number of execution of the Q series C24 notification (message transmission) processing for the pager receiver. 2) The storage value when the number of notification execution exceeds 32767 remains at 32767. 3) The value for this area can be changed by the user in the range of 0 to 32767.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 2) In this area, the number of bytes for the initialization data or data for connection (for 1 data) to be registered to the buffer memory is designated. 3) The registration of data for initialization is described in Section 3.4.3. The registration of data for connection is described in Section 3.4.4.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (z) Circuit disconnect wait time designation area (PLC CPU watch use) (address 8206 (200EH)) 1) When sending data using the PLC CPU monitoring function, designates the time it takes to complete data transmission from the local station side modem to the external device after data transmission from the Q series C24 (wait time until the circuit is disconnected).
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (4) Details of buffer memory (for the callback function) The areas shown below are valid if the Q Series C24 uses the callback function. (a) Callback function designation area (Address 8193 (2001H)) 1) If communications are done by connecting to the GX Developer via a modem, specify whether the callback function is to be used or not. Also specify the callback operation in the case that the callback function is used.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 4) If the callback destination GX Developer is limited to a maximum of 10 modules, specify the connection data registration No. that specify the callback destination telephone No. for a maximum of 10 modules. • The external line dialing, line types and telephone number in callback data No. 1 become valid. • The telephone No. only becomes valid in callback data No. 2 to 10. The external line dialing and line types in the connection data for callback data No.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.3.7 Precautions when using the modem function Precautions when using the modem function to perform data communication with an external device via public line or call to the pager receiver are described.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (6) Initial Settings The connection data used for modem functions can be registered as follows using setting procedures. Set the telephone number and message within the permissible number of registration characters for modem/TA. 1) If registered using GX Configurator-SC • Comments can be set to a maximum of 256 bytes. (These are not used for control.) • Telephone numbers can be set to a maximum of 64 bytes. • Messages can be set to a maximum of 256 bytes.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (c) When the number of times remote password mismatch occurs is large 1) When the number of times notification of a remote password mismatch is received exceeds the number of times specified in buffer memory address 8204 (200CH), the Q Series C24 disconnects the line automatically. (The connection signal (X12) turns OFF.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (9) Number of modules for which the remote password check can be set A maximum of eight modules can be registered with remote passwords in the QCPU. 1 To set the remote password in a module, use the GX Developer remote password setting screen.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (11) Preventing a line disconnect when the GX Developer is connected Perform the following settings and operations to prevent a line to the modem from disconnecting even if communication between the GX Developer and PLC is interrupted. (a) Initial setting using the GX Configurator-SC (See Section 8.4.4 of User's Manual (Basic).
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (Example) When the number of times a remote password mismatch occurred exceeds the notification accumulated count setting value during the remote password unlock processing in communication using MC protocol with the Q series C24 CH1 side interface used.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4 Start-up of the Modem Function This section explains the start-up procedures, processing methods and programming when the modem function of the Q series C24 is to be used. 3.4.1 Start-up procedures when communicating data with external devices This section shows the procedure for starting the modem function and up to the point when data communications is started.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (2) Procedure when executing data communications indicates processing performed by the user. Line connection wait side Line Connection Side Q Series C24 Perform the processing up to the point where the modem/TA is initialized by the procedure in (1). Modem Modem Q Series C24 or External Device Perform the processing up to the point where the modem/TA is initialized by the procedure in (1).
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (3) If notification is made Pager receiver Modem indicates processing performed by the user. Q Series C24 (Line connection side) 0 1 (1) Perform the processing up to the point where the modem/TA is initialized by the procedure in (1). Modem initialization 2 Modem initialization completion signal (X10)=ON. 3 Line connection Line connection normally completed Notification-issued request signal (Y14)=OFF Notification (See Section 3.4.7.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4.2 Initial settings of the serial communication module This section explains the initial settings of the Q series C24 when data communicating with external device, remotely notifying a pager receiver and accessing from GX Developer using the modem function.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Bit Switch number Switch 1 Position Specified value b0 b1 OFF ON b2 OFF b3 OFF b4 OFF b5 ON b6 ON b7 ON b8 to b15 Description Operation setting Data bit CH1 transmission setting ― Setting value Independent 8 bits Parity bit No Odd/even parity Odd Stop bit 1 bit Sum check code Yes Write during RUN Setting modification Allowed Enable CH1 communication rate setting 07E2 19200 bps Switch 2 ― CH1 communication protocol setting
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 1) When the PLC CPU is stopped when the connected signal (X12) is at the ON status. This occurs because the program write after remote stop is enabled. 2) When the PLC CPU performs an error stop during self-diagnosis, etc. POINT When setting the No-communication interval time as infinite wait (set value = 0), be sure to perform line disconnection processing after the data has been communicated.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4.3 Register/read/delete of the initialization data The section explains the register/read/delete of the data for initialization such as initialization commands for the modem/TA connected to the Q series C24 side for data communication with the external device, pager receiver notification and accessing from GX Developer using the modem functions.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q When designating a registration number that has already been registered, first delete the registration data in the preoccupied registration number prior to registration. 4) When connecting the Q series C24 to an external device using a cellular phone and a modem, set the transmission rate supported by the cellular communication module on the modem side.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (6) Procedures for register/read/delete of the initialization data (a) For the Flash ROM in the Q series C24 1) Register/read/delete operations are executed on the GX ConfiguratorSC's "Data registration for modem initialization" screen. 2) Display and operate the screen according to Section 8.4.2 of the User's Manual (Basic). The factory setting of initialization data stored in the Flash ROM of the Q series C24 cannot be deleted.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (b) For the buffer memory of the Q series C24 1) The initialization data write (registration) and read operations are performed by designating an applicable area that corresponds to registration numbers 8001H to 801FH for the user frame registration area (addresses: 1B00H to 1FF6H). When deleting the initialization data, write "0" to the number of registration data bytes designation area.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 4) The following shows an example of a sequence program used to write the initialization data (registration).
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4.4 Register/read/delete of the data for connection This section explains the registration/reading/deletion of data for connection such as the telephone number of the partner device and notification messages that are used for communicating data with external devices, notify pager receivers and accessing from GX Developer using the modem functions.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (5) Procedures for register/read/delete of the data for connection (a) For the flash ROM in the Q series C24 1) Register/read/delete operations are executed on the GX ConfiguratorSC's "Data for modem connection" screen. 2) Display and operate the screen according to Section 8.4.3 of the User's Manual (Basic). 3) Set the required items with the table below.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (b) For the buffer memory of the Q series C24 1) The connection data write (registration) and read operations are performed by designating an applicable area that corresponds to registration numbers 8001H to 801FH for the user frame registration area (addresses: 1B00H to 1FF6H). When deleting the connection data, write "0" to the number of registration data bytes designation area.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (Data for connection area) … 44 bytes Data name Designated/stored value and contents Number of bytes Data type 2 Binary 18 ASCII 2 Binary 2 Binary 20 Binary Whether or not notification is performed, and the notification target module are designated. Pager receiver 0 : No notification designation 3 : Notification performed In the case of 3 above, the wait time for message transmission in the notification message must be designated.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (4) An example of a sequence program used for writing (registering) of data for connection is shown below. • Example of writing data for connection to the registration number 8002H area X1E: ready signal X1F: WDT error signal Turns the ready flag ON.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4.5 Initialization of modem/terminal adapter This section explains the initialization of the modem/TA connected to the Q series C24, used for communicating data with the external device, performing notifications to pager receivers and accessing from GX Developer using the modem function. (1) Requirements for initialization Perform the following setting and registration: 1) The Q series C24 initial settings as shown in Section 3.4.2.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 2) Output count designation area (address: 185/345 (B9H/159H)) The number of data for initialization units to be transmitted starting from the location set by the output head pointer designation area is designated here.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 2) When the line is disconnected from the Q Series C24 side (using Y12), the initialization completion signal (X10) goes off together with the connection in progress signal (X12). When connecting to the line again, do so after first initializing the modem. POINT When the line to the Q Series C24 is disconnected from the external device side, the Q Series C24’s initialization completion signal (X10) does not go OFF.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (b) Modem/TA initialization program example An example of the modem/TA initialization program on the Q series C24 side by the PLC CPU is shown below. When the initialization data has been registered from GX Configurator-SC or from the PLC CPU.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4.6 Line connection This section explains the connection (dialing) with the partner devices for the purpose of data communication with external devices using the modem functions. In case of notification to a pager receiver, the line is connected while the notification is being processed. The connection processing such as a connection request (Y11) to I/O signal is, therefore, unnecessary.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (3) I/O signals used in line connection Connection request signal (Y11), dial in progress signal (X11), connection in progress signal (X12) and initialization/connection abnormal completion signal (X13) are used.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (Example2) When performing the initialization and the line connection from the Q series C24 side simultaneously Buffer memory for initialization (See Section 3.4.5) Buffer memory for connection Address: 35H (53) 0 3000 Normal completion Connection request Y11 Initialization completion Y10 Dial in progress X11 Connection in progress X12 RS-232 CD terminal Set "Display a result code using the AT command" in the local station side modem.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (Example) When initiating the line connection from the partner device after the completion of initialization Buffer memory for connection Address: 35H (53) 0 Connection request Y11 Initialization completion Y10 Dial in progress X11 Connection in progress (OFF) (ON) (OFF) (Normal connection) X12 (Normal connection) RS-232 CD terminal Unlock processing for the remote password Reception Result code receive Password (for system) Set "Display a resu
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3) When reconnecting the line after disconnection, allow several seconds for the modem before turning on the Connection request (Y11). If it (Y11) is turned on immediately after line disconnection, the modem may not accept the first connection request, resulting in connection failure, and the user may be forced to wait for the retry time to elapse. (5) Line connection program example An example of a line connection program is shown below.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q • Example of simultaneous execution of initialization and line connection from the Q series C24 side When the initialization and connection data have been registered from the GX Configurator-SC or from the PLC CPU. X10 : Initialization complete signal X1E : Ready signal X1F : WDT error signal M0 : Accessible flag M1 : Data registration complete flag for initialization M2 : Data registration complete flag for connection See Section 3.4.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4.7 Data communication and notification This section explains the cautions for data communication with the partner device using modem function and procedures for notification to pager receivers.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q REMARK This section explains the general procedure for non procedure protocol/bidirectional protocol (executed in full-duplex communication) data communication using the modem function between the PLC CPU with Q series C24 installed. Station A Q25HCPU MODE RUN Station B QJ71C24-R2 CH1. Q25HCPU CH2. MODE RUN ERR. ERR. USER BAT. USER BAT. BOOT Modem CH1. CH2. BOOT Public line CH1. RS-232 cable USB QJ71C24-R2 CH1. Modem RS-232 cable CH2.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q b) When notifying to pager receiver 1) Initial setting by GX Configurator-SC Register the data number registration area for connection below in the "Modem function system setting" screen.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (Example 2) When abnormal completion Buffer memory for Q series C24 initial setting Notification execution 0 designation area 1 … (Address: 2FH (47)) Buffer memory for notification Data number designation area for connection (Address: 35H (53)) 0 3000 Modem function error code storage area (Address: 221H (545)) 0 (Error code) Notification execution data storage area (Address: 22AH (554)) …… 0 Initialization completion X10 (ON) Connection in pro
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (3) Precautions for performing data communication and notification a) When communicating data with the external device 1) When setting the no-communication interval time to infinite wait (set value=0) in the initial setting of Q series C24, be sure to perform line disconnection after the completion of data communication. 2) Only the no procedure protocol/bidirectional protocol data communication can be performed in the PLC CPU with Q series C24 installed.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (4) Program for notification example An example of program for notification is shown below. When the initialization and connection data have been registered from the GX Configurator-SC or from the PLC CPU. X10: Initialization complete signal X1E: Ready signal X1F: WDT error signal M0 : Accessible flag M2 : Data registration complete flag for connection See Section 3.4.4 M3 : Initialization complete flag M40: Notification enable flag Turns the ready flag ON.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.4.8 Line disconnection This section explains the line disconnection upon communication completion when communicating data with the external device using the modem functions. In case of notification to pager receivers, since the line will be disconnected at the end of the notification processing, the disconnection processing such as I/O signal disconnection request (Y12) is unnecessary.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q POINT (1) Line disconnection processing can be conducted from either device as long as the connection is in progress. (2) The line disconnection processing disconnects the line connection with the external device as well as the connection with the Q series C24 modem. (3) Even when an error occurs during the line disconnection, the disconnection processing will be forced.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (3) Program example for line disconnection A program example for line disconnection is shown below.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.5 Sample Programs This section shows sample programs to test the connection with the remote station's PLC CPU to which Q series C24 is installed. Each program contains a minimum set of processing necessary for performing a exchange test. Modify the data for initialization and data for connection to match each system environment. When adding error-handling procedures, add them separately by seeing the explanation in this chapter.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.5.1 Sample program for data communication-1 (1) Sample program system configuration The configuration of a system using this sample program is shown below.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Access possible Modem initialization, line connection possible Data communications possible Data transmission possible Line disconnect possible Conversion of modem initialization, line connection commands to pulses Modem initialization, line connection processing to sub routine Conversion of data communications (transmission) c
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q [Modem initialization, line connection processing] Set the connection request signal With the initialization completed signal ON and the connected signal ON, reset the request signal With the initialization/connection abnormally completed signal ON, read the error code and reset the request signal [Data transmission processing] Set the transmission data Set the transmission channel on CH1 Set the transmission data count Execute the transmission request
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q [Line disconnection processing] Modem disconnection request signal is set When the modem disconnection completion signal is ON, the error code is read. When the normal completion signal is ON, the line disconnection completion flag is set.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (3) Sample program for a connection receiving station side (QJ71C24R2 2)) After the connection in progress signal (x12) = ON, data communications are carried out by the non procedure protocol through a command from the user. Perform the following settings before running this program. (a) GX Developer switch settings (See Section 3.4.2.) (b) Switch No.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Access possible Data transmission possible Set the transmission data Set the transmission channel on CH1 Set the transmission data count Execute transmission request Transmission normally completed Transmission abnormally completed Set the data reception channel on CH1 Execute reading of receive data Reading of receive da
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.5.2 Sample program for data communication-2 (1) Sample program on the connection request station side Initialization for the modem connected to CH1 interface, line connection, data communication by the non procedure protocol and line disconnection are executed by commands from the user.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Accessible flag is turned ON Modem initialization enabled flag is turned ON Line connectable flag with the remote station is turned ON Exchangeable flag with the partner station is turned ON Data transmission enabled flag to the partner station turned ON Line disconnection enabled flag with the partner station is turned ON To the data registration processing for initialization subroutine To the data registration processing for connection subroutine Convert t
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Convert the reset command of various requestb signal into pulse To the various request signal and the complete signal OFF subroutine Output the various complete flag status (LED display) Data registration processing for initialization subroutine P1 • Set the number of bytes of the registration data • Set the user control data (control number) • Set the initialization command • Write the data for initialization (Data No.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Line connection processing subroutine • Connection request signal is set P4 • Connection requestr execution flag is set • When the connection in progress signal ON, the connection complete flag is set and the request signal is reset • When the initialization/connection abnormal complete signal ON, the error code is read and request signalis is reset Data communication processing subroutine (Non procedure protocol, transmission) P51 • Set the transmissio
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q • Received data read normally completed • Received data read abnormally completed Line disconnection processing subroutine (Line disconnection from local station) • Modem disconnection request signal is set • When the modem disconnection completion signal is ON, the error code is read. • When the normal completion signal is ON, the line disconnection completion flag is set.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q (2) Sample program on the connection reception station side The modem initialization and data communication by the non procedure protocol are executed by commands from the user. Before executing this program, perform the following settings (changing the default values) on the GX Configurator-SC's "Modem function system setting" screen and register them in the Q series C24. (Settings other than the items shown below are not required).
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Accessible flag is turned ON Modem initialization enabled flag is turned ON Exchangeable flag with the partner station is turned ON Data transmission enabled flag to the partner station turned ON To the data registration processing for initialization subroutine Convert the initialization command into pulse Various complete flags after the modem initialization processing is reset To the modem initialization processing subroutine Convert the data communicatio
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Data registration processing for initialization subroutine • Sets the number of bytes of the registration data P1 • Sets the user control data (control number) • Sets the initialization command • Write the data for initialization (Data No.
3 COMMUNICATIONS BY THE MODEM FUNCTION P52 MELSEC-Q Data reception processing subroutine • Sets the data reception channel to CH1 • Sets the data setting completion flag for reading the receive data. • Executes the receive data reading.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q 3.5.3 Sample program for notification Modem initialization and notification are executed by commands from the user. Before executing this program, perform the following settings (changing the default values) on the GX Configurator-SC's "Modem function system setting" screen and register them in the Q series C24. (Settings other than the items shown below are not required.
3 COMMUNICATIONS BY THE MODEM FUNCTION MELSEC-Q Accessible flag is turned ON Modem initialization enabled flag is turned ON Line connectable flag with the remote station is turned ON To the data registration processing for initialization subroutine To the data registration processing for connection subroutine Converts the initialization command into pulse Various complete flags after the modem initialization processing is reset To the modem initialization processing subroutine Converts the notification c
3 COMMUNICATIONS BY THE MODEM FUNCTION P2 MELSEC-Q Data registration processing for connection subroutine • Set the number of bytes of the registration data • Clear the data storage device for connection • Set the pager receiver designation (Notification is executed) • Set the telephone number • Set the space to the remainder of the telephone number designation area • Set the external line dialing number (0) • Set the line type (tone) • Set the waiting time for the message transmission • Set the message •
4 RECEIVING DATA WITH AN INTERRUPT PROGRAM MELSEC-Q 4 RECEIVING DATA WITH AN INTERRUPT PROGRAM In data communication between the Q series C24 and the external device, an interrupt program can be used to receive data for the following data communication functions.
4 RECEIVING DATA WITH AN INTERRUPT PROGRAM MELSEC-Q 4.1 Settings for Receiving Data Using an Interrupt Program The following explains the settings for performing data reception with an interrupt program during communication using the non procedure protocol or bidirectional protocol. (1) Setting by GX Developer 1) The following settings are performed with the interrupt pointer No. of module screen.
4 RECEIVING DATA WITH AN INTERRUPT PROGRAM MELSEC-Q 4.3 Reception Control Method Using an Interrupt Program The following explains the reception control method when receiving data with an interrupt program during communication using the non procedure protocol or bidirectional protocol. FEND SM400 I50 Z.
4 RECEIVING DATA WITH AN INTERRUPT PROGRAM MELSEC-Q 4.4 Programming This section explains the programming when data reception is performed with an interrupt program during communication using the non procedure protocol or bidirectional protocol. 4.4.1 Program example The following shows a program example for receiving data using an interrupt program. (Program condition) • Interrupt pointer No. of module set by GX Developer CPU side: Interrupt pointer. Start No. = 50, Interrupt pointer No.
4 RECEIVING DATA WITH AN INTERRUPT PROGRAM MELSEC-Q Data register Buffer memory D200 D201 Reception area No. of receive data Receive data D2nn POINT (1) When data reception is performed with an interrupt program, the dedicated BUFRCVS instruction is used regardless of whether the communication uses the non procedure protocol or bidirectional protocol. For more details on the BUFRCVS instruction, see Section 17.2.
4 RECEIVING DATA WITH AN INTERRUPT PROGRAM MELSEC-Q (6) After the power supply turns from OFF to ON or the CPU module is reset, data cannot be received because the interrupt program is invalidated during the initial processing of the CPU module. For asynchronous data communication with the Q series C24 from the external device without communication procedure setting, read the data as shown in the following program.
5 CHANGING SEND AND RECEIVE DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTES UNITS SETTING) MELSEC-Q 5 CHANGING SEND AND RECEIVE DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTES UNITS SETTING) The word units are used for the data length (count) of the amount of data sent/received using the following data communication functions in data communication between the Q series C24 and the external device.
5 CHANGING SEND AND RECEIVE DATA LENGTH UNITS TO BYTE UNITS (WORD/BYTES UNITS SETTING) MELSEC-Q MEMO 5 5-2 5-2
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES The monitoring times are timers used by the Q series C24 to monitor the receiving interval time between each byte when receiving data from the external device, the PLC CPU processing time, and the time it takes to transmit to the external device. The monitoring times can be set for each interface.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 6.1 No-Reception Monitoring Time (timer 0) Setting The no-reception monitoring time (timer 0) is the time for clearing the Q series C24 state when the Q series C24 is placed into the data receive wait state by trouble in the external device. The Q series C24 monitors the reception interval in byte units at the start of data reception from the external device and ends monitoring when the preset last data is received and repeats this operation.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q (b) Data communications using non procedure protocol (Format 0) 1) Data communications not using user frames • Passes the receive data up to time-out to the Q series C24. • Stores the error code to the data receive result storage area (buffer memory addresses 258H, 268H) for the target interface and turns on the reception abnormal detection signal (X4, XB) and waits to receive the next data.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q (c) Data communication using non procedure protocol (Format 1) The reception monitoring format 1 of the no-reception monitoring time (timer 0) is used for receiving a message for which the receive complete code and receive data count has not been preset. This occurs when the no-reception monitoring time (timer 0) runs out on the non procedure protocol.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q (2) Changing the no-reception monitoring time (timer 0) (a) Changing the no-reception monitoring time (timer 0) The no-reception monitoring time (timer 0) is designated by the number of transmitted characters (byte count) corresponding to the data communication rate set in the interface, and then it is registered on the GX Configurator-SC's "Transmission control and others system setting" screen.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 2) When exchanging data with the external device through the Q series C24 RS422/485 interface and changing the no-reception monitoring time (timer 0) (Td + T1) Vbps 12000 (Round up fractions below decimal point.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 6.2 Response Monitoring Time (timer 1) Setting The response monitoring time (timer 1) clears the receive wait state of the device that receives the response message when trouble in the device that received the message does not return a response message (result) to the external device.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 2) Data communications using bidirectional protocol • Stores the error code to the data transmission result storage area (buffer memory addresses 257H, 267H) for the target interface and performs transmission processing abnormal completion. • While waiting to transmit a response message, the Q series C24 does not check the response monitoring time.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q POINT (2) Data communications using bidirectional protocol Set the default value to the following time, or longer.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 6.3 Transmission Monitoring Time (timer 2) Setting The transmission monitoring time (timer 2) clears the wait state when the Q series C24 that is to transmit a message or response message (result) has entered the transmission end wait state due to trouble in the external device. When the Q series C24 transmits a message, it monitors the wait time up to the end of transmission of the message.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 2) Data communications using non procedure protocol or bidirectional protocol • While waiting for the end of transmission of a message, the Q series C24 stores the error code to the data transmission result storage area (buffer memory addresses 257H, 267H) for the target interface and performs transmission processing abnormal completion. If message transmission was terminated midway, the Q series C24 does not transmit the remaining data.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q REMARK Criteria when changing the transmission monitoring time (time 2) setting Find the transmission monitoring time (timer 2) time from the maximum delay time of external device message receive processing or response message transmission processing and the transmission time/byte (t) and change the set value.
6 CHANGING THE DATA COMMUNICATIONS MONITORING TIMES MELSEC-Q 6.4 Message Wait Time Setting The message wait time is used during data communications using a MC protocol. It is the time for an external device that cannot receive the data immediately after it has been transmitted. When the Q series C24 transmits a response message in reply to a command message received from the external device, transmission of the response message is delayed by the message wait time, or longer.
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q 7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL The transmission control function controls (termination, restart) the transmission and reception of data between the Q series C24 and external device by turning transmission control signals on and off, or by transmitting and receiving DC codes (DC1, DC2, DC3, DC4), or informs the range of validity for the data to the external device.
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q 7.1 Control Contents of DTR/DSR (ER/DR) Signal Control This control uses the RS-232 interface DTR/DSR signals to inform the external device whether or not the local station is ready to receive data. The Q series C24 uses the DTR (ER) signal to inform the external device whether or not the local station is ready to receive data and uses the DSR (DR) signal to check if the external device is ready to receive data.
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q (b) Specification of free OS area The limit of free OS area for data reception under the DTR/DSR (ER/DR) signal control is specified in GX Configurator-SC's "Transmission control and others system setting" (See User's Manual (Basic), Section 8.4.5.). When it reaches the limit, this status is notified to disable data reception. The set values must satisfy the following condition.
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q 7.2 Control Contents of DC Code Control This control uses the Q series C24 transmission control data to inform the external device whether or not local station is ready to receive data and the valid range of the send and receive data. The four kinds of Q series C24 DC code control shown below are available. These control functions can be used simultaneously.
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q REMARK • Receive data clear described in Section 6.1.4 of User's Manual (Basic) clears the OS area simultaneously with clearing of the receive data save area. • If more data is received when the vacant OS area mentioned above is 0 bytes, an SIO error is generated and the data received until the OS area becomes vacant is ignored. At this time, the SIO LED is turned on. (See Section 10.1.1 of User's Manual (Basic).
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q (a) Q series C24 DC2/DC4 transmission control contents When transmitting data to an external device, the Q series C24 adds the DC2 code to the head of the send data and the DC4 code to the end of the send data.
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q 7.3 Precautions when Using the Transmission Control Functions The following describes the precautions to be observed when using the Q series C24 transmission control functions. (1) Agreement between external device and PLC CPU The external device and PLC CPU must agree to the following. 1) Whether or not a transmission control function is to be used. If a control function is used, which control is to be used for data communications.
7 DATA COMMUNICATIONS USING DC CODE TRANSMISSION CONTROL MELSEC-Q POINT If the user data received from the external device includes the relevant DC code when DC1/DC3 reception control and DC2/DC4 reception control are used, the Q series C24 uses the corresponding DC code control. If the user data transmitted from the PLC CPU includes a DC code, it is sent unchanged.
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q 8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS For data communications between the Q series C24 and an external device using the RS-232 interface, it is set so that the Q series C24 and the external device do not transmit data at the same time. The QJ71C24 (N)-R2 can be set for each interface. When the Q series C24 is started, full-duplex communications is set.
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q 8.2 Data Transmission and Reception Timing Half-duplex communications uses the Q series C24 RS-232 interface CD and RS signals to control communications. If the external device can transmit and receive data according to ON/OFF of the Q series C24 RS and CD signals as shown below, half-duplex communications is possible. RS signal............. Turned ON/OFF by the Q series C24 as shown below.
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q (b) When Q series C24 is designated "non-priority" Continue data transmission. Data B Data A External device PLC CPU Data C-2 Data C-1 Since the Q series C24 does not have priority, when the CD signal is turned ON, it terminates transmission. Data C-1 SD (Send Data) RS (Send Request) Retransmission See (2) for the transmission contents.
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q (2) Timing when data is transmitted from the Q series C24 The Q series C24 RS signal is controlled and data is transmitted according to the "simultaneous transmission priority/non-priority" value registered in "Transmission control and others system setting" screen of the GX ConfiguratorSC. (See Section 8.4.5 of User's Manual (Basic)).
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q (b) When Q series C24 is designated "non-priority" Continue data transmission. Data C External device PLC CPU Data B Data A Send request Data A SD (Send Data) Send request Time for transmitting 2 characters 1) Data B Since the Q series C24 does not have priority, when the CD signal is turned ON it terminates transmission.
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q 8.3 Changing the Communication System To change the data communication mode from full-duplex communication to halfduplex communication, registration on the GX Configurator-SC's "Transmission control and others system setting" screen is required. The following explains setting items for changing the communication system. For more details on the registration method of the communication system, see Section 8.4.5 of User's Manual (Basic).
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q 8.4 Connector Connections for Half-duplex Communications The following explains the functions of the connector that connects the Q series C24 and external device when half-duplex communications is used. Connect the Q series C24 and external device based on (1) and (2) below. (1) Connect the Q series C24 RS signal to one of the external device half-duplex communications signals (CS, DSR, or CD signal).
8 DATA COMMUNICATIONS USING HALF-DUPLEX COMMUNICATIONS MELSEC-Q 8.5 Half-duplex Communications Precautions The following describes the precautions to be observed when using half-duplex communications. (1) Half-duplex communications system configuration and functions Half-duplex communications is possible only with a system that connects the PLC CPU and external device in a 1: 1 configuration.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION User frames are used to register some, or all, of the messages exchanged between an external device and the Q series C24 in advance and use them to check the send data or receive data. The following functions can use Q series C24 user frames to transmit and receive data. • MC protocol on-demand function.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q (c) User frames can include data for handling the variable data (sum check code, Q series C24 station No., etc.) shown in (4) as a part of user frames. (d) User frames can be overwritten to the Q series C24 buffer memory. (The old contents are destroyed.) (e) The registration destination for the user frame can be divided into the following usage.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q Changeable data register code 1st byte Data contents transmitted and received/Q series C24 handling 2nd byte Transmission: Transmits the data code 00H (NUL) data (1 byte). Reception: Skips the given part (1 byte) of the receive user frame. (Skips the check and performs receive processing.) 00H 1) — Transmits and receives the station No. set in the GX Developer switch setting as 1-byte binary code data (00H to 1FH).
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 3 Calculation ranges for the register codes Range 4 Range 4 Range 3 Range 3 User frame (1st) User frame (2nd) User frame ("n-1"th) User frame ("n"th) User frame (First frame) Arbitrary data User frame (Last frame) Register code FFH Range 1 Range 2 Register code FFH H H Range 1 Range 2 (Calculation range when transmitting data) (Calculation range when receiving data) Range 1 When transmitting: Calculation includ
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 1) Q series C24 processing corresponding to register codes FFH and 00H The following uses an example to describe the processing performed by the Q series C24 when it receives a user frame part corresponding to register codes FFH and 00H. Assume that a user frame containing the data codes 02H, FFH, 00H, and 3BH was set as receive user frame No. 3EAH.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q • How to calculate the horizontal parity code This is a numeric value obtained by calculating the XOR for the subject data and then converting it to ASCII code.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 5) Transmission/reception data corresponding to register codes FFH+EEH to FFH+F9H The sum check code that calculates the subject range for transmission/reception data (message) is expressed as the binary code/ ASCII code data shown below, then transmitted and received. Register code Data contents transmitted and received The lower 2 bytes of the calculated sum check code are transmitted and received as 2-byte binary code data.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 6) Transmission/reception data corresponding to register code FFH+E5H The sum check code resulted from the calculation of the transmission/reception data (message) codes except the first one frame and last one frame is expressed as the ASCII code data and transmitted or received.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9.1.2 Default registration frame (read only) This frame is registered to the Q series C24 in advance and can be used in the same way as the other user frames. (1) Overview The default registration frame is registered in the OS ROM of the Q series C24.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9.2 Transmission/Reception Processing Using User Frame Register Data The following explains how the Q series C24 transmits and receives using user frame register data. The Q series C24 checks the transmission/reception of following data, using registered data.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q REMARK With a multidrop link, the user frame includes data that identifies which station transmitted the message to the external device to facilitate generation of arbitrary send data. External device Data that identifies the transmitting staion to the external device S C L T 1 A ; A B C 1 2 3 ; R F X Arbitarary data User frame CPU C24 (0) CPU C24 (1) When message transmitted from the staion No.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 2) Register data code FFH + 00H to FFH 2-byte data register part The Q series C24 receives and checks if the received data is variable data corresponding to the combination of the register codes FFH and 00H to FFH. For example, if a sum check code is registered, the Q series C24 calculates the sum check code from the receive data and checks if it is the same as the received sum check code.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9.3 Precautions when Registering, Reading, Deleting and Using User Frames The following shows the precautions which should be observed when registering user frames and using registered user frames to transmit data to and receive data correctly from the external device. (1) Precautions when registering, reading or deleting user frames (a) User frames can be registered using one of the following methods.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q (2) Precautions when using user frames (a) To send/receive data using the user frames, it is necessary to set the user frame number to be used in the buffer memory prior to data transmission/reception (receive user frames must be set at the startup of the Q series C24). The user frame number to be used can be set from the PLC CPU.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9.4 Register/Read/Delete User Frames The following explains registering, reading, and deleting user frames in the Q series C24 flash ROM or buffer memory. POINT When registering, reading and deleting the user frames in the flash ROM, try to register them using the utility package (GX Configurator-SC) of the Q series C24. Registering, reading and deleting operations from GX Configurator-SC are explained in Section 8.4.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q POINT Conduct registering, reading, and deletion of the user frame from the sequence program when data communication is not being conducted with external device. (3) Buffer memory to use Address (Hexadecimal (decimal)) Name Processing Stored value Register 2H ( 2) Register/read/delete direction 0: No request 1: Register request 2: Read request 3: Delete request 3H ( 3) Frame No. direction 0: No frame No.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 1) Registration data byte count designation area (Addresses: 5H, 1B00H, 1B29H,..., 1FCEH) • Indicates the total number of bytes of register data of the user frame to be registered/read. • Flash ROM access During the register operation, the user registers the total number of bytes of register data. During the read operation, the total number of bytes of registered data is stored.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9.4.1 Registering user frames The following shows an example of a sequence program when registering user frames in the Q series C24 flash ROM. For details on the PUTE instruction, see Section 17.7.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9.4.2 Reading user frames The following shows an example of a sequence program when reading user frames registered in the Q series C24 flash ROM. For details on the GETE instruction, see Section 17.5. (When the Q series C24 I/O signals are X/Y80 to X/Y9F) Read request Sets the frame No.
9 CONTENTS AND REGISTRATION OF THE USER FRAMES FOR DATA COMMUNICATION MELSEC-Q 9.4.3 Deleting user frames The following shows an example of a sequence program when deleting user frames registered in the Q series C24 flash ROM. For details on the PUTE instruction, see Section 17.7. (When the Q series C24 I/O signals are X/Y80 to X/Y9F) Deletes request Sets the delete request Sets the No. of the user frame to be deleted Sets a dummy number for the allowable number of deletions Set the flash ROM write allow.
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES During communications between external device and PLC CPU using an MC protocol, on-demand data can be transmitted from the PLC CPU to the external device by ondemand function using user frames.
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 10.2 User Frame Types and Registration Data communications using user frames can be performed by registering the user frames to the Q series C24 from an external device and the PLC CPU. Chapter 9 explains the types of user frames and the data that can be used. To register a user frame from the PLC CPU, see Chapter 9. To register a user frame from an external device, first see Chapter 9 and check the precautions, etc.
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 2) On-demand data list The following shows the user frame designation on-demand data list. On-demand data User frame User frame Send data User frame User frame Transmitted when last frame (2nd) designated. Transmitted when last frame (1st) designated. On-demand instruction/transmitted when send data designated in buffer memory. Transmitted when first frame (2nd) designated. First frame (1st).
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 10.4 On-Demand Function Control Procedure During User Frame Use The following uses examples to explain the control procedure when using the ondemand function to frame to transmit on-demand data to an external device by user frame. 10.4.1 Data communication using the ASCII code The following shows the control procedure when performing switch settings via GX Developer and registration via GX Configurator-SC.
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q [Control procedure] Added by Q series C24 First frame (1st) External device First frame (2nd) Last frame (1st) User frame Send data User frame F9H 00H 00H FFH, FFH 00H 03H FFH,F1H User frame registration code Code 02H Sum check (Data name) Send data corresponding to registration code H L E S T F 9 0 0 0 0 F F 0 0 1 2 3 4 5 6 7 8 T X X PLC CPU (Example) 02H 46H 39H 30H 30H 30H 30H 46H 46H 30H 30H 31H 32H 33H 34H 35H 36H 37H 3
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 10.4.2 Data communications using the binary code The following shows the control procedure when performing switch settings via GX Developer and registration via GX Configurator-SC. (1) Switch settings via GX Developer 1) Set the "Communication protocol setting" to "MC protocol (format 5)." 2) Set the "Station number" to "0.
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q [Control procedure] Added by Q series C24 External device First frame (1st) Last frame (1st) User frame Send data User frame (Data name) PLC CPU ; 03HFFH,F0H0DH 0AH E T X Sum check code Station No.
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 10.5 Example of an On-Demand Data Transmission Program Using User Frames The following shows an example of a sequence program when sending on-demand data including user frames. Perform the following settings via GX Developer and registration using GX Configurator-SC in advance.
10 ON-DEMAND DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (3) Program example The following program example shows the transmission of on-demand data using the on-demand function. Designate two words of transmission data with the ONDEMAND instruction. The data for the user frame section of on-demand data to be sent is the registered data for the user frame No. that was registered with GX ConfiguratorSC.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11 DATA COMMUNICATIONS USING USER FRAMES 11 Registering the fixed format portion of the message transmitted/received by the opposite device and the Q series C24 as a user frame beforehand allows data transmission/reception using a user frame. The use of the user frame to perform data transmission/reception facilitates the creation of transmission data on the PLC CPU side and a simplified sequence program for checking the reception data.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.1 Overview of Data Communication Procedure The following is an overview of the procedure when performing data communication between the opposite device and PLC CPU using a user frame. Start Switch setting by GX Developer. Initial setting by GX Configurator-SC . • • • See Section 4.5 and Chapter 8 of User's Manual (Basic). (When only default registration frame used) (When registering user frames) • Register to the Q series C24 Flash ROM.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.2 Data Reception In data reception using the user frame, the reception method on the Q series C24 side includes format 0 and format 1. This section explains data reception for each format. 11.2.1 About reception data In reception using the user frame, data arranged as indicated below can be received.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 2 If data of other than 30H to 39H and 41H to 46H are received as the data code of the arbitrary data area (including the transparent code data), the Q series C24 ASCII-BIN conversion will generate an error. 3 Receive data arbitrary data area 1) When the arbitrary data area is stored to the receive area, and the storage byte count is an odd number of bytes, the receive data count shown below is stored to the receive data count storage area.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (1) Reception with the first frame (combination 1-A to C) (reception using Format-0) (a) Reception of combination (1-A) 1) In this method, any data section of the reception message that can be handled by the PLC CPU side is enclosed by the first frame and the last frame and transmitted from the external device. 2) Any reception data prior to the first frame will be ignored.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (c) Reception of combination (1-C) 1) In this method, start of data transmission from the external device to the PLC CPU side is notified by the first frame, after which arbitrary data of a fixed length is repeatedly transmitted from the external device. 2) Any reception data prior to the first frame will be ignored. After the first frame is received, all later reception data is treated as arbitrary data.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (Example 2) By specifying a user frame, in which only NAK (15H) is registered, as the first frame and also specifying exclusive format-1 received data count for arbitrary data as 2 bytes, a read request will be performed to the PLC CPU upon the reception of NAK + 2-byte data.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (b) Reception of combination (2-B) 1) In this method, a user frame is used as the last frame in place of the non procedure protocol data receive complete code, and fixed format data is transmitted from the external device. 2) Any reception data prior to the last frame are all treated as arbitrary data. 3) When data of the same arrangement as the last frame is received, the Q series C24 performs a read request to the PLC CPU.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q REMARK The following shows the difference in how reception data for each reception method (Format-0 and Format-1) is treated when data is received using the combination of (first frame + arbitrary data). (1) When data is received using Format-0 (combination (1-C)) 1) The Q series C24 regards all arbitrary data after the first frame as valid data and stores it sequentially in the reception area.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.2.2 Timing for start/completion of data reception This section explains the reading of reception data based on the user frame and other factors (such as the receive complete code and received data count) during data reception using a user frame. (1) Timing for start/completion of data reception The following describes the timing for start/completion of the data reception processing with the Q series C24.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (2) Timing chart for reception processing using the Q series C24 The following is a timing chart for the reception processing when data reception is performed using the user frame, which includes the reception processing using the received data count. The numbers in the table indicate the timing of a reception data read request to the PLC CPU (see next page).
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q [Combination with the first frame] Timing patterns for reception start and receive complete (read) (For data reception with format-0) Arbitrary data Equaling the received data count PLC CPU side Last frame First frame Arbitrary data Pattern No. 1-A 2) Last frame External device side First frame Pattern No. 1-A 1) Equaling the received data count External device side Last frame First frame Pattern No. 1-B PLC CPU side Pattern No.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q [Combination without the first frame] Timing patterns for reception start and receive complete (read) Pattern No. 2-A 1) Arbitrary data PLC CPU side Equaling the received data count PLC CPU side Arbitrary data Equaling the received data count Last frame Arbitrary data Complete code Last frame Arbitrary data Pattern No. 2-A 4) Complete code Pattern No.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.2.3 Receive procedure The following shows the receive 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 PLC CPU.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.2.4 User frame setting for reception (1) About user frame setting for reception This setting is to receive data from the opposite device using non procedure protocol through the use of a user frame. Everything is set on the GX Configurator-SC "Non procedure system setting" screen. The setting items are listed below. (See Section 8.4.7 of User's Manual (Basic).
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (2) Initial settings via GX Configurator-SC ("Non procedure system setting" screen) This section explains the buffer memory when setting various setting data for data reception using a user frame in a sequence program. (Numbers in the parentheses indicate the buffer memory address.) (a) User frame use enable/disable designation (addresses: ADH/14DH) Designate "Enable" when using user frames to receive data.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q [How to specify the first frame No. and the last frame No.] Set the frame numbers using the following setting method. (1) For the receive user frames, the first frame and last frame are set as a pair, regardless of whether the external device transmits these frames. (If the external device does not transmit either one of the frames, the unsent frame No. is set to "0" (no setting)).
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (c) User frame receive format designation (address: 2020H to 2023H/2120H to 2123H) In data reception using a user frame, specify the reception method for each combination of receive user frames. This setting is valid in a setting shown in (2) (b) when it is set using a combination that specifies a user frame.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (3) Examples of registering a receive user frame The following are examples of pre-registering a receive user frame on the CH1 side with the GX Configurator-SC. (a) When the first frame is specified In the example, the following three combinations are registered for the receive user frame.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (b) When the first frame is not specified In the example, the following three combinations are registered for the receive user frame. [Setting conditions] User frame User frame receive format designation Exclusive format-1 received data count Format-0 — Remarks 1st combina- (Last frame only) tion 2nd combina- (Last frame only) tion The received data count becomes valid. 3rd combina- (Last frame only) tion See Section 8.4.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.3 Receive Program This section shows examples of the sequence program to read the reception data stored in the Q series C24 buffer memory to the PLC CPU, when data including the user frame is received. 11.3.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q Address in DEC (HEX) CH1 Name 8224 (2020H) 8225 (2021H) 8226 (2022H) 8227 (2023H) 8229 (2025H) 8230 (2026H) 8231 (2027H) User frame receive format designation, 1st User frame receive format designation, 2nd User frame receive format designation, 3rd User frame receive format designation, 4th Exclusive format-1 received data count, 2nd Exclusive format-1 received data count, 3rd Exclusive format-1 received data count, 4th Set value 0H: Format 0 1H: Form
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (1) Sequence program example when using GX Configurator-SC For details of the INPUT instruction, refer to the User’s Manual (Basic), Section 9.4. Reads combinations of user frames received. Sets the reception channel to CH1. Sets the allowable number of reception data to 20. Executes reception. Sets the normal completion flag. Sets the abnormal completion flag.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (2) Sequence program example when not using GX Configurator-SC For details of the INPUT instruction, refer to the User’s Manual (Basic), Section 9.4. <> \ \ \ \ User frame registration (See Chapter 9.) \ \ \
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q \ \ \ \ \ \ \ \ \ \ User frame setting for reception (See Section 11.2.4.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.3.2 Application example for data reception using a combination that specifies the first frame In the description of this program example, conditions for data reception using a user frame are as follows. (1) The Q series C24 I/O signal The Q series C24 is installed at QCPU I/O signal addresses X/Y80 to X/Y9F. (2) Q series C24 interface used in data communications with the external device The Q series C24 CH1 side RS-232 interface is used.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (a) When receiving with a combination of the first frame, arbitrary data and last frame (reception using Format-0) Additional code (Removed by Q series C24.) Transparent code D L E When STX handled as transparent code. S T X 10H 02H External device ; 0 1 3 2 S T A B C X C L R F E T X (1234H) Sum check code S T Q X External device station NO.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (b) When receiving with a combination of the first frame and arbitrary data (reception using Format-0) Additional code (Removed by Qseries C24.) Transparent code D L E When STX handled as transparent code.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (c) When receiving with user frame only (reception using Format-0) Head data External device ; E T X Sum check code S T Q X External device station No. (For reception using first frame and last frame combination) Since there is no arbitrary data area, the receive data count is [0]. The illustration below is for reception using first frame and last frame combination.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (d) When receiving with first frame only (reception using Format-1) Head data Since it is designated to system 1 received data count "0", the receive data count is [0]. A C K External device The illustration below is for byte unit. ADH 06H AEH First frame (Correspond to PLC CPU AFH register No.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (e) When receiving with a combination of the first frame and arbitrary data (Exclusive format-1 dedicated received data count) (reception using Format-1) Receive data count Word units Receive byte count excluding frame and additional code (2)/2=1 Byte units Receive byte count excluding frame and additional code (2) Head data N A K External device The illustration below is for byte unit.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.3.3 Application example for data reception using a combination that does not specify the first frame In the description of this program example, conditions for data reception using a user frame are as follows. (1) The Q series C24 I/O signal The Q series C24 is installed at QCPU I/O signal addresses X/Y80 to X/Y9F. (2) Q series C24 interface used in data communications with the external device The Q series C24 CH1 side RS-232 interface is used.
11 DATA COMMUNICATIONS USING USER FRAMES (d) MELSEC-Q When receiving using arbitrary data and last frame combination. (reception using Format-0) Addtional code (Removed by the Q series C24.) Transparent code D L E When STX is handled as transparent code.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.4 Data Transmission This section explains the arrangement of the transmission data and transmission procedure when transmitting data using a user frame. 11.4.1 Send data The following describes the data list, codes, and handling of the Q series C24 send data during user frame data transmission. (1) Send data list Only the data list combinations shown below are allowed during user frame data transmission.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q POINT Handling of the Q series C24 send data (1) The data of the user frame and the data of the transmission area designated from the PLC CPU are transmitted in the contents and order set in the buffer memory send user frame designation area. (2) For the user frame section and arbitrary data section, the data can be sent as ASCII code using the ASCII-BIN conversion. For more details on the ASCII-BIN conversion, see Chapter 13.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.4.2 Transmission procedure The following describes the transmission procedure when transmitting a message containing user frames to the external device.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.4.3 Settings for transmission user frames These settings are required for sending data to an external device via user frames and the non procedure protocol. These settings are made from the GX Configurator-SC or the PLC CPU. (1) Settings via the GX Configurator-SC Perform settings on the following screen to send data using user frames. • "Non procedure system settings" screen • "Transmission user frame No.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (Example) Sending data in the following sequence Sending Transmission data type sequence 1 User frame 2H ( 2) 2 User frame 3E82H ( 1000) 3 Arbitrary data 8000H (—32768) 4 User frame Address B6H B7H B8H B9H BAH BBH BCH BDH BEH BFH To the external device User frame No.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (b) Transmission user frame designation The following explains application of the buffer memory to be used when sending data using user frames, along with the designated and stored values. 1) User frame being transmitted storage area (addresses: B6H/156H) What number of the output frame number designation area is being sent is stored in the data transmission via user frames.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 4) Output count designation area (addresses: B9H/159H) Write the output count of the user frames to be sent from the position desingnate in the output head pointer designation area.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q 11.5 Transmission program The following are examples of a sequence program when the user frame (four) and transmission area data are transmitted. In the description of the sample programs, data transmission using user frames is described for the following conditions case: 1) The Q series C24 I/O signals The Q series C24 installed at QCPU I/O signal addresses X/Y80 to X/Y9F.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (1) Example of a sequence program when setting is done using the GX Configurator-SC See Chapter 17 of this manual for details on the PRR command. Q series C24 Station No. 02H 51H 0AH 01H PLC CPU side Registration No.
11 DATA COMMUNICATIONS USING USER FRAMES MELSEC-Q (2) Example of a sequence program when setting is not done using the GX Configurator-SC The following is the method of data transmission without performing the output frame No. designation using the GX Configurator-SC. For further details on the PRR instruction, see Chapter 17 of this manual. Transmission instruction Sets arbitrary transmission data. Sets the number of transmitted data. Sets the transmission user frames in D5 to D9.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12 TRANSPARENT CODES AND ADDITIONAL CODES Transparent codes and additional codes are used during data communication with an external device to send/receive one-byte data for transmission control on the external device side as user data. Transparent codes and additional codes are handled in data communication using the non procedure or bidirectional protocol. • Transparent code: One-byte data for transmission control.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.2 Registering Transparent Codes and Additional Codes To control transparent codes and additional codes for data to be sent/received with the non procedure or bidirectional protocol, it is necessary to perform settings in the Q series C24 prior to data communication. The following explains the registration of transparent and additional codes.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.3 Handling Transparent Codes and Additional Codes During Non Procedure Protocol Data Communication The following explains the handling of transparent codes and additional codes during non procedure protocol data communication. (1) The data designated by the additional code will be added to or deleted from the data to be transmitted or received.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q When sending the data for the section designated by 4001H to 44AFH and C000H to C01FH, data will be sent without conversion even if "Enable" has been specified in the ASCII-BIN conversion designation area. (See Section 13.3.) No. of the use frame to be sent 12 - 4 Designation No. when sending data without adding the additional code specified by the send transparent code designation.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q (3) The following describes the processing steps taken by the Q series C24 when performing communication with the transparent code designation and the ASCIIBIN conversion enabled. (a) Communication using arbitrary format 1) Receiving • If a receive transparent code is designated, the additional code designation data is deleted (removed). • The arbitrary data section is stored in the reception area of the buffer memory.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q (Example) When ASCII-BIN conversion is not performed External device Q series C24 (Communicating in an arbitrary format) Head data Buffer memory (transmission area/reception area) (For 02H) Receive (L) (0002H) 00H , 02H (0212H) 02H , 12H (BC3AH) BCH , 3AH Addition 12H D L E 10H 02H 3AH BCH Delete Arbitrary data section Additional code (H) Send Transmission data count/Receive data count Transmission data/ receive data (The data count is in
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q (b) Communication using user frames 1) Receiving • Reception check of user frames (first frame, last frame) is performed. • If a receive transparent code is designated, the additional code designation data is deleted (removed) from the arbitrary data section. • If a sum check code is designated in a user frame (last frame), the sum check code is calculated. • The arbitrary data section is stored in the reception area of the buffer memory.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.4 Example of Data Communication Using the Non Procedure Protocol This section shows examples of data communication using the non procedure protocol when the following settings and registrations are made. (1) Settings via GX Developer Perform the following settings on the "Intelligent functional module switch setting" screen. (See Section 4.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.4.1 Example of data reception The following shows an example of storing receive data in the data register.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q (2) Receiving based on the completed data count Additional code: 10H (DLE), transparent code: 02H (STX), Completed data count: Six words or 12 bytes Additional code (Q series C24 deletes) Head data Transparent code 0 External device side 1 2 3 D L E S T X N U L L A C L R F For word unit: Received byte count excluding additional code (12)/2=6 For byte unit: Received byte count excluding additional code (12) B (1234H) 30H 31H 32H 33H 10H 02
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.4.2 Example of data transmission The following shows an example of data transmission.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 2) Additional code: 10H (DLE), transparent code: 02H (STX) (1st group) Additional code: 10H (DLE), transparent code: 03H (ETX) (2nd group) External device side Head data 0 PLC CPU side 1 2 Additional code (1st group) Additional code (2nd group) Transparent code (1st group) Transparent code (1st group) D S N 3 L T U E X L L A D E N B L T U E X L L C L R F For word unit: Received byte count excluding additional code (12)/2=6 For byte unit: R
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.5 Handling Transparent Codes and Additional Codes During Bidirectional Protocol Data Communication The following explains the handling of transparent codes and additional codes during data communication using the bidirectional protocol. (1) The additional code designation data will be added to or deleted from the data that is sent or received.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q (3) The following shows the processing steps taken by the Q series C24 when performing communication with the transparent code designation and ASCII-BIN conversion enabled. POINT Explained above is how the Q series C24 processes communication data, when enabling and disabling the ASCII-BIN conversion function and/or transparent code designation communication function.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 3) If a send transparent code is designated, additional code data is added preceding the transparent code/additional code data for the arbitrary data section, and is then sent.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.6 Example of Data Communication Using the Bidirectional Protocol This section shows examples of the bidirectional protocol data communication when the following settings and registrations are made. (1) Settings via GX Developer Perform the following settings on the "Switch setting" screen. (See Section 4.5 of the User's Manual (Basic)).
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.6.1 Example of data reception The following shows an example of storing receive data in the data register. (1) When the receive transparent code designation is set to Enable and the ASCII-BIN conversion is set to Disable Additional code: 10H (DLE), transparent code: 02H (STX) Additional code (the Q series C24 deletes.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q (2) When the receive transparent code designation is set to Enable and the ASCII-BIN conversion is set to Enable Additional code: 10H (DLE), transparent code: 02H (STX) E N Q External device side Data length (0004H) Data section Sum check code L H L H 0 4 0 0 0 2 1 1 4 1 4 2 3 4 1 2 0 D 0 A 05H 30H 34H 30H 30H 30H 32H31H 31H 34H 31H 34H 32H 33H 34H31H 32H 30H 44H 30H 41H 02H 04H PLC CPU side A C K Exclude the additional code and set to an even byte
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q 12.6.2 Example of data transmission The following shows an example of data transmission.
12 TRANSPARENT CODES AND ADDITIONAL CODES MELSEC-Q (2) When the send transparent code designation is set to Enabled and the ASCII-BIN conversion is set to Enabled Additional code: 10H (DLE), transparent code: 02H (STX) (1st group) Additional cede: 10H (DLE), transparent code: 03H (ETX) (2nd group) A C K External device side 06H E N Q PLC CPU side Transmission command Data length (0004H) Data section Sum check code L H L H 0 4 0 0 0 2 1 1 4 1 4 2 0 3 0 0 0 D 0 A 05H 30H 34H 30H 30H 30H 32H 31H 31H 34H
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) This chapter explains the binary-to-ASCII conversion (called ASCII-BIN conversion) in order to send/receive data in ASCII format to/from an external device. 13.1 ASCII-BIN Conversion ASCII-BIN conversion is a data conversion function that converts all data communicated between the Q series C24 and an external device to ASCII code data.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.3 Performing ASCII-BIN Conversion for Data Communicated via Non Procedure Protocol This section explains the ASCII-BIN conversion of data to be communicated using the non procedure protocol.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q Even if ASCII-BIN conversion is "enabled," it is possible to transmit data without converting the data in any user frame portion or buffer memory transmission area. When sending data without ASCII-BIN conversion, specify the user frame No. using the following method. • Specify the number obtained by adding 4000H to the registered user frame No.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.4 Example of Data Communication Using the Non Procedure Protocol This section shows examples of data communication using the non procedure protocol when the following settings/registrations are made. (1) Settings via GX Developer Perform the following settings on the "Intelligent function module switch setting" screen. (See Section 4.5 of the User's Manual (Basic).
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.4.1 Example of data reception The following shows an example of data reception: (1) Reception using the receive complete code Complete code: 9H ......
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q (2) Reception based on the received data count Head data 0 1 2 3 4 5 A B C D E Two bytes of reception data is read to the PLC CPU as one-byte data.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q (3) Example of reception using user frames ; 0 1 F 5 A B C D E F 9 E T X Number of receive data Number of bytes after ASCII-BIN conversion of receive data excluding frames and additional codes: (6)/2=3 When word units are used, (6) When byte units are used.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.4.2 Example of data transmission The following shows an example of data transmission: (1) Example of arbitrary data transmission External device side Eight characters of data in the transmission area are sent in two characters per byte through ASCII-BIN conversion.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q (2) Example of transmission by user frame 02H 51H 0AH Register No.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.5 Performing ASCII-BIN Conversion for Data Communicated Via the Bidirectional Protocol This section explains the ASCII-BIN conversion of data to be communicated using the bidirectional protocol. (1) The following shows the range of transmission/reception data for which ASCII-BIN conversion can be performed.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 5) Treatment of sum check code The data length and the data section after ASCII-BIN conversion are added together and the lowest two bytes of the resulting binary code data are treated as a sum check code. • At transmission The Q series C24 calculates a sum check code using the data length and data section after ASCII-BIN conversion, then adds it to the transmission message.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.6 Example of Data Communication Using the Bidirectional Protocol This section shows examples of data communication using the bidirectional protocol when the following settings and registrations are made. (1) Settings via GX Developer Perform the following settings on the "Intelligent function module switch setting" screen. (See Section 4.5 of the User's Manual (Basic).
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.6.1 Example of data reception The following shows an example of data reception when ASCII-BIN conversion is enabled.
13 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION) MELSEC-Q 13.6.2 Example of data transmission The following shows an example of data transmission when ASCII-BIN conversion is enabled.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION Always read this chapter when communicating data by using a multidrop link to connect the external devices and PLC CPU in an m: n system configuration. You do not have to read this chapter when using a system configuration other than m: n to communicate data.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q (5) When communicating data by using an m: n system configuration, designate the following station number at the [Station No.] and [Local station No.] items in the command message to be transmitted from an external device. 1) When accessing the PLC CPU Station No. Communications using QnA Communications using A compatible 2C/3C/4C compatible 1C frame Station No. of Q series C24 to be passed through (Station No.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 14.2 External Devices Interlock Conditions When using a multidrop line to communicate data between external devices and the PLC CPU in an m: n configuration, the external devices must be interlocked so that multiple external devices cannot communicate data with the PLC CPU at the same time.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 14.2.2 Message structure when communicating data between external devices The message structure when communicating data between external devices is determined by any of the following. This condition is determined to interlock the external devices so that they can exchange data with the PLC CPU in a 1:1 configuration.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q (2) When message structure different from that of control procedure format frames can be used 1) Change the head data of each message to other arbitrary data. • When selecting ASCII code format 1, format 2, or format 4, change ENQ (05H). 2) Arbitrarily list the data following the head data of each message according to the user specifications.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 14.3 Examples of Procedure for Data Communications with the PLC CPU The following uses examples to describe the procedure when communicating data with a PLC CPU by interlocking the external devices. 14.3.1 Sequential data communications between external devices and the PLC CPU The external devices sequentially obtain the line usage right and communicate data with the PLC CPU based on their station No..
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q : External device that obtained the line usage right (Before 5)) (Before 5)) External device (Station No.:1BH) External device (Station No.:1CH) 4) Data communications with arbitary PLC CPU (Station No.:2H) 5) (Station No.:0H) CPU CPU C24 External device (Station No.:1EH) 6) (Station No.:1H) C24 External device (Station No.:1DH) CPU C24 (Station No.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 7) When line usage time of the external device that currently has the line usage right exceeds the maximum data communications time. a) The external device of the next station No. transmits all external devices general report data and obtains the line usage right and performs step 2).
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 14.3.2 Data communications between PLC CPU and external devices by designating a master station and slave stations One of the external devices is made the master station and the other external devices communicate data with the PLC CPU after obtaining permission from the master station.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 1) A slave station that wants to communicate data with the PLC CPU sends a communications request to the master station to obtain the line usage right. A message structure example is shown in 2). 2) The master station transmits a permission granted response to the slave station that issued the communications request.
14 DATA COMMUNICATIONS USING EXTERNAL DEVICE AND PLC CPU M : N CONFIGURATION MELSEC-Q 6) The master station that received the communications complete report transmits a response to the slave station that transmitted the communications complete report. (Example) Sum check code Massage wait 1 Command Transmission destination station No. Transmission source station No. Massage of 5) 1 Command "ZY" is a communications complete report command for description purpose.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q 15 SWITCHING THE MODE AFTER STARTING This function forcefully switches the current communication protocol and transmission specifications of the designated interface from an external device and the PLC CPU after the Q series C24 starts. When the Q series C24 starts, it begins operation with the setting values of the GX Developer switch setting.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q 15.1 Mode Switching Operation and Contents that can be Changed This section describes the set contents that can be changed with mode switching and the operation of Q series C24 after mode switching. 15.1.1 Settings that can be changed with mode switching The following describes the settings that can be changed with mode switching. (1) Switching the communication protocol (a) The communication protocol setting of each interface can be switched.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q 2) Data communications using non procedure protocol and bidirectional protocol • Data and response message transmit and receive processing are all terminated. • All the input signals from the PLC CPU related to transmit and receive processing are turned off. • If the receive data from the external device was being stored to the Q series C24, the receive data up to that point is ignored and the data is processed with the current receive data count as [0].
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q (2) Mode switching from external device (a) (b) Once the mode has been changed to a mode other than MC protocol (Formats 1 to 5), it cannot be changed from the external device. In this case, change the mode on the PLC CPU. Only the Q series C24 (including multidrop link stations) connected to an external device is available for mode switching from the external device (See the Reference Manual, Section 3.13.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q 15.3 I/O Signals for Handshake with PLC CPU and Buffer Memory This section describes the I/O signals for handshake and the buffer memories used when mode switching is performed.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q (b) Switching transmission specifications designation area (address: 91H, 131H) 1) Designates the transmission specifications after mode switching. 2) When the transmission specifications are returned to the contents set in GX Developer, [0000H] is written to this area.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q 15.4 Switching the Mode from the PLC CPU This section shows how the Q series C24 mode is switched from the PLC CPU. 15.4.1 Mode switching procedure The following explains the procedure for switching the Q series C24 mode from the PLC CPU. 1 Mode switching request Y2/Y9 Mode switching in progress X6/XD Approx. 400 ms 2 CH ERR.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q 15.4.2 Mode switching sample program The following shows a sample sequence program that switches the CH1 interface mode. (The Q series C24 I/O signals X/Y00 to X/Y1F) Changes the operation mode to MC protocol format 1. Reception Transmission Reception Abnormal Mode read reception switching processing processing request detection instruction Sets the transmission specifications. Writes the mode switching designation contents to the buffer memory.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q 15.5 Switching the Mode from an External Device This section shows how the Q series C24 mode is switched from an external device. 15.5.1 Mode switching procedure The following explains the procedure for switching the Q series C24 mode from an external device. External device 1 Mode switching command message See Section 3.13 of reference manual for message format Mode switching response message PLC CPU (Normal end) Approx.
15 SWITCHING THE MODE AFTER STARTING MELSEC-Q REMARK To check the Q series C24 mode (communication protocol, transmission specifications) after switching, read the buffer memory (addresses: 252H to 253H, 262H to 263H) described in Section 10.1.5 of User's Manual (Basic). (To check the external device, read the buffer memory with the MC protocol buffer memory read function.) 15.5.
16 USING COMMUNICATION DATA MONITORING FUNCTION MELSEC-Q 16 USING COMMUNICATION DATA MONITORING FUNCTION The following describes the QJ71C24N (-R2/R4) communication data monitoring function. 16.1 Communication Data Monitoring Function 16.1.1 Overview Communication data monitoring function is a function to monitor communication data between the QJ71C24N (-R2/R4) and an external device on communication lines.
16 USING COMMUNICATION DATA MONITORING FUNCTION MELSEC-Q 16.1.2 Communication data monitoring operation The following describes the communication data monitoring operation. POINT (1) (2) When using the communication data monitoring function, the total transmission speed of the two interfaces should not exceed 115200 bps. The communication data monitoring function is effective when the communication protocol is assigned to 0H to 8H.
16 USING COMMUNICATION DATA MONITORING FUNCTION (c) MELSEC-Q Each data is stored in the monitor data area using the following timing.
16 USING COMMUNICATION DATA MONITORING FUNCTION MELSEC-Q 16.2 Communication Data Monitoring Function Settings Settings for the communication data monitoring function can be made on the "Transmission control and other system setting" screen of the GX Configurator-SC, or by the PLC program. (1) GX Configurator-SC setting for the communication data monitoring function The setting items for the communication data monitoring function are shown below. See (2) for setting details.
16 USING COMMUNICATION DATA MONITORING FUNCTION MELSEC-Q (2) Buffer memory for communication data monitoring function (a) Communication data monitoring specification area (Address: 2018H/2118H) Set start/stop of the communication data monitoring. See Section 16.1.2 for communication data monitoring setting operation. b15 Buffer memory address to 2018H/2118H b0 (Default: 0000H) Set the monitor start/stop.
16 USING COMMUNICATION DATA MONITORING FUNCTION MELSEC-Q (d) Monitor buffer size specification area (Address: 201BH/211BH) Set the size of the monitor data area. Setting range: 0003H to 1A00H (Default: 0D00H) (e) Monitor data pointer storage area (Address: according to monitor buffer head address setting (Default: 2600H/3300H)) 1) The oldest data position of the monitor data area is stored using the offset value from the head address of the monitor data area.
16 USING COMMUNICATION DATA MONITORING FUNCTION (g) b15 b14 b13 b12 b11 b10 MELSEC-Q The monitor data area (Default addresses: 2602H to 32FFH /3302H to 3FFFH) The monitor data are stored in one-word units as shown in the configuration below. See Section 16.3 for an example of the communication data monitoring.
16 USING COMMUNICATION DATA MONITORING FUNCTION MELSEC-Q 16.3 Communication Data Monitoring Example The following is an example of the data monitoring of nonprocedural protocol communication. (1) System configuration The system configuration for the sample program is as shown below. The CH used for operation of this sample program is CH1 only.
16 USING COMMUNICATION DATA MONITORING FUNCTION (C) MELSEC-Q Sample program Monitor data area is cleared to 0.
16 USING COMMUNICATION DATA MONITORING FUNCTION MELSEC-Q (3) Confirming monitor data by GX Developer The monitor data area for CH1 (Address: 2602H to 32FFH) is monitored on the buffer memory batch monitoring screen of the GX Developer. See Section 16.2 (2) (g) for the data configuration of the monitor data area. (Example) The following data are sent from CH1 using non procedure protocol.
17 DEDICATED INSTRUCTIONS MELSEC-Q 17 DEDICATED INSTRUCTIONS Dedicated instructions are used to simplify programming when using the intelligent functional module functions. Among the dedicated instructions for the Q series C24 explained in this manual, this chapter focuses on the instructions that can be used for QCPU. 17.1 Dedicated Instruction List The following table lists the dedicated instructions explained in this chapter.
17 DEDICATED INSTRUCTIONS MELSEC-Q 17.2 BUFRCVS Instruction Applicable device Internal device Setting data Bit (S) MELSECNET/H, MELSECNET/10 Direct J \ File register Word Bit Word Special module U \G — Index register Zn Constant Others — (D) — [Instruction code] [Executing condition] [Instruction format] BUFRCVS Z.
17 DEDICATED INSTRUCTIONS MELSEC-Q Functions (1) This instruction stores data received from an external device to a designated device. (2) This instruction can identify the address of the reception area in the buffer memory and read relevant receive data. (3) When this instruction is executed, reception is completed and the reception data read request signal (X3/XA) or the reception abnormal detection signal (X4/XB) is turned off automatically.
17 DEDICATED INSTRUCTIONS MELSEC-Q Precaution when using the BUFRCVS instruction (1) Use the BUFRCVS instruction when receiving data via an interrupt program. (2) If reading of data received is to be done for the same interface, data cannot be received by the main program when the receiving of data is done by an interrupt program. Thus, the BUFRCVS instruction cannot be used together with the following instructions.
17 DEDICATED INSTRUCTIONS MELSEC-Q 17.3 CSET Instruction (PLC CPU Monitoring Register/Cancel) Applicable device Internal device Setting data Bit File register Word MELSECNET/H, MELSECNET/10 Direct J \ Bit Special module U \G Word Index register Zn (S1) — (S2) — — — (D1) — — (D2) Constant Others K, H — — [Instruction code] [Executing condition] [Instruction format] CSET ZP.
17 DEDICATED INSTRUCTIONS Device (S2)+6 Item (S2)+8 Setting data Setting range Designate the transmission measure. 0: Data transmission (device data, CPU abnormal information) 1: Notification 0, 1 User frame output head pointer Designate the head pointer of the table setting the user frame numbers for constant cycle transmission.
17 DEDICATED INSTRUCTIONS Device Item MELSEC-Q Setting data PLC CPU monitoring setting (S2)+22 to 2nd to 10 th (S2)+102 * 2nd to 10th block The same arrangement as the first PLC CPU monitoring setting item. (S2)+103 Set by — 1 (S2)+104 0 (S2)+105 Fixed value (S2)+106 Designate the fixed value when the CPU status monitoring is performed.
17 DEDICATED INSTRUCTIONS MELSEC-Q Functions (1) To register the PLC CPU monitoring, this instruction registers data necessary for the Q series C24 to execute the PLC CPU monitoring function. When the data registration to execute the PLC CPU monitoring function is completed normally, the Q series C24 begins monitoring the PLC CPU and transmitting monitoring results to an external device. (2) To cancel the PLC CPU monitoring, this instruction ends the Q series C24's monitoring operation of the PLC CPU.
17 DEDICATED INSTRUCTIONS MELSEC-Q [Operation when a CSET instruction is being executed] Sequence program CSET instruction Scan END processing Scan END processing Scan END processing Instruction execution Completion device Abnormal completion Completion device + 1 Q series C24 Setting processing Errors (1) When the dedicated instruction is completed abnormally, the error flag (SM0) turns on and the error code is stored in SD0.
17 DEDICATED INSTRUCTIONS MELSEC-Q Program example (1) A program that registers the PLC CPU monitoring The following example shows how to register the PLC CPU monitoring and send the monitoring results from the interface on the CH1 side. The following registration is done to send the contents of M0 to M15 and D100 to D109 to the external device on a constant cycle (cycle time is 3 min).
17 DEDICATED INSTRUCTIONS MELSEC-Q 17.4 CSET Instruction (Initial Settings) Applicable device Internal device Setting data Bit File register Word MELSECNET/H, MELSECNET/10 Direct J \ Bit Special module U \G Word Index register Zn (S1) — (S2) — — — (D1) — — (D2) Constant Others K, H — — [Instruction code] [Executing condition] [Instruction format] CSET ZP.
17 DEDICATED INSTRUCTIONS Device Item MELSEC-Q Setting data Setting range (S2)+4 On-demand function buffer memory head address Designate the head address of the buffer memory used with the on-demand function. 0H: Use the current setting value 400H to 1AFFH, 2600H to 3FFFH : Head address 0H, 400H to 1AFFH, 2600H to 3FFFH (S2)+5 On-demand function buffer memory size Designate the size (word number) of the buffer memory used with the on-demand function.
17 DEDICATED INSTRUCTIONS MELSEC-Q Functions (1) This instruction changes the current values of the settings below to transmit/receive data using the following communication protocols: • Data count unit (word/byte) of the data to be transmitted/received • Transmission area in the buffer memory used by the on-demand function of the MC protocol • Transmission and reception areas in the buffer memory used with the nonprocedure protocol • Transmission and reception areas in the buffer memory used with the bid
17 DEDICATED INSTRUCTIONS MELSEC-Q Errors (1) When the dedicated instruction is completed abnormally, the error flag (SM0) turns on and the error code is stored in SD0. See the following manuals regarding the error code, and check the errors and take corrective actions. 4FFFH or less : QCPU (Q Mode) User's Manual (Hardware Design, Maintenance and Inspection) 7000H or higher: Section 10.
17 DEDICATED INSTRUCTIONS MELSEC-Q 17.5 GETE Instruction Applicable device Internal device Setting data Bit File register Word MELSECNET/H, MELSECNET/10 Direct J \ Bit Word Special module U \G Index register Zn (S1) — — (S2) — — (D) Constant Others — [Instruction code] [Executing condition] Command GETE G.GETE Un (S1) (S2) (D) GP.
17 DEDICATED INSTRUCTIONS MELSEC-Q Functions (1) This instruction reads data from the user frame in the Q series C24 as designated by Un. QCPU (S2) +0 +1 +2 Q series C24 b15 to b8 b7 B D F to b0 A C E User frame A B C D E F Read Read byte length (2) While the GETE instruction is being executed, no other GETE or PUTE instructions can be executed.
17 DEDICATED INSTRUCTIONS MELSEC-Q Errors (1) When the dedicated instruction is completed with an error, the complete status display device at completion ((D)+1), turns on and the error code is stored in the control data read result ((S1)+1). See the following manuals regarding the error code, and check the errors and take corrective actions. 4FFFH or less : QCPU (Q Mode) User's Manual (Hardware Design, Maintenance and Inspection) 7000H or higher: Section 10.
17 DEDICATED INSTRUCTIONS MELSEC-Q 17.6 PRR Instruction Applicable device Internal device Setting data Bit (S) File register Word MELSECNET/H, MELSECNET/10 Direct J \ Bit Special module U \G Word — Index register Zn Constant Others — (D) — [Instruction code] [Executing condition] Command PRR G.PRR Un (S) (D) GP.
17 DEDICATED INSTRUCTIONS MELSEC-Q Functions (1) This instruction transmits the user frame data using the non procedure protocol of the Q series C24 as designated by Un, according to the control data stored in the device designated by (S) and succeeding devices, as well as the transmission user frame designation area of the Q series C24. (2) The following instructions cannot be executed on a channel on which a PRR instruction is being executed.
17 DEDICATED INSTRUCTIONS MELSEC-Q Program example A program that sends arbitrary data and the first to fifth user frames registered in the output frame setting. When the input/output signals of the Q series C24 are X/Y80 to X/Y9F Transmission instruction Sets arbitrary transmission data. Sets the number of transmitted data. Sets the transmission user frames in D5 to D9. Sets output frame No. in the buffer memory. Sets CH1 to the transmission channel.
17 DEDICATED INSTRUCTIONS MELSEC-Q 17.7 PUTE Instruction Applicable device Setting data Internal device Bit File register Word MELSECNET/H, MELSECNET/10 Direct J \ Bit Word Special module U \G Index register Zn (S1) — — (S2) — — (D) Constant Others — [Instruction code] [Executing condition] Command PUTE G.PUTE Un (S1) (S2) (D) GP.
17 DEDICATED INSTRUCTIONS MELSEC-Q Functions (1) This instruction registers or deletes the user frame for the Q series C24 as designated by Un. (2) When registering a user frame (a) When registering a user frame, set 1 to the device for (S1)+0. Data in the device designated by (S2) and after will be registered according to the control data. (b) The registered data should be stored in the device designated by (S2) and after as described below.
17 DEDICATED INSTRUCTIONS MELSEC-Q (5) Whether the PUTE instruction was completed normally or abnormally can be checked with the completion device (D) or status display device at completion (D+1). (a) Completion device Turns on at the END processing of the scan where the PUTE instruction is completed, and turns off at the next END processing. (b) Status display device at completion Turns on and off depending on the completion status of the PUTE instruction.
17 DEDICATED INSTRUCTIONS MELSEC-Q Program example A program that registers the user frame having registration number 3E8H.
17 DEDICATED INSTRUCTIONS MELSEC-Q 17.8 UINI Instruction Changes the mode, transmission specifications and host station number of the Q series C24. Applicable device Setting data Internal device Bit (S) File register Word MELSECNET/H, MELSECNET/10 Direct J \ Bit Special module U \G Word — Index register Zn Constant Others — (D) — [Instruction code] [Executing condition] Command ZP.
17 DEDICATED INSTRUCTIONS MELSEC-Q (1) (S)+3 (CH1 transmission specifications setting) and (S)+5 (CH2 transmission 1 specifications setting) b15 to b8 b7 b6 b5 b4 b3 b2 b1 b0 0 00H to 0FH 00H to 0FH CH1 side CH2 side Description Bit OFF(0) ON(1) b0 Operation setting Independent Link b1 b2 Data bit Parity bit 7 NO 8 Yes b3 Even/odd parity Odd Even Remarks Be sure to set the CH1 side ((S)+3) to OFF(0). Parity bit is not included. Vertical parity Valid only when parity bit is set to Yes.
17 DEDICATED INSTRUCTIONS MELSEC-Q REMARK (1) For information about errors caused by incorrect data designated by the user, see the description in "Errors" on the next page. (2) The "Set by" column indicates the following: • User : Data set by the user before executing the dedicated instruction. • System: The PLC CPU stores execution results of the dedicated instruction. Functions (1) This instruction changes the transmission specifications, communication protocol and host station No.
17 DEDICATED INSTRUCTIONS MELSEC-Q [Operation when the UINI instruction is executed] Sequence program END processing END processing END processing END processing UINI instruction execution UINI instruction ON Completion device OFF Error ON completion Status indication OFF device at completion Normal completion One scan ON Mode switching signal (X6/XD) Q series C24 OFF Setting processing Communication disabled Errors When the dedicated instruction is completed with an error, the status display
17 DEDICATED INSTRUCTIONS MELSEC-Q Program example The settings of the Q series C24 installed in the position of I/O No. X/Y00 to X/Y1F are changed as indicated below when X20 is turned on.
17 DEDICATED INSTRUCTIONS MELSEC-Q Clears the control data. UINI CH1 mode CH2 mode CH1 mode CH2 mode instruction switching switching switching switching command request request Always sets 0. Clears the execution result to 0. Sets the execution type to 0. Sets the CH1 transmission specifications. Sets the CH1 communication protocol. Sets the CH2 transmission specifications. Sets the CH2 communication protocol. Sets the host station No. Executes the UINI instruction.
17 DEDICATED INSTRUCTIONS MELSEC-Q Precautions (1) Execute the UINI instruction after stopping all data communications with the other device. Otherwise, the following will occur. (a) When the UINI instruction is executed during receive processing The receive processing is stopped and the reception data accumulated until then are all discarded. (b) When the UINI instruction is executed during transmission processing The transmission processing is stopped upon acceptance of the UINI instruction.
INDEX Ind [A] [H] Additional codes ........................................ 12-1 ASCII-BIN conversion ............................... 13-1 Half-duplex communications .......................8-1 [I] [B] I/O signals for handshake (for mode switching)...................................15-5 I/O signals with the PLC CPU (modem function) .......................................3-31 Improper access............................... 3-16, 3-47 Information to be transmitted .....................
[P] [U] PLC CPU monitoring function ..................... 2-1 PRR instruction........................................ 17-18 PUTE instruction...................................... 17-21 Ind [R] UINI instruction.........................................17-25 User frame....................................................9-1 User frame setting for reception ..............11-15 [V] Receive procedure (user frame) ............. 11-14 Receiving data with an interrupt program...
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.
Microsoft, Windows, Windows NT are registered trademarks of Microsoft Corporation in the United States and other countries. Adobe and Acrobat are registered trademarks of Adobe Systems Incorporation. Pentium and Celeron are trademarks of Intel Corporation in the United States and other countries. Ethernet is a trademark of Xerox Co., Ltd. in the United States. Other company names and product names used in this document are trademarks or registered trademarks of respective owners.
Q Corresponding Serial Communication Module U User's Manual (Application) Q Corresponding Serial Communication Module User's Manual (Application) Q Corresponding Serial Communication Module User's Manual (Application) MODEL QJ71C24-U-OU-E MODEL CODE 13JL87 SH(NA)-080007-G(0409)MEE HEAD OFFICE : 1-8-12, OFFICE TOWER Z 14F HARUMI CHUO-KU 104-6212,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 Min