某程控交换机对数字端口初始化的原程序:
245 1 INITIALISE_USART:PROCEDURE(PN);
246 2 DECLARE PN WORD;
247 2 OUTWORD(OPERAD) = PN; /* USART MAY BE IN A SITUATION IT CANNOT RECEIVE RESET */
248 2 OUTWORD(OPERDA) = 8100H; /* REMEDY ==> 3 X OUTPUT(1) = 0 */
249 2 OUTPUT(OBUREQ) = 0;
250 2 OUTPUT(OEPOUT) = 0;
251 2 OUTPUT(OEPOUT) = 0;
252 2 OUTPUT(OEPOUT) = 0;
253 2 OUTWORD(OPERDA) = 8140H; /* INTERNAL RESET */
254 2 OUTPUT(OEPOUT) = 0;
255 2 OUTWORD(OPERDA) = 81CFH; /* BAUDRATE = 2.4 KBAUD */
256 2 OUTPUT(OEPOUT) = 0; /* CHARACTER LENGTH = 8 BITS */
/* PARITY DISABLE */
/* NUMBER OF STOPBITS = 2 */
257 2 OUTWORD(OPERDA) = 8137H; /* TRANSMIT ENABLE */
/* DATA TERMINAL READY */
/* RECEIVE ENABLE */
/* ERROR RESET */
/* REQUEST TO SEND */
258 2 OUTPUT(OEPOUT) = 0;
259 2 OUTPUT(ORELBU) = 0;
260 2 END INITIALISE_USART;
261 1 INIT_OPERATOR:PROCEDURE(PN) PUBLIC;
262 2 DECLARE OPERATOR_INPUT_7 LITERALLY '700H';
263 2 DECLARE PN WORD;
264 2 DECLARE SCANPOINT BYTE;
265 2 OUTWORD(OPERAD) = PN;
266 2 OUTWORD(OPERDA) = OPERATOR_INPUT_7;
267 2 OUTPUT(OBUREQ) = 0;
268 2 SCANPOINT = INPUT(IPDATA);
269 2 OUTWORD(ORELBU) = 0;
270 2 IF (SCANPOINT AND 81H) = 0
271 2 THEN DO;
272 3 TRANSMITTER_NOT_RDY_COUNTER(GET_OPERATOR_NUMBER(PN)) = 0;
273 3 CALL INITIALISE_USART(PN);
274 3 CALL PUT_ON_OPERATOR_LIST(PN);
275 3 CALL SEND_MESSAGE(PN,MSC_IN_SERVICE,NO_DATA);
276 3 DEVICE_DESCRIPTOR(PN).STATE = INACTIVE_STATE;
277 3 END;
278 2 ELSE DEVICE_DESCRIPTOR(PN).STATE = OUT_OF_SERVICE_STATE;
279 2 OLD_SCANPOINT(PN) = SCANPOINT;
280 2 CALL OUTPUT_PROCEDURE(PN,OUTPUT_0,LAMP_OFF);
281 2 CALL OUTPUT_PROCEDURE(PN,OUTPUT_6,TEST_RELAY_OFF);
282 2 END INIT_OPERATOR;
从中可以看到数字端口的特性。
[此贴子已经被作者于2004-2-8 21:05:24编辑过]
|