LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Design Patterns, best approach for this app

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 9215ANI PXI 4472all 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 & LogMonitors 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.

0 Kudos
Message 1 of 4
(3,454 Views)

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/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/structures/timed-loop.html

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 2 of 4
(3,391 Views)

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.

0 Kudos
Message 3 of 4
(3,380 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 4
(3,363 Views)