The text of a manual · part 22 of 26
IRL Programming Reference Manual, pages 211 to 220
Pages 211 to 220 of 260
The original document is the PDF (666 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec 9445, Intermec 9550, Intermec 9560 and Intermec 9512
Page 211
Binary Search Program
C
P"Enter search string" P"from 0 TO 999\r\n" A D$0="0"+$0 D$0=$0R3 C#3=$0 G#0>0.ERROR :Convert did not work correctly G#3>999.ERROR P"\rSearching..." H#4=A D#6=#4-#5 D#6=#6/2 GA(#4)=$0.MATCH :Test for match at upper limit GA(#5)=$0.MATCH :Test for match at lower limit .SEARCH GA(#6)<$0.HIGHER GA(#6)>$0.LOWER GA(#6)=$0.MATCH B0000 P"String not found" P"Search again (Y/N)\r" D$0="" A G$0="Y".PROMPT G$0="y".PROMPT ET .HIGHER D#5=#6 :Set new lower limit D#6=#4+#5 :Set new middle limit (upper+lower)/2 D#6=#6/2 G.SEARCH .LOWER D#4=#6 :Set new upper limit D#6=#6/2 :Set new middle limit G.SEARCH .ERROR B0101 P"Enter string data" P"from 0 TO 999 only" W3 G.PROMPT .MATCH D$0="" B110110 C$0=#3 P"String found at" D$0="A("+$0 D$0=$0+")" P$0 P"Search again (Y/N)" D$0=""
C-5
Page 212
IRL Programming Reference Manual
A GSO="Y".PROMPT GS0="y". PROMPT ET :Exit program
C6
Page 213
TRAKKER Modem Program
C
TRAKKER Modem Program This program is a useful building block for an IRL version 2.X program that must communicate through a modem. Use this program to connect with another device through a modem interface and then disconnect when finished. MODEM.IRL is composed of three procedures: • The first lets the user choose whether to connect or disconnect. • The second connects to and configures the modem. • The third disconnects from the modem. This program was originally written for IRL version 2.1, and has been revised to take advantage of IRL version 2.2 language features and the Xmodem protocol. Both versions are included in MODEM.IRL. • If you are using IRL version 2.1, copy the program as is. For all lines that begin with “:old :”, delete the “:old :” text. Next, delete all lines that have “:a :” in them. • If you are using IRL version 2.2 or version 4.X, copy the program as is. For all lines that begin with “:a :”, delete the “:a :” text. Be sure to include any other lines that contain “:a :”. • If you are using IRL version 4.X, you usually do not need a modem program. JANUS readers can use Interlnk/Intersrv, any DOS communications program, or Intermec’s RF network to transfer data. Note: The newer version, when used with IRL 2.2-equipped readers, will work with most modems. However, the TRAKKER 40 MD modems purchased before 1989 need to have their ATDT commands issued with the :old: variety of Transmit EOM, so those TRAKKERs should run the :old: program.
C-7
Page 214
IRL Programming Reference Manual
:********************************************************************** :* NAME: FSTMODEM.IRL :* DESCRIPTION: The first procedure lets the user choose whether to :* connect or disconnect from a device through a modem interface. :* Compatiblitity: IRL 2.1, 2.2 :* Registers Used: :* $0: Input register :* $1: Scratch :* $2: Phone Number :* :* #0: Status register :* #1: Counter :* #6: Dial_Done flag; 0 = FALSE, 1 = TRUE :old :* #7: Poll_Mode_D flag; 0 = FALSE, 1 = TRUE :old :* #8: Protocol_Set flag; 0 = FALSE, 1 = TRUE :* #9: Exit_Mode flag 0 = FALSE 1 = TRUE :* :old :* Transmit EOM <CR><NUL> :old :* Receive EOM <CR><LF> :* :***************************************************************** : .MAIN :REPEAT... Z"\0x09" :a : clear protected field D$0="" : clear input register P"\e[2J1. Call number." : prompt user P"2. Disconnect." : prompt user P"1 or 2 ? " : prompt user VBK : get input C#1=$0 G#1=1.CONNECT : goto connect G#1=2.DISCON : goto discon G.MAIN :..UNTIL FOREVER : :********************************************************************** :CONNECT Procedure :* DESCRIPTION: This procedure connects to and configures the :* modem to the TRAKKER. It properly and completely configures the :* reader so it can communicate with the TRAKKER modem. :* :a :* The TRAKKER uses XMODEM protocol to both communicate with the :a :* modem and to transmit/receive data from the Host computer. :* :old :* Once connected, this procedure configures the reader to :old :* communicate with the Host computer via one of two protocols :old :* per your specification. :* :* This procedure dials the Host computer through the TRAKKER modem :* It contains error handling features in case the modem connection :* fails. :**********************************************************************
C-8
Page 215
TRAKKER Modem Program
C
: .CONNECT :Connect :old : P"\e[2JConfiguring ...\r\n" :status msg :old : W1 :wait 1 sec. :old : P"\e[2J" :clear screen :old : Z"\0x09" :clear protected field Z"$+BV0DE0OA0OD0PK\0X00PA5$-" :a :Configure the reader :a : BV0 low volume :a : DE0 no append time to data :a : OA0 no preamble required :a : OD0 buffered display mode :a : PK\0X00 disables XON/XOFF :a : PA5 for XMODEM protocol Z"$+PB0XG1$-" :a : Configure the reader :a : PB0 no cpu resp req'd :a : XG1 resume IRL on power on :old : Z"+.+++%$+BV0DE0IB1IC1ID0XE\0x0D$-" :Configure the reader for :old : Z"$+IG0II7IJ0OA0OD0PA0FC1ZB\0x07$-" : talking with the Modem :old : : ((IJ0) With CTS = OFF) :old : Z"$+ZA\0x1EPK\0x00PL\0x00HB\0x00$-" : with IRL resume = TRUE :old : Z"$+HA\0x00PC\0x00PD\0x00PG\0x00$-" : :old : Z"$+PH\0x00PE\0x00FA\0x00XD\0x0E$-" : :old : Z"$+IE2IF0PB0PI\0x0D\0x00XA\0x0F$-" : :old : Z"$+FB\0x00\0x00XB\0x16XC\0x12XG1$-" : :old : Z"$+PJ\0x0D\0x0A$-" : :old : P"\e[2JConfigured.\r\n" :status msg :old : W1 :wait 1 sec. D#9=0 :exit_mode = FALSE D#3=0 :data_ptr_counter = 0 .CM_01 :Repeat until baud rate is set P"\e[2JEnter baud rate" :prompt user P"300/1200 > \r\n": :prompt user D$0="" :clear input register N3,4 : get input :old : P"\e[2J" :clear display G$0="300".CM_04 :If (response <> "300") Then G$0="1200".CM_02 : If (response <> "1200") Then B111 : do bad_cmd_beep P"\e[2JIncorrect baud" : error msg P"Try again\r\n" : prompt user G.CM_03 .CM_02 :Else Z"$+IA3$-" : set baud to 1200 D#9=1 : exit_mode = TRUE .CM_03 :End-if G.CM_05 : . . .CM_04 :Else Z"$+IA1$-" : set baud to 300 D#9=1 : exit_mode = TRUE .CM_05 :End-if
C-9
Page 216
IRL Programming Reference Manual
G#9=0.CM_01 :Until (exit_mode = TRUE) P"\e[2JEnter Phone No.\r\n" :prompt user D$0="" :clear input register N :get input D$2=$0 :save phone number P"\e[2JTurn OFF TRAKKER" :instructions... P"and connect cable," :instructions... P"then turn ON and" :instructions... P"press ENTER" :instructions... A :get input P"\e[2J" :clear screen Z"$+XG0$-" :turn auto resume off P"\e[2JWait while" :wait message... P"configuring" :wait message... P"modem.\r\n" :wait message... YMN;1 :Switch protocols, clear buffer YMP;1 : .CM_06 D$1="ATZ" XMP,$1;100 D#1=0
:Repeat :reset modem
.CM_07 D#1=#1+1 D$0="" YMP;100 G$0="OK".CM_08 :Or G#1<10.CM_07
:Repeat :increment count :clear input reg. :wait for response :Until [(status = OK)
:count = 0
:until (count >= 10)]
.CM_08 G$0<>"OK".CM_06 :a :Until (status = OK) :old : G$0<"OK".CM_06 :Until (status = OK) :old : G$0>"OK".CM_06 : W1 :wait 1 sec. .CM_09 :Repeat D$1="ATX4" :command = X4_Response_Set I$1"E0" :plus Don't_Echo_Commands I$1"F1" :plus Full_Duplex :old : I$1"S2=64" :plus Modify_Escape_Code to "@@@" XMP,$1;100 :initialize modem D#1=0 .CM_10 D$0="" YMP;100 G$0="OK".CM_11 :Or G#1<10.CM_10
C-10
: Repeat :clear input reg. :wait for response :Until [(status = OK) :until (count = 10)]
Page 217
TRAKKER Modem Program
C
.CM_11 G$0<>"OK".CM_09 :a :Until (status = OK) :old : G$0<"OK".CM_09 :Until (status = OK) :old : G$0>"OK".CM_09 : W1 :wait 1 sec. :old : D#8=0 :protocol_set = FALSE :old :CM_12 :Repeat :old : D$0="" : clear input reg. :old : P"\e[2JProtocol to use " : prompt user :old : P"once connection is" : prompt user :old : P"made...\r\n" : prompt user. :old : W2 : wait 2 sec. :old : P"\e[2J1. Point-to-Point." : prompt user :old : P"2. Polling Mode D." : prompt user :old : P"1 or 2 ? " : prompt user :old : VBK : get input :old : C#1=$0 : . :old : G#1=0.CM_16 : If [(input <> 0) :old : : . And :old : G#1>2.CM_16 : . (input < 3)] :old : : Then :old : G#1=2.CM_13 : . If (Polling_Mode_D = TRUE) :old : G.CM_14 : . | :old :CM_13 : . Then :old : D#7=1 : . . poll_mode_D = TRUE. :old : P"\e[2JPolling Mode D" : . prompt user :old : P"will be used." : . . prompt user :old : G.CM_15 : . . . :old :CM_14 : . Else :old : D#7=0 : . . poll_mode_D = FALSE. :old : P"\e[2JPoint-to-Point" : . prompt user :old : P"with X-ON/X-OFF" : . . prompt user :old : P"will be used." : . . prompt user :old :CM_15 : . End-if :old : W1 : . wait :old : D#8=1 : . protocol_set = TRUE :old :CM_16 : End-if :old : G#8=0.CM_12 :Until (protocol_set = TRUE) D#6=0 :dial_done = FALSE. .CM_17 :Repeat send phone number D$1="ATDT" : load dial code D$1=$1+$2 : append phone number P"\e[2JCalling...\r\n" : status message XMP,$1;100 : transmit phone number D#1=0 : clear counter .CM_18 D$0="" YMP;2500
:Repeat wait for connect : clear input reg. : wait for input
C-11
Page 218
IRL Programming Reference Manual
D#1=#1+1 : increment counter G#0<>0.CM_20 :a : Until [(...(status = good receive) And :old : G#0=0.CM_19 : Until [(...(status = good receive) :old : G.CM_20 : And :old :CM_19 : G$0="CONNECT".CM_21 : (...(CONNECT) Or G$0="CONNECT 1200".CM_21 : (CONNECT_1200) : Or G$0="BUSY".CM_21 : (BUSY) Or G$0="NO CARRIER".CM_21 : (NO_CARRIER) : Or G$0="NO DIALTONE".CM_21 : (NO DIALTONE)) .CM_20 : Or G#1<10.CM_18 : (count = 10)] .CM_21 :Connected -Case- procedure G$0="CONNECT".CM_22 : CONNECT Or G$0<>"CONNECT 1200".CM_26 :a : CONNECT_1200 :old : G$0="CONNECT 1200".CM_22 : CONNECT_1200 :old : G.CM_26 : . Then .CM_22 :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : :old : D#6=1 G.CM_37
:Connected 1200 procedure G#7=1.CM_23 : If (Polling Mode D = TRUE) G.CM_24 : . .CM_23 : Then P"\e[2J" : . clear display. Z"$+IF1HB\0x1CHA\0x1DPC\0x04$-" : . configure for polling mode D. Z"$+IE3PD\0x05PG\0x06PH\0x15$-" Z"$+PE\0x02PF\0x03\0x00$-" P"\e[2JConnected.\r\n" : prompt user P"Polling Mode D is" : prompt user P"set." : . prompt user W2 : . wait 2 sec. G.CM_25 .CM_24 : Else P"\e[2J" : . clear display Z"$+PA1PK\0x11PL\0x13PF\0x0D\0x0A$-" : . configure for pt-to-pt. P"\e[2JConnected.\r\n" : prompt user P"Point-to-Point with" : prompt user P"X-ON/X-OFF is set." : prompt user W2 : : wait 2 sec. .CM_25 : End-if D#8=0 :protocol_set = FALSE. :dial_done = TRUE. :End-no_connected
.CM_26 :BUSY procedure G$0<>"BUSY".CM_28 :a :BUSY :old : G$0="BUSY".CM_27 : BUSY
C-12 response of
Page 219
TRAKKER Modem Program
C
:old : G.CM_28 : Then :old :CM_27 : . P"\e[2JBusy...\r\nWaiting...\r\n" :prompt user W9 :wait 9 sec. P"\e[2JTrying again...\r\n" :prompt user D#6=0 :dial_done = FALSE. G.CM_37 :End-no_busy .CM_28 :Carrier procedure G$0<>"NO CARRIER".CM_33 :a :NO_CARRIER :old : G$0="NO CARRIER".CM_29 :NO_CARRIER :old : G.CM_33 : Then :old : .CM_29 : . P"\e[2JNo carrier." :prompt user P"Change number?\r\n" :prompt user D$0="" :clear input reg. VBK :get input G$0=" Y".CM_31 :If (response = ("Y" Or "y")) G$0=" y".CM_31 : Then P"\e[2JTry again?\r\n" : prompt user D$0="" : clear input reg. VBK : get input G$0=" Y".CM_30 : If(answer <> ("Y"Or"y")) G$0=" y".CM_30 : Then D#6=1 : dial_done = TRUE. .CM_30 : End-if G.CM_32 .CM_31 :Else P"\e[2JEnter Phone No.\r\n" : prompt user D$0="": : clear input reg. N : get input D$2=$0 : save phone no. D#6=0 : dial_done = FALSE .CM_32 G.CM_37
:End-if :End-no_carrier
.CM_33 :No Dialtone procedure G$0<>"NO DIALTONE".CM_35 :a :NO DIALTONE :old : G$0="NO DIALTONE".CM_34 :NO DIALTONE :old : G.CM_35 : Then :old :CM_34 : . P"\e[2JNo dialtone." : prompt user P"Check connection." : prompt user P"Then press ENTER" : prompt user A : wait for input D#6=0 : dial_done = FALSE G.CM_37 :End-no_dialtone
C-13
Page 220
IRL Programming Reference Manual
.CM_35 :OTHERWISE P"\e[2JNo answer\r\nTry again?\r\n" :prompt user D$0="" :clear input reg. VBK :get input G$0=" Y".CM_36 :If [(response <> "Y") : And G$0=" y".CM_36 : (response <> "y")] : Then D#6=1 : . dial_done = TRUE. .CM_36 :End-if :End otherwise .CM_37 :End Connected -Case- procedure (from CM_21) :Until (dial_done = TRUE) :(repeat wait for connect from CM_18) G#6=0.CM_17 ET
:(repeat send phone number from CM_17) :Exit program
.DISCON :Disconnect procedure :old : P"\e[2J" :clear screen :old : Z"\0x09" :clear protected field Z"$+BV0DE0OA0OD0PK\0X00PA5$-" :a :Configure the reader :a : BV0 low volume :a : DE0 no append time to data :a : OA0 no preamble required :a : OD0 buffered display mode :a : PK\0X00 disables XON/XOFF :a : PA5 for XMODEM protocol Z"$+PB0XG1$-" :a :Configure the reader :a : PB0 no cpu resp req'd :a : XG1 resume IRL on power on :old : Z"+.+++%$+BV0DE0IB1IC1ID0XE\0x0D$-" :Configure the reader for :old : Z"$+IG0II7IJ0OA0OD0PA0FC1ZB\0x07$-" : talking with the Modem :old : : ((IJ0) With CTS = OFF) :old : Z"$+ZA\0x1EPK\0x00PL\0x00HB\0x00$-" : with IRL resume = FALSE :old : Z"$+HA\0x00PC\0x00PD\0x00PG\0x00$-" :old : Z"$+PH\0x00PE\0x00FA\0x00XD\0x0E$-" :old : Z"$+IE2IF0PB0PI\0x0D\0x00XA\0x0F$-" :old : Z"$+FB\0x00\0x00XB\0x16XC\0x12XG0$-" :old : Z"$+PJ\0x0D\0x0A$-" W1 :wait 1 sec. .DM_01 :Repeat (ready to disconnect?) D$0="" : clear input reg. P"\e[2JAre you ready to" :prompt user P"Hang up. Y/N?\r\n" :prompt user VBK :get input G$0=" Y".DM_02 :if Y, goto DM_02 G$0<>" y".DM_01 :a :Until (input y or Y) :old : G$0=" y".DM_02 :if y, goto DM_02 :old : G.DM_01 :Until (user wants to hangup)
C-14