9. Program
9.6. Protocol Macro Data
Protocol macro data consists of sequence, step, send/receive message, and matrix. Its composition is described as follows:
● When there is only one receive message format for a step (send/receive once)
•Set one send message and one receive message for the step
Sequence No.900 Step No.00 Send message 00 Receive message 00
•
• Step No.yy Send message yy Receive message yy
Sequence No. xxx xxx: 999 max. yy: 15 max
● When there are several types of receive message formats for a step (send/receive once)
•Set the send message and matrix for the step
•Set several types of cases (receive messages) for the matrix
Sequence No.900 Step No.00 Send message 00 <Matrix>
Case No.00 Receive message
00 Step No.yy
•
•
•
yy: 15 max zz: 14 max Case No.zz Receive message zz Sequence No. xxx xxx: 999 max Case No.15 is automatically set Case No.15 Other
9.6.1. Composition of Protocol Macro Data
In this protocol macro data, there is only 1 type of receive message (SD_RDCODE) for the send message (SD_RDCODE). Therefore, the following composition is used without using the matrix. Refer to 9.6.6. Receive Message Settings for details.
Sequence No.900 Step No.00 SD_RDCODE RV_RDCODE
9.6.2. Protocol Macro Processing Procedure
This section describes the processing procedure of the protocol macro.
1. [Step No.00]
Issuing send message (SD_RDCODE)
2. When step No.00 ends normally When step No.00 ends in an error
3. Next Process: Terminates the communications sequence as an End.
Error Process: Interrupts the step as an Abort and terminates the communications sequence.
(End)
(End)
9.6.3. Sequence Settings
This protocol macro data performs Reading Trigger (read code) by using communications sequence No. 900. Set the timeout periods for the communications sequence.
Additional Information
Refer to 3-2 Sequence Attributes (Common to All Steps) of the CX-Protocol Operation Manual (Cat. No. W344) for details on sequence settings.
● Timeout period setting
The following is the settings of the timeout periods (Timer Tr, Tfr, and Tfs) which are set for the sequence.
[Communications sequence setting screen]
<Settings>
Item Description Explanation
Timer Tr
Receive wait monitoring
time
Monitors the time from the receive wait status to receiving the first data (header) in the step of the sequence.
This timer is set to 3 seconds in this protocol macro data.
Timer Tfr
Receive finished monitoring
time
Monitors the time from receiving the first data to the completion of the receiving in the step of the sequence.
This timer is set to 3 seconds in this protocol macro data.
Timer Tfs
Send finished monitoring
time
Monitors the time from the sending of the header to the sending of the last data.
This timer is set to 3 seconds in this protocol macro data.
Additional Information
Refer to Section 4-5 Calculation Method of Monitoring Time of the CX-Protocol Operation Manual (Cat. No. W344) for the calculation method of monitoring time.
9.6.4. Step Settings
This section describes the step settings for communications sequence No. 900. The settings include retry count, send/receive messages (message names), next process, and error process. The sequence of this protocol macro data includes Step No.00 only.
Additional Information
Refer to 3-3 Step Attributes of the CX-Protocol Operation Manual (Cat. No. W344) for details on step settings.
● Retry count setting
This section describes the retry count setting for the step. The step is retried for the
specified number of times (0 to 9 times) when an error occurs. If an error occurs after retries, the step moves to the error process.
The retry count is enabled for the Send&Receive command only.
<Step setting screen>
<Settings>
Step No. Retry count
00 3
● Send/Receive message (massage name) settings
This section describes the settings for the send/receive messages of the step. Here, a registered send message name and message name are selected.
<Step setting screen>
<Settings>
Step No. Send message Receive message
00 SD_RDCODE RV_RDCODE
●Next process and error process settings
This section describes the settings for the next process and error process of the step. The process set in the Next Column is executed when the step execution ends normally. If a communications error occurs, the process set in the Error Column is executed.
<Step setting screen>
<Settings>
Step No. Next process Error process
00 End Abort
<Process list>
Process. Description
End Ends the communications sequence.
Next Moves to the next step No.
Abort Interrupts the step and ends the communications sequence.
Goto Moves to the specified step number.
Matrix Uses the settings of the matrix.
9.6.5. Send Message Settings
This section explains the settings of the send message.
Additional Information
Refer to 3-4 Communication Message Attributes of the CX-Protocol Operation Manual (Cat.
No. W344) for details on send message settings.
<Send message setting screen>
●Settings of SD_RDCODE send message
<Settings>
<h>+"Z"+<t>
(1) (2) (3)
No. Code Description
(1) <h >(Header) Message data: Constant hex, Type: Code, Data: ESC (2) "Z" Message data: Constant ASCII
(3) <t>(Terminator *) Message data: Constant hex, Type: Code, Data: CR
* The footer for the Destination Device is the terminator for the protocol macro data.
Hereinafter, the term "terminator" is used.
<Send message command format>
This is the command format of the message that is sent from the SCU to the Destination Device according to the settings of SD_RDCODE.
<ESC> "Z" <CR>
Command Number of bytes
Description
Header 1 Fixed: <ESC> (#1B)
"Z" 1 Fixed: "Z" (#5A) (Reading Trigger command) Terminator 1 Fixed: <CR> (#0D)
9.6.6. Receive Message Settings
This section describes the settings of the receive message.
Additional Information
Refer to 3-4 Communication Message Attributes of the CX-Protocol Operation Manual (Cat.
No. W344) for details on receive message settings.
[Receive message setting screen]
●Setting of receive message RV_RDCODE
<Settings>
(W(1),*)+<t>
(1) (2)
No. Code Description
(1) (W(1),*) Message data: Symbol
All variable length data are read and stored from the first receive word, which is specified with the operand of the PMCR instruction, + 1 word. (With this program, data is stored from 5501.)
(2) <t>(Terminator) Message data: Constant hex, Type: Code, Data: CR
* The header <h> is set to None.
<Response format of receive message>
This is the response format of the receive message which is received by the SCU from the Destination Device according to the settings of RV_RDCODE.
Read code value <CR>
Command Number of
bytes Remarks
Data Variable
length Variable: Read code value Terminator 1 Fixed: <CR> (#0D)