Panasonic FP Series Programming Manual page 420

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F301_BCOS
The function calculates the cosine of BCD code angular data (input s) and stores the result (output
Description
d) as a BCD value in an array with three elements.
BCD values for input s lie in the area from 0° to 360° (16#0 to 16#360) in 1° steps. With this output
d can yield a result in the range of -1.0000 to 1.0000. The result is returned as follows:
ARRAY[0]
ARRAY[1]
ARRAY[2]
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
Availability of F301_BCOS (see page 1323)
PLC types
Data types
Variable
Data type
WORD
s
ARRAY [0..2] of
d
WORD
Operands
For
WX
s
-
d
Error flags
No.
IEC address
%MX0.900.7
R9007
%MX0.900.8
R9008
%MX0.900.11
R900B
%MX0.900.9
R9009
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
BCD type Cosine operation
preceding sign (0 when input is +, 1 when input is -)
whole number before the decimal point (0 or 1)
numbers after the decimal point with 4 significant figures as a BCD value (16#0000 to
16#9999).
Function
area where angle data is stored
result stored in 3 words
Relay
T/C
WY
WR
WL
SV
WY
WR
WL
SV
Set
permanently
for an instant
for an instant
for an instant
Register
EV
DT
LD
FL
EV
DT
LD
FL
If
 the input value for s is not a BCD value
or is not between 0° and 360°.
 the result is 0.
 the result causes an overflow.
Arithmetic instructions
Constant
dec. or hex.
-
419

Advertisement

Table of Contents
loading

Table of Contents