An Introduction To Programming; Structure Of A Program Instruction - Mitsubishi MELSEC System Q Manual

Hide thumbs Also See for MELSEC System Q:
Table of Contents

Advertisement

An Introduction to Programming

4
An Introduction to Programming
A program consists of a sequence of program instructions. These instructions determine the
functionality of the PLC and they are processed sequentially, in the order in which they were
entered by the programmer. To create a PLC program you thus need to analyse the process to
be controlled and break it up into steps that can be represented by instructions. A program
instruction, represented by a line or "rung" in ladder diagram format, is the smallest unit of a
PLC application program.
4.1

Structure of a Program Instruction

A program instruction consists of the instruction itself (sometimes referred to as a command)
and one or more (in the case of applied instructions) operands, which in a PLC are references
to devices. Some instructions are entered on their own without specifying any operands –
these are the instructions that control program execution in the PLC.
Every instruction you enter is automatically assigned a step number that uniquely identifies its
position in the program. This is important because it is quite possible to enter the same instruc-
tion referring to the same device in several places in the program.
The illustrations below show how program instructions are represented in the Ladder Diagram
(LD, left) and Instruction List (IL, right) programming language formats:
X0
The instruction describes what is to be done, i.e. the function you want the controller to per-
form. The operand or device is what you want to perform the function on. Its designation con-
sists of two parts, the device name and the device address:
Examples of devices:
Device name
See Chapter 5 for a detailed description of the available devices.
The specific device is identified by its address. For example, since every controller has multiple
inputs you need to specify both the device name and the address in order to read a specific
input.
MELSEC System Q Beginners Manual
Device
Instruction
X 0
Device name
Type
X
Input
Y
Output
M
Relay
T
Timer
C
Counter
D
Data register
Structure of a Program Instruction
Instruction
Device address
Function
Input terminal on the PLC (e.g. connected to a switch)
Output terminal on the PLC (e.g. for a contactor or lamp)
A buffer memory in the PLC that can have two states, ON or OFF
A "time relay" that can be used to program timed functions
A counter
Data storage in the PLC in which you can store things like measured
values and the results of calculations.
Device
AND X0
4 – 1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents