Jump to content
Guruthilak

Xmodem protocol using Hyperterminal

Recommended Posts

Hello,

Is there any example in LabVIEW which contains/ Implemented with the Xmodem protocol to transfer FILES to the target system / Client from the PC.

If anyone has done it, can they share the code or guide to implement the same using LabVIEW?

Edited by Guruthilak

Share this post


Link to post
Share on other sites

You can check out the code here. I have also attached some code to calculate the XMODEM CRCs as well as the normal CRC-16.I have also attached the XMODEM-VISA.llb that I used. I am pretty sure this is the same llb referred to in the link I posted but if I recall I added the support for 1K transfers.

Nice. Well worth a point.:thumbup1:

Share this post


Link to post
Share on other sites

Thanks MArk,

I could not reply since we had a long week end out here.

I actaullay saw these VI's before posting the thread. But i would like to know is it possible to send set of "FILES" using these vi's?

If yes how.. ( I am looking at selecting the existing files and sending it to the destination Path. And to make it a little complex, the target is a H/W running linux)

Share this post


Link to post
Share on other sites

Thanks MArk,

I could not reply since we had a long week end out here.

I actaullay saw these VI's before posting the thread. But i would like to know is it possible to send set of "FILES" using these vi's?

If yes how.. ( I am looking at selecting the existing files and sending it to the destination Path. And to make it a little complex, the target is a H/W running linux)

The llb that is attached does support the XMODEM send. You should be able to use those VI's to transfer your files. You may have to modify the send VI's to support the XMODEM-1K transfer if you are going to use it. The CRC VI's will work fine for calculating your CRC's. However you will need to read your file and send it is chunks according to the XMODEM protocol. You can find more information about it here and here.

Share this post


Link to post
Share on other sites

You can check out the code here. I have also attached some code to calculate the XMODEM CRCs as well as the normal CRC-16.I have also attached the XMODEM-VISA.llb that I used. I am pretty sure this is the same llb referred to in the link I posted but if I recall I added the support for 1K transfers.

Thanks alot Mr.Mark.

I was searching for the same.It helped me at the right time.

Share this post


Link to post
Share on other sites

Currently I send serially a collection of hex files that have been dubbed a “FW†file via HyperTerminal in Xmodem format to an embedded device. I would like to do this in LabVIEW. I am not familiar with where I should start.

 

I have used the Calculate XMODEM CRC-16 (File input).vi with my FW file.  The Calculate XMODEM CRC-16 (File input).vi appears to handle the FW file accurately. It calculates the length accurately. I don’t know where to start in order to send the file serially to the embedded device in a Xmodem format.

Share this post


Link to post
Share on other sites

I don’t know where to start in order to send the file serially to the embedded device in a Xmodem format.

I'd start by maybe putting a man in the middle, and do your process as you normally have using HyperTerminal, but look at the trace of data going in and out.  Then you can probably start there then read up on the particular protocol to help understand it more.

Share this post


Link to post
Share on other sites

Sniff the serial traffic. Either with another PC on the serial bus as a listener, or there is software that will listen to the traffic on a physical serial port and log.  Then you can review the data later.  Actually if you have this in HyperTerminal can't you just log the traffic there?  Maybe copy and paste the communications after a download is complete?

 

EDIT:  Man-In-The-Middle, but maybe I should have said to Eavesdrop.

Share this post


Link to post
Share on other sites

I have sniffed the communication using UART to USB interfaces with Hyper-terminal.

I sniffed the file going out and the communication being sent back. I saved these in files.

 

When I started the transfer the receiving end transmission sent out a two uppercase "C"s and then 1451 Acknowledgements (Looking a file through Notepad++)

The last portion in the receiving file is a CAN (again viewed through Notepad++)

 

Where do I start with the x-modem vi libraries?  Do I Initiate receiving first or send or something else?

Share this post


Link to post
Share on other sites

 

Where do I start with the x-modem vi libraries?  Do I Initiate receiving first or send or something else?

 

Do you understand the protocol? You need to know the basics of sending vs receiving before coding your solution.

 

Start with this...

 

http://wiki.synchro.net/ref:xmodem#initial_handshake_rules

Share this post


Link to post
Share on other sites

I am nearly as confused as before.

 Is it safe to assume that I only need to initiate the send computer since my receive computer is a microcontroller?

Share this post


Link to post
Share on other sites

I have sent out a "xmodem" in a string with carriage return. I am sniffing the transmit out of my UART. The UART transmit line then continuously sends a negative acknowledgement (NAK).

Am I on the right track?

Share this post


Link to post
Share on other sites

I have sent out a "xmodem" in a string with carriage return.

 

Why?

 

 

I am sniffing the transmit out of my UART. The UART transmit line then continuously sends a negative acknowledgement (NAK).

Am I on the right track?

 

Doubtful. Did you try what I suggested above?

Share this post


Link to post
Share on other sites

I got it !!!!!!

Thank you, to all those who helped. I was making it much more difficult than it really was. :oops:

Share this post


Link to post
Share on other sites

I didn't realize that all I needed was to send a "xmodem" serial string. Add a few second wait and then  use "VISA SEND VI" with my firmware file. 

 

 KISS

 

"Keep It Simple Stupid"

 

 

Thanks everyone :thumbup1::beer_mug::thumbup1:

Edited by jew666

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.