I use the following script to send a command to the host and capture the response in a text file. In addition, I use the waitfor command to determine when the response string is finished. The response string always terminates with a ^C
I've been using this for years and it has been working great with speeds from 1200 to 9600 baud. Now, I want to strip the first 5 characters from the response because I don't want those characters to be displayed in the log file.
This is what I have tried with limited success.
The rget works fine. It strips the first 5 characters from the response string. The problem is that when I am communicating at higher speeds such as 9600, the waitfor command times out. Even though the ^C character is received. It seems like by the time the rget command releases to the next waitfor statement, the ^C character has already been received so the waitfor command times out. I tried using the set rxdata on and still, the waitfor command times out. Here is what my latest script looks like.
Can anyone help me accomplish this. I need to strip the first 5 characters off of the response string but I want the following waitfor statement to start looking at the 6th character.
I appreciate your help.
ToddWW
Code:
set capture file "myfile.txt"
capture on
transmit "200^M"
waitfor "^C" 10
if failure
call processfail
endif
This is what I have tried with limited success.
Code:
set capture file "myfile.txt"
capture on
transmit "200^M"
rget 5
waitfor "^C" 10
if failure
call processfail
endif
Code:
set capture file "myfile.txt"
capture on
set aspect rxdata on
transmit "600^M"
rget 5
set aspect rxdata off
waitfor "^C" 10
if failure
call processfail
endif
I appreciate your help.
ToddWW