10-10-2020 05:39 AM
I created this VI where it is required to manually set the set point. I would like to make this automatic and increase the set point by 10 degrees celsius each time.
The temperature will have to vary between 0 and 100 degrees.
How can I do it?
10-10-2020 09:47 AM
Have you taken the LabVIEW Tutorials? Do you understand the concept of a "loop", doing something (say) 11 times? If you have an index for a Loop that runs for 11 times and takes on the values 0, 1, ... 10, can you think of a way to transform this index into a "set point" that takes on the values 0, 10, ... 100?
Bob Schor
10-10-2020 03:17 PM
All you probably need is a simple state machine. (A top level FOR loop is very unusual.)
@giu95se wrote:
... automatic and increase the set point by 10 degrees celsius each time.
What does "each time" mean?
Overall, your current code is very dangerous. For example if there is an error, the inner while loop can never complete and the program cannot be stopped gracefully. This does not sound reasonable.
10-12-2020 02:44 AM
yes I'm still trying hard to figure out how to set it all up.
Basically what I want my script to do is: set the calibrator to a certain temperature and once this temperature is reached, carry out a resistance measurement using the multimeter.
I would like to make the set point setting automatic and start the new cycle of measurements every time the calibrator reaches the set point considered and the multimeter makes the resistance measurement.
10-12-2020 06:37 PM
So you have two states:
In state 1 you equilibrate temperature and in state 2 you take a measurement and go to the next setpoint. Wash, rinse, repeat until you run out of setpoints.
Here's a very simple example that might give you some ideas.
(I took some shortcuts, so make sure to not take two measurements if two successive reading are in range. Hint: wait until one reading is out of range before waiting for the next measurement)
10-13-2020 04:53 AM
the problem is that what I want is to set the setpoint as a command to my calibrator. This setpoint on my calibrator must be reset every time the measurements are finished.
10-13-2020 05:22 AM
@giu95se wrote:
the problem is that what I want is to set the setpoint as a command to my calibrator. This setpoint on my calibrator must be reset every time the measurements are finished.
OK, so that's a new problem. Please describe what you mean by "reset". Your description is very ambiguous. Reset to what? Should be trivial to modify, right?
10-13-2020 05:32 AM
in practice I want to set the calibrator at different temperatures 0,10,20,30,40,50 .... up to 100 C.
Then, I set the first setpoint of 20 degrees and wait until the calibrator reaches this temperature verifying that the last 5 samples are the same (by means of the counter).
Once the 20 degree setpoint has been reached, I take the resistance measurement with the multimeter. Once all these operations have been completed, I want it to restart automatically by setting the new setpoint (for example s = 30) and all calculations to be done again.
10-13-2020 07:57 AM
The term "5 samples are the same" is vague without specifying a certain allowed range. We should never do equal comparisons with DBL.
Still, just whenever a new setpoint is reached, start counting. Do you have problems with implementing that?
As I said, the secret is a "state machine". Now you have four states:
10-13-2020 10:14 AM
what blocks should I use to make the machine read one value at a time when entering?