Guruthilak Posted September 17, 2009 Report Share Posted September 17, 2009 (edited) 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 September 17, 2009 by Guruthilak Quote Link to comment
Clio75 Posted September 17, 2009 Report Share Posted September 17, 2009 (edited) Hmmm Edited September 17, 2009 by Clio75 Quote Link to comment
Popular Post Mark Yedinak Posted September 17, 2009 Popular Post Report Share Posted September 17, 2009 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. Calculate CRC-16 (File input).vi Calculate CRC-16.vi Calculate XMODEM CRC-16 (Buffer input).vi Calculate XMODEM CRC-16 (File input).vi Get CRC-16 Table.vi Calculate CRC-16 (Buffer input).vi Xmodem VISA.llb 6 Quote Link to comment
ShaunR Posted September 17, 2009 Report Share Posted September 17, 2009 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. Quote Link to comment
Guruthilak Posted September 22, 2009 Author Report Share Posted September 22, 2009 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) Quote Link to comment
Mark Yedinak Posted September 22, 2009 Report Share Posted September 22, 2009 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. Quote Link to comment
Sathish Kumar Posted July 19, 2012 Report Share Posted July 19, 2012 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. Quote Link to comment
jew666 Posted March 26, 2015 Report Share Posted March 26, 2015 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. Quote Link to comment
hooovahh Posted March 26, 2015 Report Share Posted March 26, 2015 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. Quote Link to comment
jew666 Posted March 26, 2015 Report Share Posted March 26, 2015 "Put a man in the middle"? Quote Link to comment
hooovahh Posted March 26, 2015 Report Share Posted March 26, 2015 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. Quote Link to comment
jew666 Posted March 26, 2015 Report Share Posted March 26, 2015 I will try that and get back to you. Quote Link to comment
jew666 Posted April 6, 2015 Report Share Posted April 6, 2015 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? Quote Link to comment
infinitenothing Posted April 17, 2015 Report Share Posted April 17, 2015 Wait for a "C" from the receiver and then run "Xmodem Send.vi" Quote Link to comment
Phillip Brooks Posted April 17, 2015 Report Share Posted April 17, 2015 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 Quote Link to comment
jew666 Posted April 21, 2015 Report Share Posted April 21, 2015 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? Quote Link to comment
jew666 Posted April 23, 2015 Report Share Posted April 23, 2015 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? Quote Link to comment
infinitenothing Posted April 23, 2015 Report Share Posted April 23, 2015 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? Quote Link to comment
jew666 Posted April 23, 2015 Report Share Posted April 23, 2015 I got it !!!!!! Thank you, to all those who helped. I was making it much more difficult than it really was. Quote Link to comment
infinitenothing Posted April 27, 2015 Report Share Posted April 27, 2015 (edited) Maybe explain how you fixed it for future visitors. https://xkcd.com/979/ You might phrase it differently. It's hard for us to think from the perspective of someone that's lost. Edited April 27, 2015 by infinitenothing 1 Quote Link to comment
jew666 Posted May 1, 2015 Report Share Posted May 1, 2015 (edited) 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 Edited May 1, 2015 by jew666 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.