55xGenComm1_29
37
EXAMPLE : Interrogating current module mode
This example demonstrates the use of the “module mode” status register.
if ( ReadPage3() == SUCCESSFUL)
{
if ( page3[4] == 1 ) printf (“system in auto mode”);
else printf( “warning - system not in auto mode)”;
}
else
{
printf( “gencomm page3 could not be read)!”;
}
EXAMPLE : Testing for alarm conditions
This example demonstrates how to read the alarm status from the control module. Although the
actual alarm itself is still not identified at this point, the information can be used to provide
operational status of the control system. For instance checking that no alarms are present and that
the controller is in the AUTO mode (see example above) can be used to inform the monitoring
system that the controller is ready should it be required to start the set upon a mains failure.
For details of how to use this information to detail the exact alarms that are active on the system,
see the example following the section headed “GenComm Page 8”.
If (ReadPage3() == SUCCESSFUL)
{
If ( ( ( Page3[6] >> 12 ) & 1 ) == 1 ) prinft( “Shutdown Alarm”);
If ( ( ( Page3[6] >> 11 ) & 1 ) == 1 ) prinft( “Electrical Trip Alarm”);
If ( ( ( Page3[6] >> 10 ) & 1 ) == 1 printf( “Warning Alarm”);
}
else
{
printf( “GenComm page3 could not be read!”);
}
NOTE:-if ( ( ( Page3[6] >> 12 ) & 1 ) == 1 ) will return true if bit 12 of
GenCommPage3, register 6 is set.