LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dinamically changing values of a sub-VI

hi,
let B be a sub-VI of A.
is it possible for B to be "transparent" - that is, if A has controls
connected to B's controls, and indicators connected to B's indicators, then
changing a value in A *while B is running* will affect the value of the
controls in B, and the indicators in A will show the ongoing changes in the
values in B's indicators?
hope I explained myself clearly enough.

many thx,
Avshi Avital.
Quantum Physics Lab, Bar Ilan University, Israel
0 Kudos
Message 1 of 4
(2,863 Views)
If I understud your problem, the answer is YES. If a program is running and
you change some values on the controls of the main program, and those values
are conected to another sub-VI you will be changing also the values of the
sub-VI. In order to help you more I think we need more information. Because
all depend in how are you developoing your program.

I hope this has helped you.

Alejandro Zepeda
"aviad frydman" escribió en el mensaje
news:8n8hl1$qq8$1@news.huji.ac.il...
> hi,
> let B be a sub-VI of A.
> is it possible for B to be "transparent" - that is, if A has controls
> connected to B's controls, and indicators connected to B's indicators,
then
> changing a value in A *while B is running* will affect the value of the
> controls i
n B, and the indicators in A will show the ongoing changes in
the
> values in B's indicators?
> hope I explained myself clearly enough.
>
> many thx,
> Avshi Avital.
> Quantum Physics Lab, Bar Ilan University, Israel
>
>
0 Kudos
Message 2 of 4
(2,863 Views)
Avshi,

That depends! Don't even try to think of things as being event driven in
LabVIEW unless you know how to do it. You need to think of things as being
data flow driven. The value that flows through wires into the controls of
the subVI will determine the values of those controls at the instant the
subVI is called. The data then flows through the wires in the diagram and
out the indicators of the subVI into the wires in the diagram of the main
VI. The value of a control is the value of the control and the values flowing
through the wires in the diagrams are the values flowing through the wires,
except for the instant the data is read from or written to a control or indicator.
I am not trying to confuse the issue or avoid the question,but if these
leaps of logi
c to event driven code are made before a solid understanding
of data flow is acquired, then you will create problems such as race conditions
and unpredictable code.

-Jim

"aviad frydman" wrote:
>hi,>let B be a sub-VI of A.>is it possible for B to be "transparent" - that
is, if A has controls>connected to B's controls, and indicators connected
to B's indicators, then>changing a value in A *while B is running* will affect
the value of the>controls in B, and the indicators in A will show the ongoing
changes in the>values in B's indicators?>hope I explained myself clearly
enough.>>many thx,>Avshi Avital.>Quantum Physics Lab, Bar Ilan University,
Israel>>
0 Kudos
Message 3 of 4
(2,863 Views)
Avshi,
I don't think it is possible to call a subVI transparently like you want to.

Personally, I would copy B into A. Now, you probably want to have two front panels. Maybe you could create a ActiveX control that displays a second window. This is a little time-consuming and won't provide as much control as labVIEW, but maybe it would work.

Alternately, you could run the two VIs independently and send UDP messages between them. Both programs would have to be polling to receive UDP messages from the other one. It would be a bit involved to rewrite your programs, I assume, but that's my best idea.

If you absolutely need "transparent" VIs, my best guess is that with a lot of work, you can fix half of yor problem by writing a CIN in each program. The CIN in A takes the
control you need to adjust and returns the address. Then in B you use another CIN to poll that address and update the indicator. However, I don't think this could work the other way around - a control in B changing an indicator in A.

I've done a bit of low-level Win9x memory management, and it's certainly not fun.

Hope it helps (and it's not wrong).

Nathan Herold
0 Kudos
Message 4 of 4
(2,863 Views)