Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one procomm at a time

Status
Not open for further replies.

lautrepierro

Programmer
Apr 26, 2004
6
CA
hi,
each time I try to execute a file.wax with PW5 another instance of procomm open. is there a way to make sure that the procomm window alreay open will execute the file?

thanks

pierre
 
here is the code, i'm using C# to interact with the file:
it interract with an alcatel device. not really stable, for example it doesn't always transmit the first ";", but if i enter";" for the script, the script will continue.

; in telnet mode
connect TELNET "VANDACS"
while $DIALING
endwhile
if $CARRIER
transmit ";"
endif

waitfor ";"
transmit "ACT-USER::username:::password;"

set capture path "C:\temp"
set capture file "tempfile.txt"
set capture overwrite on
; waitfor "COMPLD"
waitfor "<"
capture on
transmit "RTRV-T1::T1-810;"
waitfor "COMPLD"

waitfor "/* RTRV-T1::T1-810" ; end of the cmd
; waitfor ";"
capture off
transmit "CANC-USER;"
hangup
pwexit
endproc
 
Sorry, I meant how are you launching the script? Are you running just the .wax file, a full command line to Procomm and the .wax file, etc.


aspect@aspectscripting.com
 
the cmd that I use is:
PW5 FILE.WAX using System.diagnostics form c#

Pierre
 
Running Procomm and the script in that manner will always entail a new session of Procomm being launched.

I don't know if C# supports this (I would think so though), but you could probably search the open applications on the machine for one containing the string "Procomm" in the title bar, set focus to that window if it exists, and then issue the necessary commands to run a script (send an Alt-F5, enter the name of the script, and send a return key).


aspect@aspectscripting.com
 
c# does't seem to be so good for that but i will check again if not i will try another solution.
i'm triing this solution where i execute the wax file from the startup file. but my file posted earlier is stuck waiting for the dialer i guess because when i enter the ; myself the script continue with no problem. Do you see why thsi script will wait for me to do the ";" and not do that itself.

Pierre
"there is always a solution
 
Based on a couple of your messages, there are a couple things that could be going on. First, if the transmit ";" doesn't send something after the script has connected, you might try adding a pause 1 or pause 2 command just before the transmit command.

One thing to keep in mind regarding the waitfor command is that it will time out after 30 seconds if the string you told it to look for is not received, and then move on to the next command. You might try adding the keyword FOREVER to the end of the waitfor command in case that command is timing out, continuing on with the script, and making it look like the script is not working correctly for a different reason.

One other thing I would recommend that may or may not have any impact is adding a yield command between the while $DIALING/endwhile commands. This will keep Procomm from hogging the CPU quite as much while it is in the loop.


aspect@aspectscripting.com
 
this last message help a lot. this "pause 1" made all the difference. time out after 30 sec? I will check if there is a way to chnage that.

thank you great help

Pierre
 
You can modify the timeout value of the waitfor command by specifying a timeout value in seconds at the end of the command, or by using the FOREVER keyword like I mentioned previously. It would look like this:

waitfor ";" 60

to wait for the semi-colon for 60 seconds, while:

waitfor ";" FOREVER

would have your script pause on this command until the semi-colon was received.



aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top