User Tools

Site Tools


cdc:nos2.source:nam5871:csesam

CSESAM

Table Of Contents

  • [00007] PROC CSESAM
  • [00008] SEND ALARM(AND ERROR LOG) MESSAGE.
  • [00011] SEND ALARM MESSAGE.
  • [00032] PROC CSESLE
  • [00033] PROC MESSAGE
  • [00034] PROC SSBSBF
  • [00035] FUNC SSDCAD U
  • [00036] PROC SSTAQE
  • [00037] FUNC XCDD U
  • [00038] FUNC XCHD U

Source Code

CSESAM.txt
  1. *DECK CSESAM
  2. USETEXT TEXTOV
  3. USETEXT TEXTCS
  4. USETEXT TEXTSS
  5. USETEXT TXTAPSS
  6. USETEXT TXTSMCS
  7. PROC CSESAM;
  8. # TITLE - SEND ALARM(AND ERROR LOG) MESSAGE. #
  9. BEGIN
  10. #
  11. ** CSESAM - SEND ALARM MESSAGE.
  12. *
  13. * D.K. ENDO 82/03/31
  14. *
  15. * THIS PROCEDURE FORMATS THE ALARMS TO THE OPERATOR FROM THE IN-
  16. * COMING ALM/OP/U SM, AND THE ENTRIES TO THE ERROR LOG FILE FROM THE
  17. * INCOMING LOG/ER/U SM.
  18. *
  19. * PROC CSESAM
  20. *
  21. * ENTRY 1. ALM/OP/U OR LOG/ER/U SM FROM THE EVENT QUEUE.
  22. *
  23. * EXIT 1. FORMATTED ALARM TO THE OPERATOR RESPONSE QUEUE.
  24. * 2. FORMATTED ENTRY TO THE ERROR LOG FILE.
  25. *
  26. #
  27. #
  28. **** PROC CSESAM - XREF LIST BEGINS.
  29. #
  30. XREF
  31. BEGIN
  32. PROC CSESLE; # SEND LOG (FILE) ENTRY #
  33. PROC MESSAGE; # PUTS MESSAGES IN SYSTEMS FILES #
  34. PROC SSBSBF; # STORE BIT FIELD #
  35. FUNC SSDCAD U; # CONVERT ASCII TO DISPLAY CODE #
  36. PROC SSTAQE; # ADD QUEUE ENTRY #
  37. FUNC XCDD U; # CONVERT DECIMAL INTEGER TO DISPLAY CODE #
  38. FUNC XCHD U; # CONVERT HEX INTEGER TO DISPLAY CODE #
  39. END
  40. #
  41. ****
  42. #
  43. DEF ERRLG # 4 #; # MESSAGE IDENTIFIER FOR THE ERROR LOG #
  44. DEF LNM$TXTL # 30 #; # CHAR COUNT FOR LINE NAME TEXT #
  45. DEF NNM$TXTL # 40 #; # CHAR COUNT FOR NPU NAME TEXT #
  46. DEF NONTXT$ # 4 #; # NUMBER OF CHARS THAT ARE NOT TEXT #
  47.  
  48.  
  49. ITEM A$CHAR U = 0; # ONE ASCII CHARACTER #
  50. ITEM BPOS; # BIT POSITION OF SM TEXT POINTER #
  51. ITEM CHARCNT; # MESSAGE CHARACTER COUNT #
  52. ITEM CHARPOS; # BIT POSITION OF MESSAGE TEXT POINTER #
  53. ITEM CNST1; # CONSTANT ---> 1 #
  54. ITEM CNST2; # CONSTANT ---> 2 #
  55. ITEM CNST3; # CONSTANT ---> 3 #
  56. ITEM I; # LOOP INDUCTION VARIABLE #
  57. ITEM ITEMP U = 0; # UNSIGNED INTEGER TEMPORARY #
  58. ITEM MCC; # MESSAGE CHARACTER COUNT #
  59. ITEM MWC; # WORD COUNT OF SM TEXT POINTER #
  60. ITEM WC; # WORD COUNT OF MESSAGE TEXT POINTER #
  61.  
  62. #
  63.   THIS ARRAY DEFINES THE ALARM TO OPERATOR TEXT SENT WHEN A ALM/OP/U
  64.   SM IS RECEIVED.
  65. #
  66. DEF MX$ALM # 7 #;
  67. ARRAY ALM$TXT [01:MX$ALM] S(1);
  68. BEGIN
  69. ITEM ALM$TIM C(00,00,10) = [" "];
  70. ITEM ALM$WORD U(00,00,60);
  71. END
  72. #
  73.   THIS ARRAY DEFINES THE FORMAT OF THE ERROR LOG ENTRY SENT WHEN A
  74.   LOG/ER/U SM IS RECEIVED.
  75. #
  76. ARRAY ELT$TXT [00:00] S(4);
  77. BEGIN
  78. ITEM ELT$NW01 C(00,00,06) = ["NW01, "];
  79. ITEM ELT$NID U(00,36,18);
  80. ITEM ELT$C1 C(00,54,01) = [","];
  81. ITEM ELT$EC U(01,00,12);
  82. ITEM ELT$BYT1 U(01,12,12);
  83. ITEM ELT$BYT2 U(01,24,12);
  84. ITEM ELT$BYT3 U(01,36,12);
  85. ITEM ELT$P1 C(01,48,01);
  86. ITEM ELT$ZBYT1A U(01,54,06);
  87. ITEM ELT$ZBYT1B I(02,00,60);
  88. ITEM ELT$BYT4 U(01,48,12);
  89. ITEM ELT$BYT5 U(02,00,12);
  90. ITEM ELT$BYT6 U(02,12,12);
  91. ITEM ELT$P2 C(02,24,01) = ["."];
  92. ITEM ELT$ZBYT2 U(02,30,30) = [ 0 ];
  93. END
  94. #
  95. * THIS ARRAY DEFINES THE LINE NAME TEXT SENT WITH THE OPERATOR
  96. * MESSAGE WHEN THE PORT IS SPECIFIED AND A NAME IS FOUND.
  97. *
  98. #
  99. ARRAY LNM$TXT [00:00] S(3);
  100. BEGIN
  101. ITEM LNM$TIM C(00,00,10) = [" "];
  102. ITEM LNM$LINE C(01,00,06) = ["LINE--"];
  103. ITEM LNM$LNM C(01,36,07);
  104. ITEM LNM$ZBYT U(02,18,42) = [0];
  105. END
  106. #
  107. * THIS ARRAY DEFINES THE NPU NAME MESSAGE SENT WITH THE ALARM
  108. * MESSAGE.
  109. #
  110. ARRAY NNM$TXT [00:00] S(4);
  111. BEGIN
  112. ITEM NNM$TIM C(00,00,10);
  113. ITEM NNM$NPU C(01,00,10) = ["FROM NPU--"];
  114. ITEM NNM$NNM C(02,00,07);
  115. ITEM NNM$C1 C(02,42,03) = [": "];
  116. ITEM NNM$ZBYT U(03,00,60) = [0];
  117. END
  118. #
  119.   THIS ARRAY DEFINES THE NAME USED WHEN AN NPU NAME CAN NOT BE
  120.   FOUND.
  121. #
  122. ARRAY UNK$TXT [00:00] S(1);
  123. BEGIN
  124. ITEM UNK$NAME C(00,18,17) = ["UNKNOWN"];
  125. END
  126. CONTROL EJECT;
  127. # #
  128. # CSESAM CODE BEGINS HERE #
  129. # #
  130. #
  131. * IF THIS SM IS ALM/OP/U, THEN APPEND THE CURRENT TIME TO THE TEXT,
  132. * SEARCH THE NPUCB-S FOR THIS NPU, IF FOUND APPEND THE NAME TO THE
  133. * TEXT, ELSE APPEND -UNKNOWN- FOR THE NAME, CONVERT THE PORT TO
  134. * DISPLAY CODE AND APPEND IT TO THE TEXT, CONVERT THE ALARM TEXT TO
  135. * DISPLAY CODE AND APPEND IT TO THE TEXT. SEND THE TEXT TO THE
  136. * OPERATOR RESPONSE QUEUE WITH AN AUDIENCE GROUP OF TWO.
  137. #
  138. IF WCB$SMID[0] EQ SMID"ALMOP"
  139. THEN
  140. BEGIN
  141. NNM$TIM[0] = CTM$CLOCK[0];
  142. FOR I=0 STEP 1 WHILE ABHSN[0] NQ NPU$NID[I] AND
  143. I LS CSNPCNT
  144. DO
  145. BEGIN
  146. END
  147. IF I LS CSNPCNT
  148. THEN
  149. BEGIN
  150. NNM$NNM[0] = NPU$NAME[I];
  151. END
  152. ELSE
  153. BEGIN
  154. NNM$NNM[0] = UNK$NAME[0];
  155. END
  156. WCB$WORD[1] = 0;
  157. WCB$WC[1] = 2 + (NNM$TXTL / 10);
  158. ABHWORD[1] = NNM$TXTL;
  159. ABHADR[1] = AUDGR4$;
  160. ABHABN[1] = I;
  161. SSTAQE(P<ORQ>,WCBUF[1],ABH[1],NNM$TXT);
  162. CSESLE(ABHSN[0],WCBUF[1],NNM$TXT);
  163. FOR I=2 STEP 1 UNTIL MX$ALM
  164. DO
  165. BEGIN
  166. ALM$WORD[I] = 0;
  167. END
  168. A$CHAR = 0;
  169. BPOS = 32;
  170. CHARCNT = 1;
  171. MWC = 0;
  172. MCC = ABHTLC[0] - NONTXT$;
  173.  
  174. FOR WC=2 STEP 1 WHILE CHARCNT LQ MCC AND
  175. WC LS MX$ALM
  176. DO
  177. BEGIN
  178. FOR CHARPOS=0 STEP 6 WHILE CHARCNT LQ MCC AND
  179. CHARPOS LS 60
  180. DO
  181. BEGIN
  182. IF BPOS LQ 52
  183. THEN
  184. BEGIN
  185. A$CHAR = B<BPOS,8>MSG$WORD[MWC];
  186. B<CHARPOS,6>ALM$WORD[WC] = SSDCAD(A$CHAR);
  187. BPOS = BPOS + 8;
  188. END
  189. ELSE IF BPOS EQ 56
  190. THEN
  191. BEGIN
  192. B<52,4>A$CHAR = B<BPOS,4>MSG$WORD[MWC];
  193. MWC = MWC + 1;
  194. B<56,4>A$CHAR = B<0,4>MSG$WORD[MWC];
  195. B<CHARPOS,6>ALM$WORD[WC] = SSDCAD(A$CHAR);
  196. BPOS = 4;
  197. END
  198. ELSE
  199. BEGIN
  200. MWC = MWC + 1;
  201. A$CHAR = B<0,8>MSG$WORD[MWC];
  202. B<CHARPOS,6>ALM$WORD[WC] = SSDCAD(A$CHAR);
  203. BPOS = 8;
  204. END
  205. CHARCNT = CHARCNT + 1;
  206. END
  207. END
  208. IF CHARPOS LQ 48
  209. THEN
  210. BEGIN
  211. WC = WC - 1;
  212. END
  213. WCB$WC[1] = 2 + WC;
  214. ABHTLC[1] = WC * 10;
  215. SSTAQE(P<ORQ>,WCBUF[1],ABH[1],ALM$TXT);
  216. CSESLE(ABHSN[0],WCBUF[1],ALM$TXT);
  217. IF ALMP[0] NQ 0
  218. THEN
  219. BEGIN
  220. FOR I=0 STEP 1 WHILE NOT (ALMP[0] EQ LIX$PORT[I] AND
  221. ABHSN[0] EQ LIX$NID[I]) AND
  222. I LQ LIXL
  223. DO
  224. BEGIN
  225. END
  226. IF I LQ LIXL
  227. THEN
  228. BEGIN
  229. WCB$WC[1] = 2 + (LNM$TXTL / 10);
  230. ABHTLC[1] = LNM$TXTL;
  231. CNST1 = 1;
  232. CNST2 = 36;
  233. CNST3 = 42;
  234. SSBSBF(LNM$TXT,CNST1,CNST2,CNST3,B<0,42>LIX$NAME[I]);
  235. SSTAQE(P<ORQ>,WCBUF[1],ABH[1],LNM$TXT);
  236. CSESLE(ABHSN[0],WCBUF[1],LNM$TXT);
  237. END
  238. END
  239. END
  240. #
  241. * IF THIS SM IS LOG/ER/U, THEN CONVERT SOURCE NODE I.D. AND APPEND
  242. * IT TO THE TEXT. CONVERT THE ERROR CODE AND APPEND IT TO THE TEXT.
  243. * IF THE ERROR CODE -FF- HEX THEN CONVERT THE FIRST THREE BYTES OF
  244. * DATA AND APPEND THEM TO THE TEXT, ELSE CONVERT THE FIRST SIX BYTES
  245. * OF INFORMATION AND APPEND THEM TO THE TEXT. SEND THE TEXT OFF TO
  246. * THE ERROR LOG FILE.
  247. #
  248. ELSE
  249. BEGIN
  250. ELT$NID[0] = XCDD(ABHSN[0]);
  251. ELT$EC[0] = XCHD(LOGEC[0]);
  252. ELT$BYT1[0] = XCHD(LOGB1[0]);
  253. ELT$BYT2[0] = XCHD(LOGB2[0]);
  254. ELT$BYT3[0] = XCHD(LOGB3[0]);
  255. IF LOGEC[0] EQ X"FF"
  256. THEN
  257. BEGIN
  258. ELT$P1[0] = ".";
  259. ELT$ZBYT1A[0] = 0;
  260. ELT$ZBYT1B[0] = 0;
  261. END
  262. ELSE
  263. BEGIN
  264. ELT$BYT4[0] = XCHD(LOGB4[0]);
  265. ITEMP = 0;
  266. B<52,4>ITEMP = LOGB51[0];
  267. B<56,4>ITEMP = LOGB52[0];
  268. ELT$BYT5[0] = XCHD(ITEMP);
  269. ELT$BYT6[0] = XCHD(LOGB6[0]);
  270. ELT$P2[0] = ".";
  271. ELT$ZBYT2[0] = 0;
  272. END
  273. MESSAGE(ELT$TXT,ERRLG);
  274. END
  275. RETURN; # **** RETURN **** #
  276. END # CSESAM #
  277. TERM
cdc/nos2.source/nam5871/csesam.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator