55xGenComm1_29 0755-27153030 0755-27732300
46
EXAMPLE : Displaying alarm strings
In the section headed “GenComm Page3” we saw an example to check whether or not an alarm
was present on the control module. The only information we could get from this example was
whether or not an alarm was present, and if so, whether it was a warning, shutdown or electrical
trip alarm.
Once we have this information, we can drill down further to identify the exact alarms that are
present. First, we identify the “alarm block” numbers that are active, then use this information to
read the alarm text from the control module. This can be used on a display system to exactly
indicate the alarms that are present, or could be logged to a data file for use on a fault logging
system.
if ( readpage3() == successful)
{
if ( ( ( page3[6] >> 12 ) & 1 ) == 1 ) shutdown = true;
if ( ( ( page3[6] >> 11 ) & 1 ) == 1 ) electrip = true;
if ( ( ( page3[6] >> 10 ) & 1 ) == 1 ) warning = true
if ( shutdown || warning || electrip )
{
readpage8();
for ( x = 0; x < 131; x++ )
{
alarm1 = ( page8[x] & 15 );
if ( ( alarm1 = 2 ) || ( alarm1==3 ) || ( alarm1 == 4) ) showstring( page((31+x) * 256), register(224));
alarm2 = ( ( ( page8[x] >> 4 ) & 15 ) );
if ( ( alarm2 = 2 ) || ( alarm2==3 ) || ( alarm2 == 4) ) showstring( page((31+x) * 256), register(160));
alarm3 = ( ( ( page8[x] >> 8 ) & 15 ) );
if ( ( alarm3 = 2 ) || ( alarm3==3 ) || ( alarm3 == 4) ) showstring( page((31+x) * 256), register(96));
alarm4 = ( ( ( page8[x] >> 12 ) & 15 ) );
if ( ( alarm4 = 2 ) || ( alarm4==3 ) || ( alarm4 == 4) ) showstring( page((31+x) * 256), register(32));
}
}
}
NOTE:- the for loop above is used to economically loop through the alarm
registers, and test the condition of each of the four alarm blocks contained within each
register.
If an alarm is active (when its value is 2,3 or 4, meaning Shutdown, Electrical Trip or
Warning) then the pseudo function ShowString in the example above will read the
required GenComm page from the control module. It will then display the 32 character
unicode string contained at the offset specified by Register.
NOTE:- Active string boundaries are at Registers 32, 96,160 & 224 within
GenComm pages 32 to 96. Using these offsets directly saves having to calculate the
address every time.