Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Architecture of my application

Solved!
Go to solution
Highlighted

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
(222 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.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 2 of 5
(209 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
(200 Views)
Solution
Accepted by topic author Mahmoud63PPC
04-11-2019 08:07 AM

@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
0 Kudos
Message 4 of 5
(190 Views)

Thanks Smiley Happy

0 Kudos
Message 5 of 5
(176 Views)