IDEC High Performance Series User Manual

Page 990

Advertising
background image

5 Script Coding Examples

20-26

WindO/I-NV2 User’s Manual

Script

Operation description
If either the value of LDR100 or the value of LDR200 is not 0, then 100 is stored in LDR300.
If the value of both LDR100 and LDR200 is 0, 100 is added to LDR500 and that value is stored in LDR400.

Script

Operation description
If the value of LDR100 is 0, then 0x1234 is stored in LDR200.
If the value of LDR100 is 1, then 0x5678 is stored in LDR200.
If the value of LDR100 is not 0 or 1, then 0x9999 is stored in LDR200.

Script

Operation description
If the values of LDR100, LDR200, and LDR300 are all not 0, then 100 is stored in LDR400.
If the values of LDR100 and LDR200 are not 0 and the value of LDR300 is 0, then 200 is stored in LDR400.
If either the value of LDR100 or LDR200 is 0, then nothing is executed regardless of the value of LDR300.

Example 5.1.4

Conditional branching

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

{

[LDR 300] = 100;

}

else

{

[LDR 400] = [LDR 500] + 100;

}

Example 5.1.5

Conditional branching

if ([LDR 100] == 0)

{

[LDR 200] = 0x1234;

}

else if ([LDR 100] == 1)

{

[LDR 200] = 0x5678;

}

else

{

[LDR 200] = 0x9999;

}

Example 5.1.6

Conditional branching

if ([LDR 100])

{

if ([LDR 200])

{

if ([LDR300])

{

[LDR 400] = 100;

}

else

{

[LDR 400] = 200;

}

}

}

Advertising
This manual is related to the following products: