LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elementary LV Question

Hello
Have developed a LV6 vi that has a For..next loop running only once. Within
the loop I have some LV coding. What I want to do is, execute what is in the
loop first and then execute a sub.vi that sends GPIB commands to an
instrument.

This is rather a relatively general question. How can I set-up the above
without using sequences(which is obviously easy), but use data flow or
something else.

The sub vi(GPIB) does not have any data inputs from the loop code, or should
I set-up some such input to it even it is not used for anything, just to
employ data flow to control execution.

Thanks for any tips
Khan
0 Kudos
Message 1 of 3
(2,649 Views)
You could connect the error line via a shiftregister in the loop to the gpib subvi. This enforces the dataflow to first execute the loop and then the gpib call.
Why use a shiftregister here?
Although the use of shiftregisters is not difficult it is not the first lesson in wiring. If you simply wire the error line through the loop you can run into trouble when the loop is executed zero times. With a shiftregister the value of the error is always correctly connected through the loop also when the loop does not execute.

succes
greetings from the Netherlands
Message 2 of 3
(2,649 Views)
"albert geven" wrote in message
news:50650000000500000066400000-999158726000@exchange.ni.com...
> You could connect the error line via a shiftregister in the loop to
> the gpib subvi. This enforces the dataflow to first execute the loop
> and then the gpib call.
> Why use a shiftregister here?
> Although the use of shiftregisters is not difficult it is not the
> first lesson in wiring. If you simply wire the error line through the
> loop you can run into trouble when the loop is executed zero times.
> With a shiftregister the value of the error is always correctly
> connected through the loop also when the loop does not execute.
>
> succes

Thanks, Albert. It is essentially what I thought of. But I was wondering if
there are other more general wa
ys, like if the sub vi to be executed next
does not involve a GPIB.
I had done what you suggest, but without using the shift register. However,
it's a good point of information that the SR is better just in case the loop
does not execute even once. I will do per your suggestion.

I've been developing code in textual programming languages for a long while,
and changing to the LV paradigm is sometimes conceptually clashing &
difficult.

Regards
Khan
0 Kudos
Message 3 of 3
(2,649 Views)