I have to dial a bunch of different modems with different speed settings etc. If I pass in the connection options and use DIALNUMBER (as in the code below) to dial directly it fails - I send commands OK but the other modem never responds. But if I dial a Connection Directory entry with the modem properties set properly everything works fine. I've checked and the SET PORT commands are working (checked FAILURE, FETCHed the corresponding value and displayed etc.) and tried moving the SET PORT commands after the DIAL DATA...YIELD...ENDWHILE to no avail. Not sure what the documentation means about the currently selected connection in System panel of Setup. Any help would be appreciated - this is driving me buggy. Thx.
#Define CAPTUREPATH "C:\RawData"
#Define CAPTUREFILE "Capture.txt"
string strPhone, strDefCapPath
long lngBaudrate
integer intDatabits, intStopbits, intParity
proc main
strPhone = s0
strtonum s1 lngBaudrate
strtonum s2 intDatabits
strtonum s3 intStopbits
strtonum s4 intParity
set dial retries 2
set port baudrate lngBaudrate
set port databits intDatabits
set port stopbits intStopbits
set port parity intParity
dialnumber DATA strPhone
pause 1
while $dialing
yield
endwhile
if $CARRIER == 0
fopen 0 "C:\Fuel\RawData\Busy.txt" CREATE
fputs 0 "Busy"
fclose 0
pwexit
endif
CaptureData()
hangup
pwexit
endproc
proc CaptureData
fetch capture path strDefCapPath
set capture overwrite on
set capture path CAPTUREPATH
set capture file CAPTUREFILE
set capture recordmode SCREEN
capture on
transmit "^A200"
waitquiet 3 forever
capture off
set capture path strDefCapPath
endproc
#Define CAPTUREPATH "C:\RawData"
#Define CAPTUREFILE "Capture.txt"
string strPhone, strDefCapPath
long lngBaudrate
integer intDatabits, intStopbits, intParity
proc main
strPhone = s0
strtonum s1 lngBaudrate
strtonum s2 intDatabits
strtonum s3 intStopbits
strtonum s4 intParity
set dial retries 2
set port baudrate lngBaudrate
set port databits intDatabits
set port stopbits intStopbits
set port parity intParity
dialnumber DATA strPhone
pause 1
while $dialing
yield
endwhile
if $CARRIER == 0
fopen 0 "C:\Fuel\RawData\Busy.txt" CREATE
fputs 0 "Busy"
fclose 0
pwexit
endif
CaptureData()
hangup
pwexit
endproc
proc CaptureData
fetch capture path strDefCapPath
set capture overwrite on
set capture path CAPTUREPATH
set capture file CAPTUREFILE
set capture recordmode SCREEN
capture on
transmit "^A200"
waitquiet 3 forever
capture off
set capture path strDefCapPath
endproc