XMODEM file transfer

I'm trying to send a file using the xmodem standard. When all file data has been sent I then pad the final xmodem packet with ^Z characters (0x1A). My difficulty is that, using various terminal programs, these ^Z characters become part of the file received.

0.020,1.962000,0.039240,0.000785,203.000000 0.040,3.924000,0.117720,0.003139,203.000000 0.060,9.810000,0.313920,0.009418,203.000000 . . . 2.480,0.000000,-2.177820,-1.784243,203.000000 2.500,0.000000,-2.177820,-1.827799,203.000000 

Can anyone please tell me what I have to do to have the receiver ignore these padding characters?

Regards, Murray. _____________________________________ Murray R.Van Luyn snipped-for-privacy@cs.curtin.edu.au

Reply to
M.R.Van Luyn.
Loading thread data ...

The ^Z character was an old DOS standard for text files to indicate the end of file. I don't think it's really recognized by other systems. Trying to figure out where the actual end of file should be is usually done by either using a protocol more modern thatn plain XMODEM or by putting a data format on top of XMODEM like having the first packet contain things about the file itself like the size or name.

Reply to
Gary Kato

...

You don't. Xmodem transmits in units of 128 bytes. Under CP/M and MsDos text files treat 0x1a as EOF markers. What the final file processing does is up to you.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
     USE worldnet address!
Reply to
CBFalconer

Thanks Gary and Chuck.

It appears that the XMODEM standard is fixed to 128 (or 1024) byte long packets, and with no facility for transmission of file name or length. I'm stuck with the trailing ^Z characters in the last packet.

It seems that the terminal programs that I examined append trailing space characters instead of ^Z. I hadn't noticed this until you pointed out the fact that the receiver makes no distinction between data and terminating characters in the final packet. I think I'll use the same trailing spaces strategy.

A better choice might have been YMODEM. That is unless anyone can suggest something more appropriate for 5KiB, CSV file, data logger downloads?

Regards, Murray. _____________________________________ Murray R.Van Luyn snipped-for-privacy@cs.curtin.edu.au

Reply to
M.R.Van Luyn.

YModem is batch XModem, not a lot more efficient. (XModem is ~78% efficient, by the way). If you can squeeze an implementation, why not use ZModem? It's more efficient.

Reply to
Lewin A.R.W. Edwards

Another choice is Industrial ZMODEM(Tm). As the name inplies, Industrial ZMODEM is carefully tuned for embedded applications which have memory and functional constraints.

formatting link

--
Chuck Forsberg    caf@omen.com   www.omen.com   503-614-0430
Developer of Industrial ZMODEM(Tm) for Embedded Applications
  Omen Technology Inc      "The High Reliability Software"
10255 NW Old Cornelius Pass Portland OR 97231   FAX 629-0665
Reply to
Chuck Forsberg WA7KGX

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.