Chapter 4 Operation Control Programs; Operation Control Programs - Mitsubishi Electric R16MTCPU Programming Manual

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

4

OPERATION CONTROL PROGRAMS

4.1
Operation Control Programs
Operation control programs
• Substitution operation expressions, motion-dedicated functions and bit device control commands can be set in operation
control program.
• Multiple blocks in one operation control program can be set.
• There are no restrictions on the number of blocks that may be set in one operation control program. However, one program
is within 128k bytes.
• The maximum number of characters in one block is 1020.
• Transition conditions cannot be set. Transition conditions can be set only in transition programs.
• The bit conditional expression that logical data value (true or false) is returned in an operation control program, a
comparison conditional expression can be set up only as a source (S) of device set (SET=) or device reset (RST=).
An operation control program example is shown below.
#0=D0+(D1+D2)*#5//Substitution expression (four arithmetic operations)
W0:F=SIN(#10F)//Substitution expression (standard function)
CHGV(K2,K10)//Motion-dedicated function
SET M100=M0+X0//Bit device control (SET=)
RST M10=!X0//Bit device control (RST=)
DIN D0,X0//Bit device control (DIN)
Comment
Priorities of operators and functions
Operators and functions have the following priorities. Using parentheses allows an operation sequence to be specified freely.
Priority
High
1
2
3
Low
4
5
6
7
8
9
10
11
12
13
14
Item (Operator, Function)
Calculation within parentheses ((...))
Standard function (SIN, COS, etc.), Type conversion (USHORT, LONG, etc.)
Bit inversion (~), logical negation (!), sign inversion (-)
Multiplication (*), division (/), remainder (%)
Addition (+), subtraction (-)
Bit left shift (<<), bit right shift (>>)
Comparison operators: Less than (<), less than or equal to (<=), more than (>), more than or equal to (>=)
Comparison operators: Equal to (==), not equal to (!=)
Bit logical AND (&)
Bit exclusive OR (^)
Bit logical OR (|)
Logical AND (*)
Logical OR (+)
Substitution (=)
1 block
1 program
4 OPERATION CONTROL PROGRAMS
4.1 Operation Control Programs
4
117

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents