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?
Solved! Go to Solution.
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.
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?