Function, Script – IDEC High Performance Series User Manual
Page 983

WindO/I-NV2 User’s Manual
20-19
4 Script Definition Method
20
Script
■
Bit operator
●
Function
Device, constant, and temporary device are described as
,
,
,
... here.
■
Bit function
■
Word function
Arithmetic operation
(Continued to next page)
Operator
Format
Description
&
&
Calculates the logical product (AND) of each bit of
and
.
|
|
Calculates the logical sum (OR) of each bit of
and
.
^
^
Calculates the exclusive logical sum (XOR) of each bit of
and
.
~
~
Reverses the logic of each bits of
.
For word device and fixed values, 0 will be 65535, and 65535 will be 0.
For bit device, 0 will be 1, and 1 will be 0.
<<
<<
Shifts each bit of
to left for
bit(s).
>>
>>
Shifts each bit of
to right for
bit(s).
a
b
a
b
a
b
a
b
a
b
a
b
a
a
a
b
a
b
a
b
a
b
a
b
c
d
Function
Format
Description
Bit set
SET(
);
Turns bit device
to 1.
It will be same result as
= 1
;
.
Bit reset
RST(
);
Turns bit device
to 0.
It will be same result as
= 0
;
.
Bit reverse
REV(
);
Reverses the 1 and 0 of bit device
.
It will be same result as
= ~
;
.
a
a
a
a
a
a
a
a
a
a
Function
Format
Description
Maximum
value
MAX(
,
,
)
Maximum value out of
,
,
is returned.
• This can be used for all data types.
• Up to 15 arguments can be defined.
Minimum
value
MIN(
,
,
)
Minimum value out of
,
,
is returned.
• This can be used for all data types.
• Up to 15 arguments can be defined.
Exponential
function
EXP(
)
Exponential function of
is returned.
• This can only be used for data type float32.
Natural
logarithm
(Base: e)
LOGE(
)
Natural logarithm (base is e) for
is returned.
• This can only be used for data type float32.
• Set a value larger than 0 for argument.
Common
logarithm
(Base: 10)
LOG10(
)
Common logarithm (base is 10) for
is returned.
• This can only be used for data type float32.
• Set a value larger than 0 for argument.
Exponentiation
POW(
,
)
to the
power is returned.
• This can only be used for data type float32.
a
b
c
a
b
c
a
b
c
a
b
c
a
a
a
a
a
a
a
b
a
b