# Real-Time Measurement and Control

cancel
Showing results for
Search instead for
Did you mean:

Solved!
Go to solution

## Architecture of my application

Hello,

I am writing my very first labview application, and I don't really know how to create the architecture. I am using a compact rio, and several modules.

My app has to turn on a power supply (using a digital output) during a Ton period (0.5 seconds), then, it has to turn off the power supply during a Toff period (1.5 seconds), and the cycle has to repeat during a very long time (several days).

At the end of the Ton period (right after I turn off the power supply), I need to measure 4 voltage and write them in a csv file.
At the end of the Toff period (right after I turn on the power supply), I need to measure 4 temperature and write them in a csv file.

As I need precise time, I do not know if I should use one or several timed loops (my compactRio has only 2 cores, so I am limited to 2 timed loop) to perform my measurements. How many time loops do you think I should create?

Thank you

Message 1 of 5
(203 Views)

## Re: Architecture of my application

How precise do you actually need?  I am not really seeing a need for Timed Loops.  You can just use normal While loops.  Make 1 loop to act as a State Machine.  States I am seeing are "Turn On", "Turn Off", "Wait", "Read Voltages", and "Read Temperatures".  With that, I would use a Producer/Consumer setup to have a second loop that handles the writing of the values to the CSV.  This way, your waiting and reading of values are independent of the "slow" process of File I/O.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 2 of 5
(190 Views)

## Re: Architecture of my application

Thanks for your answer.

Concerning precision, I need to be precise about hundreds of microseconds, let's say up to 1 ms.

If I use while loops, how am I going to set my ON and OFF period?

Message 3 of 5
(181 Views)
Solution
Accepted by topic author Mahmoud63PPC
04-11-2019 08:07 AM

## Re: Architecture of my application

@Mahmoud63PPC wrote:

If I use while loops, how am I going to set my ON and OFF period?

With the Wait functions.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 4 of 5
(171 Views)

Thanks

Message 5 of 5
(157 Views)