Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
29 Applied Instructions (Data Table Operation)
29.2 BAND / Dead Band Control
685
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
Cautions
1) When the output value overflows, it is handled as follows:
a) In the 16-bit operation
The output value is a 16-bit binary value with sign. Accordingly, if the operation result is outside the
range from -32768 to 32767, it is handled as follows:
b) In the 32-bit operation
The output value is a 32-bit binary value with sign. Accordingly, if the operation result is outside the
range from -2,147,483,648 to 2,147,483,647, it is handled as follows:
Error
An operation error is caused when the instruction is executed in the setting status shown below. The error flag
M8067 turns ON, and the error code (K6706) is stored in D8067.
(Contents of the device specified by ) > (contents of the device specified by )
Program example
1. Program example 1
In the program example shown below, the BCD data set in X020 to X037 is controlled by the dead band from
"-1000" to "1000", and a controlled value is output to D1 when X000 turns ON.
Operation
1) In the case of "D0 < (-1000)", "D0 - (-1000)" is set to D1.
2) In the case of "(-1000 D0 1000", "0" is output to D1.
3) In the case of "1000 < D0", "D0 - 1000" is output to D1.
Lower limit value of dead band =10
Input value =-32,768
Output value=-32,768-10
=8000H-AH
=7FF6H
=32,758
s1
s3
Lower limit value of dead band =1000
s1
Input value =-2,147,483,648
s3
Output value=-2,147,483,648-1000
=8000000H-000003E8H
=7FFFFC18H
=2,147,482,648
X000
BIN
EN
s
ENO
d
K4X020 D0
BAND
EN ENO
d
s1
s2
s3
K-1000
K1000
D0
D1
[Structured ladder/FBD]
[ST]
BIN(X000,K4X020,D0);
BAND(X000,K-1000,K1000,D0,D1);
Input
0
Output
1000
-1000
Input
Output