03-03-2006 10:28 AM
03-03-2006 10:53 AM
03-03-2006 10:55 AM
Hi Dave,
The Output indicate is read only once during the loop iteration. So whatever the value of the Rolling? control is at the beginning of the loop iteration, that's going to be the value sent to the Output indicator. There will be no further updating of that indicator throughout the course of the loop iteration, since that data has already gone through the wire between them. If you truly want the value of the Output indicator to always match the value of the Rolling? control, you should either have a separate loop that is constantly doing that updating, or you could simply update a local variable of the Output indicator every time you update the Rolling? value. Here are some other suggestions I have for you:
1. Instead of using feedback nodes and all that logic with the Select function, you could just use the iteration count of the While Loop to indicate which state of the Case structure should run.
2. Instead of using the Case Structure, you could have a single Flat Sequence Structure that just runs a case based on the iteration count of the While Loop.
3. Local variables are a lot better to use in terms of performance than the Value property of controls.
Hope these suggestions help,
-D
03-03-2006 11:10 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-04-2006 08:18 AM
Hi
Firstly thanks to everyone for their help.
03-04-2006 09:11 AM
Ok Dave,
The code you posted at the beginning tends to prove that you don't really
understand how LabVIEW works.
So, first you should run your code in "highlight execution” from the
diagram and see what happens. LabVIEW is based on dataflow.
The “Output” indicator will be read only once by execution of the big for loop, so it is normal that on front panel you don’t have the same value “rolling ?”.
If you link a boolean indicator to the local variable in the centre of the VI I posted, you yill see that this indicator is updated at each execution of the inside loop.We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-04-2006 11:32 AM
One of the problems in the above solutions is the fact that
A better solution is using an event structure, manipulating the timeout and also loop once per value change, eliminating the sequences. Now the stop button works always immediately, independenly of the current program stage, even if you would use minutes as waits. Notice also that we don't need any property nodes or locals.
See if the attached solution make sense to you. (LabVIEW 7.1) 🙂
03-06-2006 05:11 AM
Hi
Thanks for the assistance so far.
The example code submitted so far does not quite achieve what I am looking for. Currently, all the VI's submitted so far switch the output for fixed periods on and off. From my previous message (extract below) you will see that both the on and off times are different at each of the five iterations.
03-06-2006 06:44 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-06-2006 08:25 AM