Program Example - Mitsubishi Electric MELSEC iQ-R RJ71LP21-25 User Manual

Melsecnet/h network module
Hide thumbs Also See for MELSEC iQ-R RJ71LP21-25:
Table of Contents

Advertisement

Program example

This section describes program examples.
Program example of cyclic transmission
The values in D0 to D3 of the control station (station No.1) are sent to D100 to D103 of the normal station (station No.2)
through cyclic transmission.
When creating a program, configure an interlock using 'Data link error status of own station' (SB0049) and 'Data link status of
each station' (SW0074 to SW0077).
■Overview of the sending station (control station (station No.1)) program example
• When bHandShake1 and bHandShake2 are turned off, send the values in D0 to D3 (uOutputData[0] to uOutputData[3]) to
W0 to W3 (uData[0] to uData[3]). To notify the receiving station that the data was sent, turn bHandShake1 on.
• Check that the receiving station received the data by checking that bHandShake2 is on, and turn bHandShake1 off to
complete the send processing.
■Overview of the receiving station (normal station (station No.2)) program example
• Check with bHandShake1 that the data was sent, and transfer (receive) the values in W0 to W3 (uData[0] to uData[3]) to
D100 to D103 (uInputData[0] to uInputData[3]). To notify the sending station that the data was received, turn bHandShake2
on.
• Check that the send processing is complete by checking that bHandShake1 is off, and turn bHandShake2 off to complete
the receive processing.
■Program example
• Control station (station No.1)
Classification
Label name
Module label
LP21_1.bDetect_DataLinkError
LP21_1.bnSts_CyclicTransmissionError_Station[2]
Label to be defined
Define global labels as shown below:
Description
Data link error status of own station
Data link status of each station
(station No.2)
7 COMMUNICATION EXAMPLES
7.1 Cyclic Transmission Program
7
Device
SB0049
SW0074.1
37

Advertisement

Table of Contents
loading

Table of Contents