#1
|
|||
|
|||
Sleep Issue
I'm trying to get my script to return the results of the command to the screen and then sleep for 5 seconds before disconnecting.
So this is a snipplet of my code: objse.logfilename = "C:\Users\Tony\Documents\crt.Log" objse.Log(True),True crt.Screen.Send chr(1) & "200" & chr(13) crt.Sleep (2500) objSE.Disconnect What happens is the command gets sent but the data does not display on the screen, It delays and then disconnects before anything is echoed back. How can I allow it to display the results to the screen and THEN disconnect? This is the typical results: 200 POCOMOKE MART JAN 10, 2017 10:55 AM TANK PRODUCT GALLONS INCHES WATER DEG F ULLAGE 1 DIESEL 1150 52.04 0.0 48.5 886 2 K-1 4569 67.97 0.0 55.0 1467 3 SUPER 93 6719 52.40 0.8 52.0 5317 4 REGULAR CONV 6274 63.66 1.3 51.3 2950 5 REGULAR CONV 3937 38.81 1.2 51.6 2099 Thanks in advance |
#2
|
|||
|
|||
Hi Tony,
What sort of remote device are you connecting to? Is this still with Telnet protocol as indicated in your other posts? Do you have Synchronous set to True in the script?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Hi bgagnon, The remote device is a Veeder Root Tank monitoring gage. We connect to it and then send the command CTRL A 200 and it sends back on the screen how much fuel is in each tank.
and yes the objsc.Synchronous = True is at the top of the script thanks |
#4
|
|||
|
|||
Hello Tony,
Does the connection ever timeout before receiving the output when you run the command manually? As mentioned in section 4.2 of the scripting manual, anytime you use Send(), you probably want a corresponding WaitForString(). That way you don't have to set some arbitrary sleep value, you would know the output is complete when this string is received, usually the shell prompt.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
Thank you. When the command returns the data onscreen there is no character, just a curser, so I told the script to wait for a > for 5 seconds then move on and that worked although its not the correct way to do it.
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|