output delay after crt.Screen.Send
Hi
Sometimes, after send a command with crt.Screen.Send "COMMAND" & chr(13), i'm wait for a specific string, ex: crt.Screen.WaitForString "RESULT". But that specific string it's situated between another strings, this does sometimes the order crt.Screen.WaitForString not read the string expected. I guess this happens because the router send the outout very fast and the script can not read crt.Screen.WaitForString "RESULT" is there any way to delay the output in secure.crt. Regards |
If you haven't done so already, I'd suggest you spend some time reading through the scripting guide.
Even if you're not using VBScript as your SecureCRT automation language, the concepts described in chapters 4 and 5 can be helpful for understanding concepts like "synchronous". In general, you'll want to make sure that at the top of your script (or immediately following any Connect...() calls), you set the Screen object's "Synchronous" property to true, which will make sure that data doesn't get displayed to the screen before you make any calls designed to wait for or capture the data. In your specific case, it would be helpful to know more details about the situation in which the problem occurs, so that a specific suggestion can be made towards a resolution. Can you provide the specific text you're seeing, what you're waiting for and how, specifically, your script is failing? --Jake |
Hi Jack
I´m set the Screen object's "Synchronous" property to true, you can see it in the script: Quote:
Text format where the word is busy after send the check status command, is: Quote:
Regards |
The risk I see with your code is that you're waiting for "busy", but you're also passing in a timeout parameter of 5 seconds.
Is there ever a time where you won't see "busy" within 5 seconds of issuing the check-status command? If so, you'll need to up your timeout to accommodate the worst of cases. Another approach would be to wait for more than one string, one for the failure (busy) case, and another for the success case. If the device is not "busy", what shows up in the output of the command instead? In other words, is there something you see on the screen that tells you it's *not* busy as a result of running the check-status command? If so, then you can tell SecureCRT to wait for multiple strings, and tell you which one it found, so you can branch on that data to either exit your loop or continue waiting, or call your Aunt Sandra, or whatever you desire :). For the sake of example let's say that your router says "Router ready" instead of "Router resources are busy" when it's, well, ready instead of busy. Your loop would look like this instead (throwing in a little bit of extra cool-ness in there for fun :)): Code:
nTimeOut = 5 |
All times are GMT -6. The time now is 09:02 PM. |