*DECK CSESAM
USETEXT TEXTOV
USETEXT TEXTCS
USETEXT TEXTSS
USETEXT TXTAPSS
USETEXT TXTSMCS
PROC CSESAM;
# TITLE - SEND ALARM(AND ERROR LOG) MESSAGE. #
BEGIN
#
** CSESAM - SEND ALARM MESSAGE.
*
* D.K. ENDO 82/03/31
*
* THIS PROCEDURE FORMATS THE ALARMS TO THE OPERATOR FROM THE IN-
* COMING ALM/OP/U SM, AND THE ENTRIES TO THE ERROR LOG FILE FROM THE
* INCOMING LOG/ER/U SM.
*
* PROC CSESAM
*
* ENTRY 1. ALM/OP/U OR LOG/ER/U SM FROM THE EVENT QUEUE.
*
* EXIT 1. FORMATTED ALARM TO THE OPERATOR RESPONSE QUEUE.
* 2. FORMATTED ENTRY TO THE ERROR LOG FILE.
*
#
#
**** PROC CSESAM - XREF LIST BEGINS.
#
XREF
BEGIN
PROC CSESLE; # SEND LOG (FILE) ENTRY #
PROC MESSAGE; # PUTS MESSAGES IN SYSTEMS FILES #
PROC SSBSBF; # STORE BIT FIELD #
FUNC SSDCAD U; # CONVERT ASCII TO DISPLAY CODE #
PROC SSTAQE; # ADD QUEUE ENTRY #
FUNC XCDD U; # CONVERT DECIMAL INTEGER TO DISPLAY CODE #
FUNC XCHD U; # CONVERT HEX INTEGER TO DISPLAY CODE #
END
#
****
#
DEF ERRLG # 4 #; # MESSAGE IDENTIFIER FOR THE ERROR LOG #
DEF LNM$TXTL # 30 #; # CHAR COUNT FOR LINE NAME TEXT #
DEF NNM$TXTL # 40 #; # CHAR COUNT FOR NPU NAME TEXT #
DEF NONTXT$ # 4 #; # NUMBER OF CHARS THAT ARE NOT TEXT #
ITEM A$CHAR U = 0; # ONE ASCII CHARACTER #
ITEM BPOS; # BIT POSITION OF SM TEXT POINTER #
ITEM CHARCNT; # MESSAGE CHARACTER COUNT #
ITEM CHARPOS; # BIT POSITION OF MESSAGE TEXT POINTER #
ITEM CNST1; # CONSTANT ---> 1 #
ITEM CNST2; # CONSTANT ---> 2 #
ITEM CNST3; # CONSTANT ---> 3 #
ITEM I; # LOOP INDUCTION VARIABLE #
ITEM ITEMP U = 0; # UNSIGNED INTEGER TEMPORARY #
ITEM MCC; # MESSAGE CHARACTER COUNT #
ITEM MWC; # WORD COUNT OF SM TEXT POINTER #
ITEM WC; # WORD COUNT OF MESSAGE TEXT POINTER #
#
THIS ARRAY DEFINES THE ALARM TO OPERATOR TEXT SENT WHEN A ALM/OP/U
SM IS RECEIVED.
#
DEF MX$ALM # 7 #;
ARRAY ALM$TXT [01:MX$ALM] S(1);
BEGIN
ITEM ALM$TIM C(00,00,10) = [" "];
ITEM ALM$WORD U(00,00,60);
END
#
THIS ARRAY DEFINES THE FORMAT OF THE ERROR LOG ENTRY SENT WHEN A
LOG/ER/U SM IS RECEIVED.
#
ARRAY ELT$TXT [00:00] S(4);
BEGIN
ITEM ELT$NW01 C(00,00,06) = ["NW01, "];
ITEM ELT$NID U(00,36,18);
ITEM ELT$C1 C(00,54,01) = [","];
ITEM ELT$EC U(01,00,12);
ITEM ELT$BYT1 U(01,12,12);
ITEM ELT$BYT2 U(01,24,12);
ITEM ELT$BYT3 U(01,36,12);
ITEM ELT$P1 C(01,48,01);
ITEM ELT$ZBYT1A U(01,54,06);
ITEM ELT$ZBYT1B I(02,00,60);
ITEM ELT$BYT4 U(01,48,12);
ITEM ELT$BYT5 U(02,00,12);
ITEM ELT$BYT6 U(02,12,12);
ITEM ELT$P2 C(02,24,01) = ["."];
ITEM ELT$ZBYT2 U(02,30,30) = [ 0 ];
END
#
* THIS ARRAY DEFINES THE LINE NAME TEXT SENT WITH THE OPERATOR
* MESSAGE WHEN THE PORT IS SPECIFIED AND A NAME IS FOUND.
*
#
ARRAY LNM$TXT [00:00] S(3);
BEGIN
ITEM LNM$TIM C(00,00,10) = [" "];
ITEM LNM$LINE C(01,00,06) = ["LINE--"];
ITEM LNM$LNM C(01,36,07);
ITEM LNM$ZBYT U(02,18,42) = [0];
END
#
* THIS ARRAY DEFINES THE NPU NAME MESSAGE SENT WITH THE ALARM
* MESSAGE.
#
ARRAY NNM$TXT [00:00] S(4);
BEGIN
ITEM NNM$TIM C(00,00,10);
ITEM NNM$NPU C(01,00,10) = ["FROM NPU--"];
ITEM NNM$NNM C(02,00,07);
ITEM NNM$C1 C(02,42,03) = [": "];
ITEM NNM$ZBYT U(03,00,60) = [0];
END
#
THIS ARRAY DEFINES THE NAME USED WHEN AN NPU NAME CAN NOT BE
FOUND.
#
ARRAY UNK$TXT [00:00] S(1);
BEGIN
ITEM UNK$NAME C(00,18,17) = ["UNKNOWN"];
END
CONTROL EJECT;
# #
# CSESAM CODE BEGINS HERE #
# #
#
* IF THIS SM IS ALM/OP/U, THEN APPEND THE CURRENT TIME TO THE TEXT,
* SEARCH THE NPUCB-S FOR THIS NPU, IF FOUND APPEND THE NAME TO THE
* TEXT, ELSE APPEND -UNKNOWN- FOR THE NAME, CONVERT THE PORT TO
* DISPLAY CODE AND APPEND IT TO THE TEXT, CONVERT THE ALARM TEXT TO
* DISPLAY CODE AND APPEND IT TO THE TEXT. SEND THE TEXT TO THE
* OPERATOR RESPONSE QUEUE WITH AN AUDIENCE GROUP OF TWO.
#
IF WCB$SMID[0] EQ SMID"ALMOP"
THEN
BEGIN
NNM$TIM[0] = CTM$CLOCK[0];
FOR I=0 STEP 1 WHILE ABHSN[0] NQ NPU$NID[I] AND
I LS CSNPCNT
DO
BEGIN
END
IF I LS CSNPCNT
THEN
BEGIN
NNM$NNM[0] = NPU$NAME[I];
END
ELSE
BEGIN
NNM$NNM[0] = UNK$NAME[0];
END
WCB$WORD[1] = 0;
WCB$WC[1] = 2 + (NNM$TXTL / 10);
ABHWORD[1] = NNM$TXTL;
ABHADR[1] = AUDGR4$;
ABHABN[1] = I;
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],NNM$TXT);
CSESLE(ABHSN[0],WCBUF[1],NNM$TXT);
FOR I=2 STEP 1 UNTIL MX$ALM
DO
BEGIN
ALM$WORD[I] = 0;
END
A$CHAR = 0;
BPOS = 32;
CHARCNT = 1;
MWC = 0;
MCC = ABHTLC[0] - NONTXT$;
FOR WC=2 STEP 1 WHILE CHARCNT LQ MCC AND
WC LS MX$ALM
DO
BEGIN
FOR CHARPOS=0 STEP 6 WHILE CHARCNT LQ MCC AND
CHARPOS LS 60
DO
BEGIN
IF BPOS LQ 52
THEN
BEGIN
A$CHAR = B<BPOS,8>MSG$WORD[MWC];
B<CHARPOS,6>ALM$WORD[WC] = SSDCAD(A$CHAR);
BPOS = BPOS + 8;
END
ELSE IF BPOS EQ 56
THEN
BEGIN
B<52,4>A$CHAR = B<BPOS,4>MSG$WORD[MWC];
MWC = MWC + 1;
B<56,4>A$CHAR = B<0,4>MSG$WORD[MWC];
B<CHARPOS,6>ALM$WORD[WC] = SSDCAD(A$CHAR);
BPOS = 4;
END
ELSE
BEGIN
MWC = MWC + 1;
A$CHAR = B<0,8>MSG$WORD[MWC];
B<CHARPOS,6>ALM$WORD[WC] = SSDCAD(A$CHAR);
BPOS = 8;
END
CHARCNT = CHARCNT + 1;
END
END
IF CHARPOS LQ 48
THEN
BEGIN
WC = WC - 1;
END
WCB$WC[1] = 2 + WC;
ABHTLC[1] = WC * 10;
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],ALM$TXT);
CSESLE(ABHSN[0],WCBUF[1],ALM$TXT);
IF ALMP[0] NQ 0
THEN
BEGIN
FOR I=0 STEP 1 WHILE NOT (ALMP[0] EQ LIX$PORT[I] AND
ABHSN[0] EQ LIX$NID[I]) AND
I LQ LIXL
DO
BEGIN
END
IF I LQ LIXL
THEN
BEGIN
WCB$WC[1] = 2 + (LNM$TXTL / 10);
ABHTLC[1] = LNM$TXTL;
CNST1 = 1;
CNST2 = 36;
CNST3 = 42;
SSBSBF(LNM$TXT,CNST1,CNST2,CNST3,B<0,42>LIX$NAME[I]);
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],LNM$TXT);
CSESLE(ABHSN[0],WCBUF[1],LNM$TXT);
END
END
END
#
* IF THIS SM IS LOG/ER/U, THEN CONVERT SOURCE NODE I.D. AND APPEND
* IT TO THE TEXT. CONVERT THE ERROR CODE AND APPEND IT TO THE TEXT.
* IF THE ERROR CODE -FF- HEX THEN CONVERT THE FIRST THREE BYTES OF
* DATA AND APPEND THEM TO THE TEXT, ELSE CONVERT THE FIRST SIX BYTES
* OF INFORMATION AND APPEND THEM TO THE TEXT. SEND THE TEXT OFF TO
* THE ERROR LOG FILE.
#
ELSE
BEGIN
ELT$NID[0] = XCDD(ABHSN[0]);
ELT$EC[0] = XCHD(LOGEC[0]);
ELT$BYT1[0] = XCHD(LOGB1[0]);
ELT$BYT2[0] = XCHD(LOGB2[0]);
ELT$BYT3[0] = XCHD(LOGB3[0]);
IF LOGEC[0] EQ X"FF"
THEN
BEGIN
ELT$P1[0] = ".";
ELT$ZBYT1A[0] = 0;
ELT$ZBYT1B[0] = 0;
END
ELSE
BEGIN
ELT$BYT4[0] = XCHD(LOGB4[0]);
ITEMP = 0;
B<52,4>ITEMP = LOGB51[0];
B<56,4>ITEMP = LOGB52[0];
ELT$BYT5[0] = XCHD(ITEMP);
ELT$BYT6[0] = XCHD(LOGB6[0]);
ELT$P2[0] = ".";
ELT$ZBYT2[0] = 0;
END
MESSAGE(ELT$TXT,ERRLG);
END
RETURN; # **** RETURN **** #
END # CSESAM #
TERM