09-16-2008 04:29 AM
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.
09-22-2008 04:55 AM
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
09-26-2008 03:12 AM
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
09-26-2008 03:16 AM
James,
No problem, glad to be of help.
Good luck with the application 🙂