LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data as a text file in labview fpga

Hello

 

I have a simple question about saving a variable at different times as an array in a text file in LabVIEW FPGA. You can find my code and a screenshot of it attached. I will explain the relevant part of the code:

I have an infinite outer loop; inside this loop, I have an inner loop that is executed until some conditions (it doesn't matter what conditions) are satisfied. However, I want to save the iteration of the inner loop at which the condition is satisfied (The value of the final iteration of the inner loop). Ultimately, I want to output a text file containing values of the last loop iteration every time it comes into this loop. How should I do it?

In Labview, it is possible to write data to a text-based spreadsheet file. But I did not find this option in Labview FPGA!

 

 

I appreciate your help.

Sincerely,

Majid

 

code.jpg

0 Kudos
Message 1 of 5
(1,598 Views)

Because there is no storage space or file system on the FPGA. If you need to save the data, you need to send it to the host and let the host save it to a file.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 5
(1,590 Views)

Hi Santhosh

 

Thanks for your comment.

May you explain how I can send the data to the host?

 

Bests,

Majid

0 Kudos
Message 3 of 5
(1,548 Views)

This is a good article to get started,

https://www.ni.com/docs/en-US/bundle/labview-fpga-module/page/lvfpgaconcepts/fpga_data_transfer_over...

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 5
(1,545 Views)

Dear Santhosh

 

Thanks for your helpful comment.

I created a host VI and sent the loop number through the DMA FIFO method to host VI. But I can not write this data into a text file!

My data are integer numbers, but the "Write to Text File" function only accepts strings! I use the Format into String Function to convert each integer value into a string, but it makes an error.

(The error says: The type of the source is 1D array of unsigned long [32-bit integer (0 to 4,294,967,295)]. The type of the sink is unsigned long [32-bit integer (0 to 4,294,967,295)]. )

How should I do it?

The picture of my codes is attached.

Kind regards,

Majid

Host VI.jpg

FPGA VI.jpg

 

0 Kudos
Message 5 of 5
(1,477 Views)