LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to store analog voltage from a non-LabVIEW supported hardware with variable data acquisition rate

Solved!
Go to solution

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.

0 Kudos
Message 1 of 22
(4,034 Views)
Solution
Accepted by topic author legendrerosh95

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 22
(4,003 Views)

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.

0 Kudos
Message 3 of 22
(3,993 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 22
(3,988 Views)

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!!!

0 Kudos
Message 5 of 22
(3,962 Views)

@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.

0 Kudos
Message 6 of 22
(3,951 Views)

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!!!!

0 Kudos
Message 7 of 22
(3,922 Views)

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…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 22
(3,919 Views)

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?

0 Kudos
Message 9 of 22
(3,916 Views)

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?

Download All
0 Kudos
Message 10 of 22
(3,916 Views)