03-22-2020 11:31 PM
Hello,
I have a cDAQ-9171 that I am trying to retrieve sensor data from. I need to continuously retrieve data from the cDAQ-9171 so that I can store / use the data within various applications.
I have viewed the raw sensor data inside LabView. However I don't believe LabView will be able to provide the solution I am looking for - as I need to continuously retrieve the data, whereas LabView seems to be structured "tell me how long to record data, then I will output that much data to a file".
Ideally I need a solution that works something like this:
Python Program (Python is only an example, any programming language will be fine):
----
<import any library I need>
while true:
var data = <function call to retrieve data from cDAQ-9171>
<do something with the data>
----
So the program works in an infinite loop retrieving data from the cDAQ-9171.
My key questions - is doing something like this possible (continuously retrieving data so that it can be used inside a program)?
I need to store the data inside a database so that I can retrieve live sensor data from another program.
Any help would be greatly appreciated.
Thanks
03-23-2020 12:44 AM
That's an extraordinarily common thing to do in LabVIEW. in the shipping examples (Help->Find Examples->Hardware->DAQmx) for continuous voltage input. (If you want to use it as a starting point, make sure you "Save As..." with a different name to a new location of your own.)
-Kevin P
04-01-2020 08:53 AM
Definitely! Check out the "Voltage-Continuous Input.vi", an examplet that ships with LabVIEW.
From LabVIEW click on Help/Find Examples/Hardware Input and Output/DAQmx/Analog Input/Voltage - Continuous Input.vi
That'll get you going! 😉