08-05-2013 08:29 AM
New to LV and this forum, so please bear with me...
I'm attempting to acquire data from 15 channels and display the data real time on the front panel with both a numeric indicator and waveform graph. After DAQ is complete, I want to write all the data to a CSV file.
I can't seem to get the acquired data to index properly, so as the program runs, it constantly overwrites the first row of data. Any help with this issue would be greatly appreciated. My VI is attached.
08-05-2013 08:34 AM - edited 08-05-2013 08:37 AM
Hi Asst,
you should read the context (and extended) help for WriteCharsToFile. Then wire all needed inputs...
Btw.
- Why do you convert waveforms into DDT by using SplitSignal? Why not use IndexArray instead?
- Why do you multiply by one and add a zero to each signal?
- Why do you need 15 graphs for 15 signals? Can't you group the signals like plotting all loads on one graph and all extensions one a 2nd one? Or group corresponding extension/load/displacement plots? Or plot load vs. displacement? Or...
08-05-2013 08:49 AM - edited 08-05-2013 08:49 AM
As a first step, you should simplify! Why don't you use a singe 2D array in the shift register? You can do the same with 10% of the current code.
Why are you initializing a large array, only to append new data to it. Don't you want to replace with new data, keeping the array size constant for the duration of the program?
You can form your header using an array of strings and "array to spreadsheet file" with comma as delimiter.
08-05-2013 09:05 AM
Thanks for the quick response, GerdW.
I think it's pretty obvious that I'm very new to LV programming. I'll attempt to answer your questions...
1. I used split signal because it's what I saw others using in their VI's. I'll try using IndexArray as long as it will still allow me to display the data from the individual channels to a numeric display.
2. The multiplication and addition to each channel is what I set up to calibrate the channels to display load or extension rather than voltage. I don't know what these values will be, so I just set them up to do nothing for now.
3. I would like to combine all the loads and extensions onto only two graphs, but I couldn't figure out how to do it. All the examples I found were for a single channel plotting to a graph so I got lost when trying to expand that to multiple channels.
08-05-2013 09:07 AM
08-05-2013 09:53 AM
Thanks for the comments, altenbach.
Should I be initializing an array of specific size, or should I just append to an n-dimensional array? I thought i read that it was better to initialize the array size ahead of time.
Am I using the build array function correctly? Should I remove the Split Signals function in liew of Index Array?
As I said... I have next to no experience in LV programming, so the more detailed you can be in your responses will help greatly.
Thanks.
08-05-2013 10:30 AM
@AsstToRegionalMgr wrote:
Should I be initializing an array of specific size, or should I just append to an n-dimensional array? I thought i read that it was better to initialize the array size ahead of time.
Am I using the build array function correctly? Should I remove the Split Signals function in liew of Index Array?
What you are doing is initialize large arrays, but then appending to the end of it (1) ignoring the initialized elements for the duration of the program and (2) appending to the end of the initialized arrays, thus growing them. This immediately cancels all advatages of working on fixed sized array, because they no longer are.
After initializing the array, you need to use "replace array subset" to fill the array with new data. You need to keep track of the insert point.
SOrry, I don't have DAQ, so I cannot look at you configurations, but it seems you are only reading a single point from each channel.Is this correct? You probably could configure it to read "single point, N channels" with an array output and get a 1D array to replace a row iin the initialized 2D array.