08-27-2021 10:31 AM
Hey Guys,
for an Universityproject i have to store a sensoroutput in a variable to use it afterwards in my Labviewprogram.
The data is a voltage from a DAQ-Device. Once the Sensordata is above a certain threshhold e.g. 5 Volts the actual voltage, e.g. 5.05V should be stored after a certain time (3000ms) in a variable. I wrote a VI for that but i think its not the best way to solve this problem. My Solution is attached. Do you have any ideas how i can make this more practically and fancier? Maybe even without putting and indicator on the front panel? Thaks for your help!
Solved! Go to Solution.
08-27-2021 10:55 AM
Start with the training resources listed at the top of the forum. Seems you are a text programmer and you seem to program LabVIEW like text based code (local variables as variables, etc.)
All you need is a simple state machine. You don't need any local variables! Don't use long waits, just keep track of time!
Please also explain what you mean by "store". What should be displayed before the condition occurs?
08-27-2021 11:11 AM
When i start the program the "stored" value should always be 0, since i know that the voltage is going up from 0. once the value passed the threshhold from 5V the actual sensoroutput (which should be very close over 5V) should be stored. For example 5.1 V. Then my programm should add +1 to the stored Value. In the example case it would be 6.1V. Then the program should run until the sensordata reaches this new value (6.1V in this example) and then turn itself off. Since the stored that isnt always 5.1 i cant use a constant.
I hope this explains my goals a little bit more.
08-27-2021 11:30 AM
@overhandshuffle wrote:
I hope this explains my goals a little bit more.
Did the requirements change? You are no longer mentioning the 3s. By "turn itself off", do you mean "stop the loop"? In a state machine you never stop the loop, just go back to an idle state until you want to close the program.
08-27-2021 11:53 AM
Here's a very simple draft that randomly increments a reading, stores the first value that exceeds a threshold as setpoint and increments the setpoint to define a new threshold, and repeats forever. Maybe it can give you some ideas.
08-30-2021 03:19 AM
Sorry for tooking so long to answer, but since im a new member i am not allowed to post often yet.
The VI u sent me answered all my open questions. Thank you very much!