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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Waitfor Usage and Tips

Status
Not open for further replies.

circuitman

Technical User
Apr 28, 2010
5
TR
Dear Experts,

I need help about the usage of waitfor.

I have some datas where coming from a processor. I see some words in screen.Like that;

dfdf
dfdfdf 111
dfdf
dfdf
dfdf _RAM:en
ddf
www

What I want to do is using waitfor"_RAM:" commmand, run some commands in the script file below,

Script Code:

proc main
integer da = 1

waitfor "_RAM"
/Commands I want to run after waitfor catches _RAM: word from screen/

transmit (" new tag 1708h^M")
pause (da)

transmit ("filter 170eh^M")
pause (da)

transmit ("filter 74 tag 188dh^M")
pause (da)


Is that works???

Thank you,
Eray
Support Engineer
 
You've got the basics down. The key thing to remember about the waitfor command is that it times out after 30 seconds and moves on to the next command, even if the string you were looking for was not received. If that's a concern, you can specify a longer time interval or use the FOREVER keyword to have the script never proceed until the string is received.


 
I guess I have to use it like this ;

waitfor "_RAM:" FOREVER

waiting indefinitely.

Is this OK?

Another problem I hope port buffer does not bother me because it may takes 10 mins to wait for the string. :(

Thanks
 
Thank you Knob for support.

I have a one more concern about waitfor, the speed of incoming data. If it is too fast to past on screen, Isthat bothers procomm to catch it?

 
I also want to capture all response of processor so that should I first start to capture file than run the script?

Is that right way to capture responce of processor after the script to be run.

Thank you, dear experts.
 
No, Procomm will display the data as it comes in and the speed does not impact the waitfor command, nor does the waitfor command impact on the speed of the data displaying.

To capture the data received, used the capture ON command to start the capture process and capture OFF to close the capture file.

 
Script Code:

proc main
integer da = 1
capture ON / Where is the destination of capture file???
textkey CTRL 'N'
waitfor "_RAM:"

transmit (" new tag 1708h^M")
pause (da)

transmit ("filter 170eh^M")
pause (da)

transmit ("filter 74 tag 188dh^M")
pause (da)


Is that works???

Thanks
 
That should work as best I can tell. If there is a prompt that indicates all data has been received after "_RAM:", you could use a second waitfor command for that to make sure you don't send data while the system is still sending data to your computer. Usually this won't cause a problem, just something to keep in mind.

To specify where a capture file goes and its name, you can use the set capture path and set capture file commands.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top