Appendix 3.2Example Of Creating A Structured Program - Mitsubishi Electric MELSEC Q Series Structured Programming Manual

Fundamentals
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

Appendix 3.2
This section shows an example of creating a sequence program same as the program created in
GX Developer using GX Works2.
The following examples explain the method for creating a structured program same as the data
receive program for a Q-compatible serial communication module, using the structured ladder/
FBD and ST languages.
The following shows the original program.
(1) Replacing devices with labels
Replace devices of the original program with labels.
Replace input/output devices with global labels. For devices such as internal relays, replace
them with local labels.
Device
X3
X4
D0
D1
D2
D3
D10 to D109
D110 to D209
M0
M1
M100
X100
Appendix 3 Recreating Ladder Programs
App-10
Appendix 3.2 Example of creating a structured program
Example of creating a structured program
Table App. 3.2-1 Examples of replacement from devices to labels
Purpose
CH1 reception data read request
CH1 reception abnormal detection
Reception channel
Reception result
Control data
Number of reception data
Number of allowable reception
data
Reception data
Reception data storage area
Data
Completion flag
reception
completion
Status flag at completion
flag
Abnormal completion flag
Abnormal completion flag reset command
Specify the receive channel.
Clear the reception result and receive data count
storage device to 0.
Specify the allowable receive data count.
With normal completion, the receive data within the
allowable receive data count (user specified) is read
from the receive data storage area in the buffer memory.
Once the INPUT instruction is executed, the user
specified read completion signal (M0) turns ON for
1 scan.
The reading of receive data and switching of the
ON/OFF status are performed by the programmable
controller CPU.
The abnormal completion flag is reset by an external
command.
Label
Data type
Bit
CH1ReadRequest
Bit
CH1AbnormalDetection
Word (unsigned)/16-bit
ControlData
string [0] to [3]
Word (unsigned)/16-bit
ReceiveData
string [0] to [99]
Word (unsigned)/16-bit
Data
string [0] to [99]
Bit [0] to [1]
Completion
Bit
AbnormalCompletion
Bit
ResetAbnormalCompletion
Label name

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l seriesMelsec-f

Table of Contents