Mitsubishi Electronics QCPU Welding System User Manual


  Open as PDF
of 1204
 
7-268
ACOS(P)
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
an error code is stored into SD0.
The value designated by is outside the range of from 1.0 to 1.0. (Error code: 4100)
The contents of the designated device or the result of the addition are not "0", or not within
the following range(For the Universal model QCPU only): (Error code: 4140)
0, 2
-126
| Contents of designated device | < 2
128
The value of the specified device is 0.
*2
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU) (Error code: 4100)
*2: There are CPU modules that will not result in an operation error if 0 is specified. Refer to 3.2.4 for details.
The result exceeds the following range (Operation results in an overflow)
(For the Universal model QCPU only)
2
128
| Operation result | (Error code: 4141)
The value of the specified device is 0, unnormalized number, nonnumeric, and ± .
(For the Universal model QCPU only) (Error code: 4140)
Program Example
(1) The following program seeks the inverse cosine of the 32-bit floating decimal point real
number at D0 and D1, and outputs the angle to the 4 BCD digits at Y40 to Y4F.
[Ladder Mode]
[List Mode]
[Operations involved when the D0 and D1 value is 0.5]
S
Calculates an angle (radian value)
by COS
-1
operation ( )
Converts the radian value into an angle ( )
Converts the angle in 32-bit floating-point
real number into an integer ( )
Outputs the integer-converted angle
to a display device ( )
1
2
3
4
Step Instruction Device
Conversion
to BIN
32-bit floating-point
real number
D21
D20
INT
BCD operation
BCD
ACOS
Conversion to angle
DEG
Y4F
BCD value
0060
Y40
D30
b15
b0
BIN value
60
32-bit floating-point
real number
D1
D0
32-bit floating-point
real number
D11
D10
COS
-1
operation
0
.
5
1
.
047
1
98
60