10-01-2007 05:15 AM
10-01-2007 06:12 AM
10-01-2007 06:15 AM - edited 10-01-2007 06:15 AM



Message Edited by Stradis on 10-01-2007 07:17 AM
10-01-2007 06:18 AM
Hai!
I also came across such kind of problems earlier, see i prefer that have two timed while loop one will work independently and acquire your signal, in the second loop do your execution loop soon that your event structure will execute your sequence. try this it will work definitely.
10-01-2007 07:03 AM
10-01-2007 07:09 AM - edited 10-01-2007 07:09 AM
Message Edited by Claus_DK on 10-01-2007 07:11 AM
10-01-2007 07:12 AM - edited 10-01-2007 07:12 AM

Message Edited by Stradis on 10-01-2007 08:15 AM
10-01-2007 08:11 AM
@Claus_DK wrote:
Claus,
You already received quite a bit of good advice, but there are quite a few misconceptions about dataflow that you seem to have and now is a good time to clear them up. Often it is most illustrative to run your VI in "execution highlighting mode" to see what is happening under the hood. Try it!
Here are a few points:
10-01-2007 08:46 AM
10-02-2007 10:58 AM
Claus_DK wrote:
2. In this while loop I omitted the analog output. I need a certain output voltage level until the Position sensor reaches a certain level (in this case I chose 4 randomly). After this I have other steps: The output voltage shold remain 0 volts for a certain period of time, then the output voltage has to be the same as before the holding time but with opposite polarity until another position is reached and finally the voltage is set to 0 and the dialog box is showed.
3. Since I need a sequence of things to happen as described above, I don't see how I can avoid a sequence inside a while loop.You don't need all this. No inner while loop, no sequence structure and no event structure. You can design the entire thing as a state machine using the outer while loop. Since you are spinning the loop anyway, you don't need an events structure at all, just poll the button and change states if indicated.
4. In this case I find it OK since it indicates the completion of a process and since nothing is going to happen afterwards.
Life always goes on, something will always happen afterwards, even it is just stopping the program or entering a wait state. (or going to dinner 😄 ).
5. The position sensor is detecting the position of a piston controlled by a motor. I need to position this piston very accurately so I need to read the position often. The voltage output that I mentioned above is controlling this motor. I don't know yet, but maybe I will even have to decrease the voltage to the motor as the piston approaches its intended position to approach this position slowly and thereby accurately enough.
You can use a 1ms delay. If your timing requirements need to be more precise, you need to use LabVIEW RT and the code does not belong on a plain OS.
6. It runs the sequence described in point 2.
7. The start button is starting the sequence described in point 2. When the sequence isn't running, manual positioning of the motor (i.e. manual control of the output voltage has to be enabled). For this reason I planned to let the position sensor run continously.See above.
8. The subVIs are from Measurement Computing and are controlling the USB based analog inputs and outputs. Actually the input is not on the right side. I manually put the connection od the right side, because of the limited space on the left side. But I promise to do a "Clean up wire" immediately in order to follow standard procedures 🙂
9. I am not familiar with the corecion dots or how the are helpful. Or did you by any chance mean correction dots (not that I know anything about those either)? I will have to look into that.A coercion dot (red) shows whenever the input to a function or subVI does not match the data representation that the function expects. (trher are no correction dots in LabVIEW).