From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send text file via serial

hi

i've trying to send a text file via rs-232 but no success

 

The file contains a code for a device im dealing with, when i send the text file with labview to the device, it went ok with no errors, but when i connect the device on hyperterminal and check if the code was loaded it was not.

 

can you please give some clues to deal with this?

 

thanks a lot

 

attached example text file and LV code

Download All
0 Kudos
Message 1 of 4
(2,263 Views)
It looks like you are reading the entire file at once so the loop is pointless. You may in fact need to write a line at a time with each line terminated correctly or each command. In either case, you want to read the file once and create a string array that is indexed by s for loop.
Message 2 of 4
(2,256 Views)

Some devices are very picky with the End Of Line.  You might want to right-click on your FIle Read and deselect the "Convert EOL".

 

Or if you need to write 1 line at a time, right click on the Read Text File and select "Read Lines".  Set the number of line to read to -1 (read all) and then wire the resulting array into a FOR loop where you do the VISA Write.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,206 Views)

Thanks for your replies

 

it seems the for loop thing worked

 

thanks for helping

0 Kudos
Message 4 of 4
(2,193 Views)