08-09-2017 08:26 PM
Hello,
I have a non-NI data acquisition card in my PC, and the vendor provided some development kits, so I don't need to worry about communicating with LabView.
The scenario is that whenever an external trigger comes in, the data acquisition card will record a signal down (call it a "segment") from one channel. Right now I am modifying the vi provided by the vendor (permission asked to post, but cannot provide sub-VI). The original vi shows one "segment" of signal out of a preset number of "segments" at one time after acquiring all the data that a preset amount of triggers happen in a front panel graph, and I want to save them all.
That is if I want the vi stop logging after 100 triggers (I will have 100 "segments" of data), I can click the up and down arrows to change a value on the front panel control to show 1 to 100 segments one at each time. But right now I want to save every segment of data together (1 to 100), and I have no idea what to do as I can only now modify the vi into saving only one segment into a file at one time (use write to delimited spreadsheet.vi). What I also tried was whenever I click on the control on the front panel it saves a file (after saving segment 1, I click the control to 2 and a window will pop up to ask me to save again, so I will need to click 100 times). Or if I assign a file name and path, it will overwrite the 1st segment data. There will be a variable number of triggers later if I use the vi in the realm to acquire data.
Could anyone please give some help on how to save these segments? The vendor mentioned that the segments are all transferred to PC before they put into the graph, and I think there should be a way to pull out each segment. I was thinking of making a loop, or maybe a function automatically adds one each time, but I tried and didn't work either.
In the end, I want to make all the data into a spreadsheet that has 100 columns or rows, one represents a "segment" as mentioned above.
With different approaches I tried, I've converted the vi into a 13.0 or 14.0 version, but the write to delimited spread sheet sub vi might not work.
Thank you.
08-09-2017 11:24 PM - edited 08-09-2017 11:26 PM
Hi
Write to spreadsheet itself will work for you to append data after each segment is triggered. but try to Change the Architecture more scalable (Use State Machine preferably).
If your append to file is true then old data remains same and new data will get added with the existing data.