09-27-2009 12:02 AM
Hi all,
i am starting with design patterns, and i would like to hear your opinion on what would be the best approach for this app.
this is basically an app for data monitoring, analysis and logging (voltage, temperature & vibration)
i am using 3 devices for N channels (NI 9211A, NI 9215A, NI PXI 4472) all running at different rates. asynchronous.
and signals are being processed and monitored for logging at a rate specified by the user and in realtime also.
individual devices can be initialized or stopped at any time
basically i'm using 5 loops.
*1.- GUI: Stop App, Reload Plot Names (Event handling)
*2.- Chart & Log: Monitors Data and Start/Stop log data at a specified time in the GUI (State Machine)
*3.- Temperature DAQ monitoring @ 3 S/s (State Machine) NI 9211A
*4.- Voltage DAQ monitoring and scaling @ 1K kS/s (State Machine) NI 9215A
*5.- Vibration DAQ monitoring and Analysis @ 25.6 kS/s (State Machine) NI PXI 4472
i have attached the files for review, thanks in advance for taking the time.
09-28-2009
12:56 PM
- last edited on
07-10-2024
04:41 PM
by
Content Cleaner
Instead of doing acquisition and analysis in the same loop, you can use the Producer Consumer architecture to complete it simultaneously. Also, you can use Timed While Loops to prioritize different tasks within your VI. More resources on these topics are below:
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/structures/timed-loop.html
09-28-2009 01:34 PM
thanks Will for your response,
so, basically i could apply a producer/consummer architecture for just the Vibration analysis loop? or all data being collected by the Monitor/Logger loop?
is it ok having individual loops for every DAQ device as is shown?
thanks.
09-28-2009 06:09 PM
mundo wrote:thanks Will for your response,
so, basically i could apply a producer/consummer architecture for just the Vibration analysis loop? or all data being collected by the Monitor/Logger loop?
is it ok having individual loops for every DAQ device as is shown?
thanks.
You could use the producer/consumer architecture to split the areas where you are doing both the data collection and teh analysis in the same state machine. If one of these processes is not time critical or the data rate is slow enough you could leave it in a single state machine. I admit that I didn't look through your code but based purely on the descriptions above I would imagine that you could change the three collection state machines to use a producer/consumer architecture. I would leave your UI processing in its own loop as well as the logging process. If this logging is time critical you may want to split that as well.