LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous DAQ capture and Dynamic Update

I have a problem and I just can't seem to work out the basic structure for my solution I was hoping that somone could help me.

Problem:

Require to to DAQ Capture from a device (any generic DAQmx device will do). Start DAQ Capture with Predefined default settings for that card. Run the task and display the results in a chart/graph on the screen.

User Requires to change the settings, So "Pause task" (Stop, reconfigure & restart) with new settings in a different plot (different colour, Old plot = NAN)makes things look nice.

When settings are correct, User saves settings to a configuration file. (maybe via an FGV).

 

I just can't work out what sort of structure I need. I'm sure I need Event driven. I'm not sure if I need Queues or Producer/Consumer, or how to trap errors with this. My trial Code breaks with wierd results very fast if you run it under debug mode.

 

Arg - can't attach Type Def Cluster. Aquire Data is top Level VI. Haven't tried implementing plot colours yet.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 1 of 4
(2,675 Views)

James,

 

The way you describe your problem seems to me to be how to break it down and develop the program.

 

Starting with the data acquisition: 

If you are processing your data as you acquire it, then I would recommend the producer/consumer pattern. 

If you are simply displaying the data, then a simple while loop around the DAQ device read and the chart/graph would do.

In either case you would have your create task and start task, then in a loop would be the read task, then the stop task outside the loop.

 

To 'pause' the data acquisition and start again with new card settings:

Implement a method to start and stop the data aquisiton using front panel controls, while keeping the VI running once the DAQ has stopped.

Off hand, perhaps something like a Start Aquisition button, wired to a case structure where if true the acquisiton will execute until a Stop Aquisition button has been pressed.

Once the aquisiton has been stopped, the user can then make changes to any settings via front panel controls.  Then when they start aquisiton again, the new settings can be applied.

 

Save settings:

You could implement this using an event structure, so if the user presses a Save Settings button you can write a file containing all the settigns

Alternatively, you could save the settigns when you decide to close the VI

 

 

Hope this helps to get you started

Sheela Sujeeun

Applications Engineer
National Instruments UK
Message 2 of 4
(2,640 Views)

Very Useful.  I hope to start coding the main VIs soon as I have been working on the underlying functionality and this guidance should help me structure me VI in a good and effieicent way.

Thanks for the guidance Sheela.

 

Cheers

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 4
(2,607 Views)

James,

 

No problem, glad to be of help.

 

Good luck with the application 🙂

Sheela Sujeeun

Applications Engineer
National Instruments UK
Message 4 of 4
(2,605 Views)