02-26-2019 08:09 PM - edited 02-26-2019 08:11 PM
Am a beginner to LabVIEW. I have a Chinese USB DAQ to store the LVDT displacement. Am running the experiment quite long nearly 100-150 hours, wherein the data needs to stored as CSV or Excel format, at a specific rate initially. Towards the end stages, I would need to increase the data storage rate as the information is vital.
The DAQ company have given me the option to read the data in the LabVIEW and it is up to me to design the data collection and storage. Any tips are greatly appreciated.
Solved! Go to Solution.
02-27-2019 01:04 AM
Hi rerosh,
at a specific rate initially. Towards the end stages, I would need to increase the data storage rate
Use a state machine with several states.
One state may initialize the sample rate, another one may do the reading of your DAQ data.
Or have one state read data at low rate and the other at higher rate.
In general: state machines are great when you already define some "states" in your requirement description…
02-27-2019 07:13 AM
Thanks for the reply. Did not know much about state machine, but could learn from youtube.
What function to call to read data from non-LabVIEW supported hardware. The vendor given code does not work if you make any modifications to it. So I have to revamp the entire structure and start coding it from scratch.
02-27-2019 07:37 AM
Hi rerosh,
Did not know much about state machine, but could learn from youtube.
LabVIEW comes with example projects explaining state machines, no need for Youtube…
What function to call to read data from non-LabVIEW supported hardware.
Depends on the device interface and API…
The vendor given code does not work if you make any modifications to it. So I have to revamp the entire structure and start coding it from scratch.
Use a better vendor (like NI) with better APIs…
02-27-2019 08:12 PM
Cannot change the vendor for the time-being as the hardware is already bought and has to make it work. The problem was the budget, as the local brands are quite cheap compared to the NI ones and needed a faster acquisition rate.
Am attaching the VI file for the same. If you have time, have a look and suggest some tips.
Thanks in advance!!!
02-27-2019 11:37 PM
@legendrerosh95 wrote:
The problem was the budget, as the local brands are quite cheap
That "cheapness" is very short-sighted. The money saved on the hardware will be eclipsed by the extra software development time.
Your sampling rate is determined approximately by the loop delay - altering that will of course change your sampling rate, but I assume you do not want to have to do it manually? Do you have an idea of how you would like to change the sampling rate, for example, after 1 hour, increase the sampling rate from ~10Hz to ~20Hz?
Also, what signal are you recording?
You will need to record the relative time when each sample was recorded. It will only be approximate of course. You can resample the data later if required.
03-01-2019 01:28 AM
Hi, as you have seen, the code enables to display the instantaneous values obtained from the DAQ system on the numeric indicator. Just realised that it is not easy to store the analog input voltage values of each and every iteration onto the lvm file.
The relative time you have mentioned is another issue to be solved.
Any suggestions on these two, especially on the second one, to get an exact timing for the data value stored.
Thanks in advance!!!!
03-01-2019 01:34 AM
Hi rerosh,
could you please downconvert your VI to LV2017 or earlier?
Just realised that it is not easy to store the analog input voltage values of each and every iteration onto the lvm file.
What's the problem here? It's quite easy…
The relative time you have mentioned is another issue to be solved.
As soon as you you can use hardware-timed sampling it will be no issue anymore.
(But I guess your cheap hardware is so cheap it doesn't support that feature. That would be a classic failure of buying cheap hardware without comparing to requirements…)
03-01-2019 01:57 AM
Hi, do not know how to do the downconvert exactly. This is an updated file. I have tried to use shift register in the for the loop. Would this solve the issue?
Could you suggest how to store the actual time values in the lvm file, than the relative ones?
03-01-2019 01:58 AM
Hi, do not know how to do the downconvert exactly. This is an updated file. I have tried to use shift register in the for the loop. Would this solve the issue?
Could you suggest how to store the actual time values in the lvm file, than the relative ones?