04-10-2019 07:38 AM
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
Solved! Go to Solution.
04-10-2019
08:00 AM
- last edited on
01-09-2025
03:05 PM
by
Content Cleaner
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.
04-10-2019 08:27 AM
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?
04-10-2019 10:16 AM
@Mahmoud63PPC wrote:
If I use while loops, how am I going to set my ON and OFF period?
With the Wait functions.
04-11-2019 10:07 AM
Thanks 🙂