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!

How do I create a loop to poll, exiting once correct text prints out?

Status
Not open for further replies.

rdp3678

Technical User
Jun 9, 2011
4
US
How do I create a loop to poll, exiting once correct text prints out from a "transmit" command?
 
Can you give us a little more details? Usually you would use the waitfor command (might need to specify a timeout longer than the default 30 seconds) or when target.

 
I'm loading software but it doesn't reply when it's complete. I need to query the unit periodically with a get_status command to find whether it's in progress or complete. The 2 different responses:

DownloadInProgress
OperationSucceeded

DownloadCompleted
OperationSucceeded

Once I get the completed message I want to script to continue with the software activation. Suggestions? Thanks for your time.
 
Thanks Knob, but I'm still having an issue with this script. How do I pass the first line of the response thru the waitlist function? I feel that the second line "OperationSucceeded" is only being passed.
 
Here is how I'm trying to call it:

while SUCCESS
pause 15
transmit "getswsessionstatus 1^M"
WaitList(30, "DownloadInProgress", "DownloadCompleted", $NULLSTR)
if WaitListStat == 1
SUCCESS
elseif WaitListStat == 2
FAILURE
elseif WaitListStat == 3
FAILURE
elseif WaitListStat == 0
FAILURE
endif
endwhile

I'm new to aspect programming and very rusty with C so any help would be appreciated.
 
OK, I think the problem is that you're trying to set a value for success/failure in your script and then likely trying to check for that value just after this code in your script. Only ASPECT (and only using certain commands) can set success or failure. What you can do instead is move the appropriate commands into the appropriate if clauses in your script.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top