LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to load in Excel script for cRIO (streaming?)

Right now my program reads from an excel file to create custom tests to be performed by the cRIO.   I insist on excel being the input method since it is easy for non-programmers to use and manipulate.  The excel files are simple.  A String that describes an action (IE: Close Relay 5), and the second column denotes the amount of time to wait prior to the next line.   But these tests can range between 5 to 200 lines and in some setups there are 10-20 tests.

 

Reading from excel is slow, so if I read Excel as I execute the test it throws off the timing.   Loading at the beginning of every test is possible but cumbersome.  And loading in a gigantic 3-dimensional string array at the start is so far the best solution I've found but I am not happy with it.  A 20x200x2 string array is just... unnecessary and I believe it may even be causing some performance issues and inconsistencies.

So I'm trying to get it into a better format but there are so many possibilities it's almost overwhelming.  TDMS, LVM, Storage VI's, .dat/csv.  

 

Even if someone could point me in the right direction I could take it from there but I don't even know where to start.  I also have access to LabVIEW Self-Paced Training modules for just about everything offered so that could be used as a resource if I knew where to look.  I need to just take the classes, if only I could find the time.

 

0 Kudos
Message 1 of 4
(3,050 Views)

Use the reporting tools built into LV.

 

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 4
(3,046 Views)

Honestly, I find those reporting tools to contain a lot of unnecessary additions and I ended up tearing them apart and rebuilding custom VIs that strip out all of the extras in order to improve performance and it's still eh.  I mean, it's good and it works.  But I know it can be done better.  I also think it doesn't provide the speed, efficiency, and scalability that I'm looking for.  

 

It SOUNDS like TDMS is really my answer but there are just so many ways to skin this cat, I KNOW this isn't the best way to stream it.

0 Kudos
Message 3 of 4
(3,040 Views)

It would help to understand your setup a bit more here. Obviously a cRIO running standalone can't read an Excel file, so what are you actually doing here? Is the cRIO running standalone, or is it just being used as network data acquisition and the application itself is running on the same computer as Excel? If the cRIO is standalone, how are you transferring the tests to it?

 

How long does each test take to execute?

 

You said that reading from Excel is "slow" - but it's not that slow. If you already have the Excel file open, I can't imagine it takes more than a second to read 2 cells, and I'd expect it takes much less. If the speed is really an issue, can you read the next test while the current one is still executing?

 

Are you saving the Excel data as a text document? Instead of loading an entire text file as a string (or string array), you could read line-by-line as you need it. That, too, would be fairly quick. Or, you could read line-by-line and parse each line as you read it into a more computation-friendly format.

0 Kudos
Message 4 of 4
(3,031 Views)