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: 

How to transfer .text file data over serial port to my embedded device?

Hi All

I am new to labview VI programming.

I want to transfer the data of .text file using VI over the serial port using uart to my embedded device.

I attached the file which I want to transmit.

Please suggest me the possible solutions.

Thanks.

0 Kudos
Message 1 of 6
(2,486 Views)

If you want to transmit the contents of the file, then you can use LabVIEW's functions to open and read the file, and then transmit using appropriate VISA calls.
You might need to use some of the conversion nodes if those lines are binary 'numbers', rather than ASCII representations of hexadecimal (i.e. the letter 'A' is represented by the number 65 in an ASCII table, but the hexadecimal value A is represented by 10 as a decimal value). See, for example, https://forums.ni.com/t5/LabVIEW/Convert-Hexadecimal-String-to-Byte-Array/td-p/3009131/page/2

 

If on the other hand you want to copy the file into some embedded device (in the style of, for example, FTP) then you're dependent on the embedded device's capabilities. If this is the case, please let us know some more about the device - does it have any tools/APIs to transfer/store files, or to save the contents of a stream of communication to disk, etc?


GCentral
0 Kudos
Message 2 of 6
(2,466 Views)

Actually I am using MSP430 microcontroller as a embedded device. So I have made a GUI from which I wanted to transfer .text file to my controller.

So the file data will store into flash memory.

0 Kudos
Message 3 of 6
(2,378 Views)

@Madhav241296 wrote:

Actually I am using MSP430 microcontroller as a embedded device. So I have made a GUI from which I wanted to transfer .text file to my controller.

So the file data will store into flash memory.


Things may seem to happen magically when you are an end user, but when you are a software developer, it's your job to make it seem like magic.  😄

 

Unless the microcontroller has embedded file transfer routines, you'll probably have to write them from scratch.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(2,353 Views)

Right now I am in developing the GUI which will transfer the data of file through GUI.

So my idea is to first the take the data from file store into an array and so checksum then transmit it over UART.

But I am facing an issue while reading the data from file.

Actually my file is having 125 rows. Each row containing one hex value for example 0x005432. Likewise total 125 values.

But while reading I am not able to read that on array.

Can you guide me with proper theory or VI example?

0 Kudos
Message 5 of 6
(2,341 Views)

Hi Madhav,

 


@MadhavMalaviya wrote:

But while reading I am not able to read that on array.


Maybe it would help when you attach your VI and file so we could tell you how to solve this problem!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,335 Views)