IF
- Used to make decisions.
Example:
main ()
{
if (read_uaf(input,0,0)>100)
{
write_uaf(output,0,0,on);
}
}
ELSE
- Used with IF to execute a statement when the IF condition is false.
Example:
main ()
{
if (read_uaf(input,0,0)>100)
{
write_uaf(output,0,0,on);
}
else
{
write_uaf(output,0,0,off);
}
}
FOR
- Used to execute a statement (or statements) multiple times. Contains a start condi-
tion, a stop condition, and a control statement. The following example starts a counter at one,
checks that it is less than nine, and executes the output statement. Then it adds one to the
counter and checks that it is still less than nine. When the counter equals nine, the FOR loop
is finished. The output statement in this program turns outputs 0 through 8 off, on the main
board.
float count;
main ()
{
for (count=0; count<9; count=count+1)
{
write_uaf(output,0,count,off);
}
}
DO
- Used to execute a list of statements while a condition is true. The statements are always
executed at least once. The following example always sets output 0 on and keeps it on as long
as input 0 is greater than 100.
Example:
main ()
{
do {
write_uaf(output,0,0,on);
} while (read_uaf(input,0,0)>100);
}
16-5
Chapter 16: Programming in C
Содержание Sensaphone SCADA 3000
Страница 1: ...Sensaphone SCADA 3000 User s Manual Version 2 34...
Страница 6: ...vi SCADA 3000 User s Manual...
Страница 10: ...x SCADA 3000 User s Manual...
Страница 30: ...1 6 SCADA 3000 User s Manual...
Страница 48: ...4 6 SCADA 3000 User s Manual...
Страница 70: ...9 8 SCADA 3000 User s Manual...
Страница 122: ...12 8 SCADA 3000 User s Manual...
Страница 190: ...15 30 SCADA 3000 User s Manual...
Страница 211: ...lead 1 lag 0 else lead 0 lag 1 16 21 Chapter 16 Programming in C...
Страница 212: ...16 22 SCADA 3000 User s Manual...
Страница 236: ...21 8 SCADA 3000 User s Manual...
Страница 248: ...22 12 SCADA 3000 User s Manual...
Страница 258: ...23 10 SCADA 3000 User s Manual...
Страница 274: ...25 8 SCADA 3000 User s Manual...
Страница 288: ...27 8 SCADA 3000 User s Manual...
Страница 294: ...28 6 SCADA 3000 User s Manual...
Страница 296: ...A 2 SCADA 3000 User s Manual...
Страница 302: ...D 2 SCADA 3000 User s Manual...
Страница 318: ...I 2 SCADA 3000 User s Manual...
Страница 320: ...J 2 SCADA 3000 User s Manual...
Страница 322: ...K 2 SCADA 3000 User s Manual...
Страница 335: ...Test Log...
Страница 336: ......