12-24-2020 03:00 AM
@Nadweb wrote:So each state has a build array and it's own shift register for the data? Do you build an array of all the arrays in the write state?
No, the state machine has a shift register. Each state can add data to the array.
I'd keep an array of doubles, because it is an array of doubles. I wouldn't put things in a waveform, flexible data container or whatever. It is an arrya of doubles, so put it in an array of doubles.
When time comes to put it in a graph, you can still simply use the array of doubles. Or convert to whatever you feel needed (, even though it's not).
It seems that often structures like a waveform are used because they are simple. They're not. They are an unnecessary abstraction.
@Nadweb wrote:
I was trying to incorporate a consumer loop for the writing. Can I enqueue the arrays in a state so they can be written in the consumer?
Yes. That would be perfectly OK.
If your data rate is low enough, it is again an unnecessary abstraction. Optimize when and where needed...
12-24-2020 11:12 AM - edited 12-24-2020 11:14 AM
@Nadweb wrote:
Hi RTSLVU,
1. The acquisition rate is variable depending on the usage, but anywhere from every second to every minute is probably the right range. And the data collection could go on for days at a time. So not very fast.
2. I think I did it to get a time stamp with the data? It was months ago that I wrote that code, and I took it from another VI, so I don't exactly remember what I was thinking. But I do need to plot the data with a time stamp. I've never done it with a For Loop
3. Fair enough. It's really the only way I know how to get my data into a spreadsheet at the moment. I haven't had lots of success with the lower level VI's for writing to a file.
4. I will change!
5. Maybe not, but this made the most sense to me.
Appreciate your thoughts here!!
12-24-2020 11:28 AM - edited 12-24-2020 11:34 AM
Also I can't test this because I don't have your VI but if you are still wanting to do that waveform conversion thing...
This should do exactly the same thing with a lot less code.