Programming
DEFINE_PROGRAM |
|
|
|
IF | (* START OF | STRING FOUND | *) |
{ |
|
|
|
WAIT 20 'NO VALID STRING FOUND' | (* | 2.0 SECONDS | *) |
{ |
|
|
|
CANCEL_WAIT_UNTIL 'WAIT FOR END OF STRING' (* DON'T WAIT FOR THE REST *)
CLEAR_BUFFER DTMF_BUFFER(* CLEAR DATA IN BUFFER *) SEND_STRING 0,"'INCOMPLETE STRING RECEIVED',10,13" (* ERROR MESSAGE *)
} |
|
WAIT_UNTIL (FIND_STRING(DTMF_BUFFER,"$00",1)) | (* END OF STRING FOUND *) |
{ |
|
CANCEL_WAIT 'NO VALID STRING FOUND' ID_DATA = DTMF_BUFFER
CLEAR_BUFFER DTMF_BUFFER
(* NO
(* COPY CONTENTS, SO MORE DATA *) (* WILL NOT AFFECT PROCESSING *)
(* CLEAR DATA IN BUFFER *)
(* PROCESS THE DATA FOUND *)
ID_DATE = "MID_STRING(ID_DATA,6,2),'/',MID_STRING(ID_DATA,8,2)"
ID_TIME = "MID_STRING(ID_DATA,10,2),':',MID_STRING(ID_DATA,12,2)"
ID_NUMBER =
ID_NAME = MID_STRING(ID_DATA,26,20)
(* | NOTE: THE FOLLOWING DATA WILL APPEAR ON THE TOUCHPANEL | *) | |||||||
SEND_COMMAND | ',ID_NAME" | (* | CALLER'S | NAME | *) | ||||
SEND_COMMAND | ',ID_NUMBER" | (* | CALLER'S | NUMBER | *) | ||||
SEND_COMMAND | ',ID_DATE" |
| (* | DATE | OF THE CALL *) | ||||
SEND_COMMAND | ',ID_TIME" |
| (* | TIME | OF THE CALL *) |
(* | NOTE: | THE FOLLOWING DATA WILL APPEAR IN THE TERMINAL EMULATOR | *) | ||
SEND_STRING | 0,"'NAME: | ',ID_NAME,10,13" | (* CALLER'S NAME *) | ||
SEND_STRING | 0,"'NUMBER: | ',ID_NUMBER,10,13" | (* CALLER'S NUMBER *) | ||
SEND_STRING | 0,"'DATE: | ',ID_DATE,' (MONTH/DATE)',10,13" (* DATE OF CALL *) | |||
SEND_STRING | 0,"'TIME: | ',ID_TIME,10,13" | (* TIME OF CALL *) | ||
} |
|
|
|
|
|
} |
|
|
|
|
|
(***********************************************************************) |
| ||||
(* |
| END OF PROGRAM | *) |
| |
(* | DO NOT PUT ANY CODE BELOW THIS COMMENT | *) |
|
(***********************************************************************)
| 26 | |
|
|
|