LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence structure "reuse"?

I have an application that requires me to make measurements in a
particular order at specific times and to update a set of indicators
as the measurement progresses. I use a sequence structure in which
different frames write to local variables keyed off the indicators. I
now need to replicate this sequence in a couple of other places.

Unfortunately, copy/paste of the sequence results in new front panel indicators and
variables being created. While I could change each one manually, with
25 frames and multiple locals, the time required is huge and the
possibility of errors is high as the number of copy/pastes increases.

Creating a subVI has been problematic as the indicators must update as
I progress through the sequence.
The subVI terminals update only on
conclusion, as far as I have been able to find. Globals are an
option, but, I am wary of using them.

I believe the creation of new variables on paste is how LV is
structured (ie. this is not a bug but the way things are). I need a
workaround, though, and would appreciate suggestions.

--- Ravi


---
Ravi Narasimhan
Dept. of Physics and Astronomy, UCLA
http://www.physics.ucla.edu/~oski
0 Kudos
Message 1 of 6
(3,248 Views)
"L. Ravi Narasimhan" wrote:

> I have an application that requires me to make measurements in a
> particular order at specific times and to update a set of indicators
> as the measurement progresses. I use a sequence structure in which
> different frames write to local variables keyed off the indicators. I
> now need to replicate this sequence in a couple of other places.
>
>
>
> I believe the creation of new variables on paste is how LV is
> structured (ie. this is not a bug but the way things are). I need a
> workaround, though, and would appreciate suggestions.

Yes copy /paste makes new variables.
I dont guess you have version 6. Using the control refnum in 6i
will do what you want. The only way I can think of to solve this
SIMPLY is to move the locals OUT
of the sequence. If you
do this then the copy / paste DOES NOT create new variables.

I would suggest that you try to rewrite this WITHOUT the sequnces.
They have their uses, but can become a crutch and a trap (as you have found).

Kevin Kent
0 Kudos
Message 2 of 6
(3,248 Views)
On Thu, 7 Dec 2000, Kevin B. Kent wrote:

> "L. Ravi Narasimhan" wrote:

[ Copying sequences in LV5.1.1 ]

> Yes copy /paste makes new variables.
> I dont guess you have version 6. Using the control refnum in 6i
> will do what you want. The only way I can think of to solve this
> SIMPLY is to move the locals OUT of the sequence. If you
> do this then the copy / paste DOES NOT create new variables.

> I would suggest that you try to rewrite this WITHOUT the sequnces.
> They have their uses, but can become a crutch and a trap (as you have found).

Kevin,

Right on the version. I am using LV 5.1.1. I bit the bullet, and
made the sequence into a separate VI although still with sequences in
it. This gives me the functionality I need although not in
the strictly "one-panel"
form I was trying to get beforehand.

I had tried to avoid locals but I could not seem to get around them. I
have five indicators that are updated in various subsets at different
times requiring a real-time update <-> sequence structure. Since it is not possible to have
multiple wires going to an indicator, I settled on locals. I was also
not able to get the VI structured in the form of a state machine (Case
inside a While loop method)...

Thanks for your advice.

--- Ravi



---
Ravi Narasimhan
Dept. of Physics and Astronomy, UCLA
http://www.physics.ucla.edu/~oski
0 Kudos
Message 3 of 6
(3,248 Views)
When you select and drag holding the Ctrl key, the code and locals are
cloned without creating new controls.

Jean-Pierre Drolet



"L. Ravi Narasimhan" a écrit dans le message
news: Pine.GSO.4.21.0012072241140.16501-100000@gauss...
> On Thu, 7 Dec 2000, Kevin B. Kent wrote:
>
> > "L. Ravi Narasimhan" wrote:
>
> [ Copying sequences in LV5.1.1 ]
>
> > Yes copy /paste makes new variables.
> > I dont guess you have version 6. Using the control refnum in 6i
> > will do what you want. The only way I can think of to solve this
> > SIMPLY is to move the locals OUT of the sequence. If you
> > do this then the copy / paste DOES NOT create new variables.
>
> > I would suggest that you try to rewrite this WITHOUT the seq
unces.
> > They have their uses, but can become a crutch and a trap (as you have
found).
>
> Kevin,
>
> Right on the version. I am using LV 5.1.1. I bit the bullet, and
> made the sequence into a separate VI although still with sequences in
> it. This gives me the functionality I need although not in the strictly
"one-panel"
> form I was trying to get beforehand.
>
> I had tried to avoid locals but I could not seem to get around them. I
> have five indicators that are updated in various subsets at different
> times requiring a real-time update <-> sequence structure. Since it is
not possible to have
> multiple wires going to an indicator, I settled on locals. I was also
> not able to get the VI structured in the form of a state machine (Case
> inside a While loop method)...
>
> Thanks for your advice.
>
> --- Ravi
>
>
>
> ---
> Ravi Narasimhan
> Dept. of Physics and Astronomy, UCLA
> http://www.physics.ucla.edu/~oski
>
0 Kudos
Message 4 of 6
(3,248 Views)
If you are using Labview 6, you can pass control references to subvi's and
the controls in the parent vi can be updated from the subvi using a property
node while the subvi is still running. This is a new feature in Labview 6.

"L. Ravi Narasimhan" wrote:
>I have an application that requires me to make measurements in a>particular
order at specific times and to update a set of indicators>as the measurement
progresses. I use a sequence structure in which>different frames write to
local variables keyed off the indicators. I>now need to replicate this sequence
in a couple of other places.>>Unfortunately, copy/paste of the sequence results
in new front panel indicators and>variables being created. While I could
change each one manually, with
>25 frames and multiple locals, the time required
is huge and the>possibility of errors is high as the number of copy/pastes
increases.>>Creating a subVI has been problematic as the indicators must
update as>I progress through the sequence. The subVI terminals update only
on>conclusion, as far as I have been able to find. Globals are an>option,
but, I am wary of using them.>>I believe the creation of new variables on
paste is how LV is>structured (ie. this is not a bug but the way things are).
I need a>workaround, though, and would appreciate suggestions.>> ---
Ravi>>>--->Ravi Narasimhan>Dept. of Physics and Astronomy, UCLA>http://www.physics.ucla.edu/~oski>
0 Kudos
Message 5 of 6
(3,248 Views)
All of the problems with control references and local variables could have
been avoided if a state machine architecture had been used. IMHO sequence
structures have little value and should be avoided like the plague.

"L. Ravi Narasimhan" wrote:
>I have an application that requires me to make measurements in a>particular
order at specific times and to update a set of indicators>as the measurement
progresses. I use a sequence structure in which>different frames write to
local variables keyed off the indicators. I>now need to replicate this sequence
in a couple of other places.>>Unfortunately, copy/paste of the sequence results
in new front panel indicators and>variables being created. While I could
change each one manually, with>25 f
rames and multiple locals, the time required
is huge and the>possibility of errors is high as the number of copy/pastes
increases.>>Creating a subVI has been problematic as the indicators must
update as>I progress through the sequence. The subVI terminals update only
on>conclusion, as far as I have been able to find. Globals are an>option,
but, I am wary of using them.>>I believe the creation of new variables on
paste is how LV is>structured (ie. this is not a bug but the way things are).
I need a>workaround, though, and would appreciate suggestions.>> ---
Ravi>>>--->Ravi Narasimhan>Dept. of Physics and Astronomy, UCLA>http://www.physics.ucla.edu/~oski>
0 Kudos
Message 6 of 6
(3,248 Views)