Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-10-2017, 10:31 AM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
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
Reply With Quote
  #2  
Old 01-10-2017, 12:04 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,020
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
Reply With Quote
  #3  
Old 01-10-2017, 01:24 PM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
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
Reply With Quote
  #4  
Old 01-10-2017, 02:34 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,020
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
Reply With Quote
  #5  
Old 01-10-2017, 07:15 PM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:55 AM.