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!

Ymodem Download Script

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
I hope someone can help me. I am attempting to write a Script in ProComm to Autodownload a File. I need to use Y-Modem. Currently I have to do the Following:
1. Click ALT CTRL 4 to Start Y-Modem
2. Click on the ProComm Window (to Make it Active).
3. Hit the Enter Key.
4. Click on the DownLoad window (to Make it Active).

Any Help you can offer will br truly appreciated.
 
It's been a while since I've done a Ymodem download, but I think you can take the example getfile script in the ASPECT help file and modify it successfully. Here's what I would try:

transmit "^M" ; Send Enter key.
waitfor "Start Xfer" ; Wait for signal to start transfer.
getfile YMODEM ; Get file with Ymodem protocol.
iStatus = $XFERSTATUS
while iStatus ; Pause script while transferring.
yield ; Yield processing time
iStatus = $XFERSTATUS
endwhile

In the script snippet above, you would need to additionally declare an integer variable called iStatus. You would also need to modify the waitfor command to look for a different string that indicates the remote system is ready to send the file. With this script, I don't think you need to worry about setting which window has focus.
 
Ok,

I tried this and I still have a Problem Getting the Y-Modem transfer to start. If I Manually start (ALT CTRL 4) the Y-modem receive file,everything works fine. Any Ideas? Here is what I have for now.

proc main
integer iStatus
transmit "Y^M"
Waitfor "Do you wish to send the file (Y/N) :" 300
transmit "Y^M"
waitfor "The file will be transferred using the YMODEM BATCH protocol." forever
transmit "^M" ; Send Enter key.
waitfor "Start Xfer" ; Wait for signal to start transfer.
sendkey ALT 'A'
SENDKEY 'R'
getfile YMODEM ; Get file with Ymodem protocol.
iStatus = $XFERSTATUS
while iStatus ; Pause script while transferring.
yield ; Yield processing time
iStatus = $XFERSTATUS
endwhile
waitfor "Function: "
transmit "LOG^M"
waitfor "Action: "
transmit "LOG^M"
hangup
endproc

thanks for the Help
 
Here's the script I was able to use to download a file via Ymodem this afternoon (didn't think I would be able to find a place to test this!):

proc main
integer iStatus

waitfor "YMODEM receive."
pause 1
getfile YMODEM
iStatus = $XFERSTATUS
while iStatus
yield
iStatus = $XFERSTATUS
endwhile
endproc

What happens if you take out the two sendkey commands and replace them with the pause 1 command I used in my script? The pause 1 is not necessarily needed, but I inserted it just to give the machines a little breathing room before starting the transfer.
 
Excellent,

That worked great, I really appreciate the time you put in with this. on question In my script i am downloading a file called AS. If I wanted to make that user defined? would i use a Sdglput and assign that to a variable and then use the transmit command to send the variable??
Example:
proc main
integer iStatus
sdlginput "Export" "Enter Table to Export:" szFileName
transmit szFileName ;THIS IS WHERE I HAD AS SPECIFIED
transmit "Y^M"
Waitfor "Do you wish to send the file (Y/N) :" 300
transmit "Y^M"
waitfor "The file will be transferred using the YMODEM BATCH protocol." forever
transmit "^M" ; Send Enter key.
waitfor "YMODEM receive."
pause 1
getfile YMODEM
iStatus = $XFERSTATUS
while iStatus
yield
iStatus = $XFERSTATUS
endwhile
endproc

THANKS AGAIN FOR THE hELP
 
You're on the right track. Since I can't access the system you are using, I can't tell if you have all the waitfor and tranmit statements in the correct place, but you are definitely going about it the right way. Does your script work successfully?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top