3 logical operators, Logical operators -33, Script – IDEC High Performance Series User Manual

Page 997

Advertising
background image

WindO/I-NV2 User’s Manual

20-33

5 Script Coding Examples

20

Script

5.3 Logical Operators

Script

Operation description
If the value of LDR100 is equal to the value of LDR200, and if the value of LDR300 is equal to the value of LDR400
and LDR500 added together, then 100 is stored in LDR600.
If either ([LDR 100] == [LDR 200]) or ([LDR 300] == [LDR 400] + [LDR 500]) is false, the processing in the brackets
“{ }” is not executed.

Script

Operation description
If the value of LDR100 is not 0 or the value of LDR200 is not 0, then 100 is stored in LDR300.
If either is true, the processing in the brackets “{ }” is executed.

Script

Operation description
If the value of LDR100 is not equal to 0x1234, then 100 is stored in LDR300.

Script

Operation description
If the value of LDR100 is 0, then 100 is stored in LDR300.
This is the same as the code “if (0==[LDR 100]))”.

Example 5.3.1

Logical AND

if (([LDR 100] == [LDR 200]) && ([LDR 300] == [LDR 400] + [LDR 500]))

{

[LDR 600] = 100;

}

Example 5.3.2

Logical OR

if ((0 != [LDR 100]) || (0 != [LDR 200]))

{

[LDR 300] = 100;

}

Example 5.3.3

Logical inversion

if (!([LDR 100] == 0x1234))

{

[LDR 300] = 100;

}

Example 5.3.4

Logical inversion

if (!(0 !=[LDR 100]))

{

[LDR 300] = 100 ;

}

Advertising
This manual is related to the following products: