Programming

(* CONSTANT DEFINITIONS GO BELOW*)

(*********************************************************************)

DEFINE_CONSTANT

(*********************************************************************)

(* VARIABLE DEFINITIONS GO BELOW*)

(*********************************************************************)

DEFINE_VARIABLE

 

 

STATE

(* STATE OF THE SOFTWARE "STATE MACHINE"

*)

BUSY_COUNT

(* NUMBER OF RETRIES

*)

(*********************************************************************)

(*LATCHING DEFINITIONS GO BELOW*) (*********************************************************************)

DEFINE_LATCHING

(*********************************************************************)

(* MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW*)

(*********************************************************************)

DEFINE_MUTUALLY_EXCLUSIVE

(*********************************************************************)

(*STARTUP CODE GOES BELOW*)

(*********************************************************************)

DEFINE_START

 

 

BUSY_COUNT=0

 

 

STATE=255

(* ESSENTIALLY "NO STATE"

*)

(*********************************************************************)

(* THE ACTUAL PROGRAM GOES BELOW*)

(*********************************************************************)

DEFINE_PROGRAM

(*********************************************************************)

(*

IF KEY

1 ON THE KEYPAD

IS PUSHED, PLACE THE

*)

(*

CARD

ON HOOK (IN CASE

IT WAS OFF-HOOK).

*)

(*

WAIT

2

SECONDS BEFORE CHANGING STATE TO

*)

(*

STATE 2.

 

*)

(*********************************************************************)

PUSH[128,1](* 1 * )

{

SEND_COMMAND DTMF_CARD,'ON HOOK'

WAIT 20

STATE=2

}

(*********************************************************************)

(*

TAKE THE

CARD

OFF-HOOK.

WAIT

2 SECONDS

 

*)

(*

FOR DIAL

TONE. IF

IT IS

( NOT

RECEIVED,

SEND AN

*)

(*

ERROR MESSAGE

AND

SHUT

DOWN (GO TO ( "NO STATE").

*)

(*********************************************************************)

Continued

AXB-DTMF+ DTMF+ Interface

19

 

 

 

 

Page 23
Image 23
AMX AXB-DTMF+ instruction manual Busycount Number of Retries