Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Architecture of my application

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(2,157 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(2,144 Views)

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?

 

0 Kudos
Message 3 of 5
(2,135 Views)
Solution
Accepted by Mahmoud63PPC

@Mahmoud63PPC wrote:

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


With the Wait functions.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(2,125 Views)

Thanks 🙂

0 Kudos
Message 5 of 5
(2,111 Views)