WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Serial
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Uploading text files with serial extender

Keywords:     pPutBinary

Question:

I love your new serial extender for Winbatch, but I don't understand why you haven't made it easier to squirt a plain text file out the serial port without using an error-correcting protocol (It would be nice, though not essential, if I could construct a progress indicator, too). I work for a newspaper where our reporters send dozens of text files into our main frame every day from their laptops. I'd love to write a stand-alone application in Winbatch to automate the process, but I just can't find a way. Can you help?

Answer:

Well...mostly it's not done beause it does not work. But for a pure squirt, ignoring line noise and a host of errorprone overrun conditions....
  1. Establish a comlink and get a port handle.

  2. Squirt a file.
    fn="C:\filname.of.file.to.squirt"
    fs=Filesize(fn)
    binbuf=BinaryAlloc(fs)
    BinaryRead(binbuf,fn)
    binaddr=IntControl(42,binbuf,0,0,0)
    pPutBinary(port,binaddr,fs)
    BinaryFree(binbuf)
    
That will just dump the file out the serial port. I recommend some kind of error correction protocol on both sizes. Either XMODEM or ZMODEM or something. (Which does have a progress indicator) or at least checksum the binary buffer before sending it.
Article ID:   W12580
Filename:   Uploading Text Files using Serial Extender.txt
File Created: 1999:04:15:16:48:12
Last Updated: 1999:04:15:16:48:12