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 to change Procomm Plus start date automatically in a script??

Status
Not open for further replies.

JBRMN

Technical User
Jul 21, 2009
17
CA
Hello there, first time as a member here, just like to say thanks is greatly appreciated

I have been looking at some of the date changing info on this site and have not been able to implement it into my script that is suppose to get data every week by dialing up to the modem, but I am having difficulties changing the start date to a week before the date at which the gauge info is downloaded, to get the full week of data. My basic is:

proc main

string Name = "scotch.doc" ; Name of capture file to open.

set capture file Name ; Set name of capture file.

waitfor "NORMAL^[[20;25H"
transmit "u"
;area where i think i need to have a change in the start date

waitfor " ^H"
transmit "s"
waitfor "<<< Press ENTER to Start, A for Ascii, X/Ymodem, or ESC to Abort >>>^@^@^@"

transmit "a"

capture on ; Open up the capture file.
while $CARRIER ; Loop while connected to remote.
yield ; Yield processing time

waitfor "<<< Press ENTER to Continue >>>"
transmit "^M"

capture off ; Close the capture file.

endwhile

endproc






the function below is the one that i am trying to include in my script above, need to change the date after i tell procomm to transmit "u" for upload. but have been unable to do this, does anyone know an easy way?
can i get rid of iDaysAgo and just put a 7 in there??

func XDaysAgo : string
param integer iDaysAgo
integer iDay, iMonth, iYear, iHour, iMin, iSec
long lDate
string sDate

lDate = $LTIME - (86400 * iDaysAgo)
;Derive timeval for specified num. of days ago

ltimeints lDate iYear iMonth iDay iHour iMin iSec ;Convert timeval to integer components

strfmt sDate "%02d%02d%d" iMonth iDay iYear ;Create MMDDYYYY string

strdelete sDate 4 2 ;Delete first two numbers from year value
return sDate

sorry for the mess let me know if you have any ideas!
thanks again

 
THis script is suppose to be called up after procomm connects to the Milton dam automatically throught procomm plus scheduler and the settings in the connection directory, here is the script:


proc main

string Name = "Milton.doc" ; Name of capture file to open.

set capture file Name ; Set name of capture file.

waitfor "NORMAL^[[20;25H"
transmit "u"

execute "changingdate.wax" ; executes the changingdate script start date must line up with procomm


waitfor "<<< Press ENTER to Start, A for Ascii, X/Ymodem, or ESC to Abort >>>^@^@^@"
transmit "a"

capture on ; Open up the capture file.
while $CARRIER ; Loop while connected to remote.
yield ; Yield processing time



waitfor "<<< Press ENTER to Continue >>>" FOREVER
transmit "^M"

capture off ; Close the capture file.

endwhile

endproc

I tried using a exit 42 on the second last line doesn't seem to do anything...
thanks for the help
 
Are your capture files being closed successfully? What does the transmit "^M" just before the capture off command do? My guess is that the while $CARRIER loop is not beind exited, possibly due to the script not sending the proper command(s) to logoff.

 
my capture files are being closed successfully, as for the transmit "^M", that is suppose to be an enter key, but im not sure if that is really neccessary. Thats a good point about not being exited properly, how would I go about disconnecting the connection and then exiting the script, it seems like the disconnect command doesnt work, or maybe its because the $carrier loop isnt' being exited, what if I take that out, would that help... any help much appreciated

thanks

JBRMN
 
I took out the while loop and put in a disconnect, clear, and exit 42 commands at the end and they work great now, must of been the $carrier loop not exiting, seems like things are working well, thanks for pointing me in the right direction once again,

cheers


JBRMN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top