08-24-2022 12:46 PM
Hey there!
So I solved a problem that i had considering the sampling rate, by splitting one big loop into three seperate ones and it worked out
I was just about to test my sensor and then i realized, that the data of 2 loops dont get saved in the spreadsheet.... One problem solved the other one comes...
The only solution that i have in mind, is that every loop creates its own file.. so i have then basically 3 files for 3 loops... but isn´t there a smarter way?
Every kind of help is appreciated guys!😊
08-24-2022 01:21 PM
Hi Jugo,
Idea would be to first make sure all the required data is transferred from your data acquisition loops to a 4th loop. which will periodically write data to a file.
If you want all data points collected, you can use Channels or queues to transfer required data. You can be smart about how many data points you want to read every iteration and write to a file. You can also store data in shift registers in the 4th loop and write data with further delay.
If you like to save data which can be lossy, then you can look into using FGVs or local variables (I would not prefer doing this)
Finally you can also look into creating subVIs to contain everything in a standard screen resolution. This will also help you clean up
your block diagram a bit and will help you be organized.
08-24-2022 01:51 PM
08-24-2022 02:03 PM
08-24-2022 02:35 PM - edited 08-24-2022 02:45 PM
If you want to save data from different loops to one file, we hopefully can assume that all loops run at the same rate. This also means that you could merge the code from all three loops into one loop instead. If the loops are not supposed to run at the same rate, you need to exactly define how the data is supposed to be merged into the file.
Currently, all your loops have very poorly define timing. You are still growing a string forever. A tab control with one tab does not need to be connected anywhere.
We already gave you advice how to simplify some of your code, e.g. lower the amount of dynamic data. (... and no, having three different stop buttons is probably not the right way to do anything.)
09-01-2022 11:33 AM
@altenbach wrote:
If you want to save data from different loops to one file, we hopefully can assume that all loops run at the same rate.
No unfortunately they do not. I just checked and my sensor runs at roughly 165Hz but from my 2 NI Measurement cards (with these i measure my voltage/current) i get a rate of 4Hz. Which is weird. Maybe it is best just trying to make 3 different files...
09-01-2022 12:11 PM - edited 09-01-2022 12:15 PM
@Jugo wrote:
@altenbach wrote:
If you want to save data from different loops to one file, we hopefully can assume that all loops run at the same rate.
No unfortunately they do not. I just checked and my sensor runs at roughly 165Hz but from my 2 NI Measurement cards (with these i measure my voltage/current) i get a rate of 4Hz. Which is weird. Maybe it is best just trying to make 3 different files...
So, what is keeping you from using TDMS format? Just write the data of each loop to the channel each loop records at whatever speed the loop spins at. Jaw drop emoji!
Hey 2 of those acquisition loops are even DAQmx!!!! You can simply enable DAQmx data logging and let DAQmx write those channels for you with NO ADDITIONAL CODE needed.
09-01-2022 12:16 PM
@JÞB wrote:
So, what is keeping you from using TDMS format? Just write the data of each loop to the channel each loop records at whatever speed the loop spins at. Jaw drop emoji!
Yeah I use TDMS for separate sample rates. Each Group in a TDMS file is its own sample rate. If you are seeing some kind parallel access issue, you can even write to separate files, then perform a binary merge at the end to get a single file again.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-01-2022 01:34 PM
@JÞB wrote:Hey 2 of those acquisition loops are even DAQmx!!!! You can simply enable DAQmx data logging and let DAQmx write those channels for you with NO ADDITIONAL CODE needed.
Note that if you use the DAQmx Logging, which I highly recommend, the two tasks will have to log to two different files. You can combine them afterwards.
09-01-2022 01:42 PM
@crossrulz wrote:
@JÞB wrote:Hey 2 of those acquisition loops are even DAQmx!!!! You can simply enable DAQmx data logging and let DAQmx write those channels for you with NO ADDITIONAL CODE needed.
Note that if you use the DAQmx Logging, which I highly recommend, the two tasks will have to log to two different files. You can combine them afterwards.
I'll have to try that but concurrent access should not be a problem.