Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Serial Write Binary File aborted

I have built a VI to communicate with a UUT (unit under test) over a serial port. The read and write are working properly, but I am having problems with using this port to transfer a binary file. I am attempting to automate an existing procedure performed with hyperterminal which uses the "send file" function with the "ymodem"' protocol setting.

 

There is no error when attempting to use "VISA write from file", and I have verified that the file size & bytes transferred are both 21862 bytes (from "Get file size" and "VISA write from file"). However, the UUT replies with a message that the operation was aborted by the user. I have also attempted to use "VISA Write", but I get the same results (Big or Little Endian).

 

Questions:

1) What changes do I need to make for this to work like Hyperterminal in "ymodem" protocol?

2) Do I need to modify the file before sending?

3) Do I need to send the file 1024 bytes at a time, appending the last message with null bits to make it come out to an even 1024 bytes?

4) Do I need to precede the file with a special header?

 

I have attached 2 pictures of example VIs to represent how I have attempted to use "VISA Write from File" and "VISA Write". The actual VI is built as an event handler driven producer-consumer.

 

======================

Example UUT Response:

======================

 

Erasing 450560 bytes at SPI Flash address 0x180000
Waiting for the file to be sent ... (press 'a' to abort)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

Aborted by user.

OK

err[20:49:37] RCVR: No Updates - Restart

 

======================

 

 

Best Regards,

 

Sam Broyles

 

 

Download All
0 Kudos
Message 1 of 4
(4,816 Views)
Ymodem is not a simple transfer like you are attempting.

http://en.m.wikipedia.org/wiki/YMODEM
0 Kudos
Message 2 of 4
(4,809 Views)

The article on wikipedia suggests that I need to add a block 0 to the beginning of the message with name, size, and timestamp, but padding should not be required on the end of the message.

 

Of course, this assumes that hypeterminal and my UUT are using the standard 1985 implementation of ymodem...

 

 

Best Regards,

 

Sam Broyles

 

0 Kudos
Message 3 of 4
(4,796 Views)
Plus adding the ack/nak handshaking and crc.

Several years ago, I needed ymodem for an old product. I never found a robust implementation in LabVIEW and ended up using HyperAccess, which had an ActiveX interface.
0 Kudos
Message 4 of 4
(4,789 Views)