05-19-2022 01:37 PM - edited 05-19-2022 01:40 PM
Hello everyone,
I'm currently developing a program which is in charge of acquiring data from two types of sensors with very different maximum sample rates.
One of them is limited to just 70 S/s, while the other can go up to 10k S/s.
For the purpose of the system requirements, sampling at 1k S/s is ok, so that's what i am aiming for.
For this I have set the DAQmx read function to acquire 7 samples in one case, and 100 in the other, and the while loop repeats every 100ms.
I want to be able to display and store said data at 1k S/s, my plan is to do a resampling of the waveform with the lowest sample rate with coercive interpolation. After that, i should align both waveforms so they are synchronized and append one to the other on an array of waveforms.
I leave attached screenshots of the setup i have for acquiring data, as well as the last data log i obtained with this.
Any comment, or suggestion is more than welcome.
Thanks in advance!
05-19-2022 02:04 PM
Hi Hansen,
in general we don't like images of code as they are impossible to debug/edit/run in LabVIEW…
Why don't you attach an example VI with some example data embedded in controls? (Set their default value before saving the VI…)
05-19-2022 02:30 PM
Ok, sorry for that.
This is an example of the Real Time target's part of the code. (With changes made to exclude the shared variables)
Best regards.
05-19-2022 02:41 PM
Hi Hansen,
in general not all of us already upgraded to the latest version of LabVIEW (like your LV2021 VI).
You would get a much broader audience when providing a downconverted version of your VI, like LV2019. (Edit->Save for previous…)
I cannot open your VI due to its LabVIEW version…
05-20-2022 06:39 AM - edited 05-20-2022 06:39 AM
Hi GerdW,
Here's the program for LV2019.
Thanks for the quick reply.
Cheers!
05-23-2022 01:21 PM
Hello everyone,
I am posting this problem again but now with an example version of the program for LV2019 as suggested by another user.
I'm currently developing a program which is in charge of acquiring data from two types of sensors with very different maximum sample rates.
One of them is limited to just 70 S/s, while the other can go up to 10k S/s.
For the purpose of the system requirements, sampling at 1k S/s is ok, so that's what i am aiming for.
For this I have set the DAQmx read function to acquire 7 samples in one case, and 100 in the other, and the while loop repeats every 100ms.
The program consists on two main Vi's, one which runs on a cRIO-9057 and is charge of acquiring the data. The other Vi, running on host, is in charge of displaying and storing said data.
With the Vi running on the cRIO, my plan is to do a resampling of the waveform with the lowest sample rate with coercive interpolation. After that, i should align both waveforms so they are synchronized and insert one to the other on an array of waveforms.
I leave attached a screenshot of the setup i have for acquiring data and one of the indicators. Also the data log i obtained with this as well as an example version of the real-time part of the program.
Any comment, or suggestion is more than welcome.
Thanks again!
05-23-2022 01:43 PM
Hi Hansen,
no need to start a new thread for the very same problem!
You forgot to set some default data in your waveform array indicators. That would help greatly to bugfix your VI…
On your VI:
Why do you convert the DAQmx task references to strings?
Why don't you use a shift register to hold the DAQmx references?
Why do you use "value" propertynodes in your statemachine?
05-23-2022 02:09 PM
By default data do you mean two made up array of waveforms as to simulate the ones acquired by DAQmxRead?
More than for debugging i made the example program thinking to show the setup and how I was using ResampleWaveforms.Vi and AlignWaveforms.vi. For example, i am using the (single-shot) version of those as the continuous version seemed to throw errors. But i couldn't find anywhere why (if I) should I do so.
Again, thanks for the fast replies!