Programming

DEFINE_PROGRAM

 

 

 

IF (FIND_STRING(DTMF_BUFFER,'CLID-',1))

(* START OF

STRING FOUND

*)

{

 

 

 

WAIT 20 'NO VALID STRING FOUND'

(* TIME-OUT AFTER

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 TIME-OUT NECESSARY *)

(* 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 = "MID_STRING(ID_DATA,15,3),'-', MID_STRING(ID_DATA,18,3),'-',MID_STRING(ID_DATA,21,4)"

ID_NAME = MID_STRING(ID_DATA,26,20)

(*

NOTE: THE FOLLOWING DATA WILL APPEAR ON THE TOUCHPANEL

*)

SEND_COMMAND TP,"'TEXT1-NAME:

',ID_NAME"

(*

CALLER'S

NAME

*)

SEND_COMMAND TP,"'TEXT2-NUMBER:

',ID_NUMBER"

(*

CALLER'S

NUMBER

*)

SEND_COMMAND

TP,"'TEXT3-DATE:

',ID_DATE"

 

(*

DATE

OF THE CALL *)

SEND_COMMAND

TP,"'TEXT4-TIME:

',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

AXB-DTMF+ DTMF+ Interface

 

 

 

Page 30
Image 30
AMX AXB-DTMF+ instruction manual Defineprogram If FINDSTRINGDTMFBUFFER,CLID-,1 Start