Sensaphone SCADA 3000 Users manual User Manual

Page 195

Advertising
background image

16-9

Chapter 16: Programming in C

Example:

main ()

{

if (read_uaf(input,0,0)>100.0) /*If input 0 on main

board is greater than 100 */

{

write_uaf(output,0,0,on);

/* then set relay

output 0 on the main board to on */

}

}

RESET FUNCTION - Used to reset (acknowledge) the specified alarm in the SCADA 3000.

Summary:

int reset(x)

int x; alarm number: 0-63

Description
The reset function is used for acknowledging any alarm in the unit. The parameter of the func-

tion specifies the alarm number to be acknowledged.
RETURN VALUE - The reset function always returns a zero.

Example:

main ()

{

if (read_uaf(input,0,0)==1) /*If input 0 on main

board is closed */

{

reset (0); /* then acknowledge alarm 0 */

}

}

POWER FUNCTION - Mathematical function used to raise a value to the specified power.

Summary:

float pow (x,y);

float x:

float y;

Description
The Power function is used to raise a value X to the power specified by Y. The X parameter is

the operand and the Y parameter is the exponent.
RETURN VALUE - The Power function returns x raised to the y power.

Example: The following program will take the square root (1/2 power) of the value

of input 3 on the main board and store it in the variable c.

float a;

float b;

float c;

main()

{

a=read_uaf(input, 0.3);

b=1/2;

c=pow(a,b);

}

Advertising