111
Chapter 8: C Programming
5. This example demonstrates usage of the DATA LOGGER from within a C program. Thisprogram will run the data logger when an input is alarmed.
int loggin;
main()
{
if (exists==1) /* Checks for an active alarm */
{
if (loggin==0) /* Checks to see if data logger already running */
{
data(0,0,30,1); /* If not, start the data logger */
loggin = 1; /* Do not restart the logger until it has been turned off*/
}
}
else
{ /* No active alarms */
if (loggin==1)
{
data(0,0,30,0); /* If no alarms exist, turn off data logger */
loggin = 0; /* So that it can be restarted next time */
}
}
}