LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

moving into a coordinate text file?

Hello,

 

Is it any easy way in LabView to move inside a coordinate file?? Let's say I have a .txt file with 2 columns:

 

Xcoord    Ycoord

12            2

4              9

3              1

5              7

etc...

 

My question is about the best/easiest way to perform reading actions like "Read first point", "Move to next point", "Read previous point", etc etc.

 

I am not an expert in LabView so I really do not know a very good way to do that.

 

Of course all these actions come from "Events", from buttons in the front panel.

0 Kudos
Message 1 of 3
(1,890 Views)

Hi Edu,

 

read the file using ReadFromSpreadsheetFile will result in a 2D array of numbers (with atleast 2 cloumns).

 

To "move on" you could use an autoindexing loop.

To realize random access you should use a while loop with a shift register holding your current index into that array. Now all you have to do is to manipulate that index and use an IndexArray function to "read" the current row from your 2D array!

 

- For those simple array functions you should go through the online courses offered (for free!) by NI. Really!

- To use "events" you should consider a simple state machine driven by an event structure. It's quite easy once you got the concept…

Best regards,
GerdW


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

Hi,

 

Thanks GerdW, woow it sounds like it is easy to say but hard to implement....

 

Anyway thanks for your guideline, I will try to write the code and let's see if I can get what I need.

 

Thanks again!

0 Kudos
Message 3 of 3
(1,867 Views)