LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing parameters to a reentrant subvi

Solved!
Go to solution

Hello! I call a reentrant SubVi as it is explained in http://digital.ni.com/public.nsf/allkb/9CE784F50F816EA18625751900775EBB. It works (I can start several instances of the SubVI), but for the proper usage I need to pass some parameters to this SubVI.

I tried:

1) to use bounding to a data socket - as one see, controls on the front panel of the clone show for a very short time, that they were connected to the socket, but after that they are inactive and empty

2) to set parameter by calling of the SubVI  using the method "Control Value.Set (variant)". In this case I see control fileds properly initialized on the front panel of the SubVI, but the are not used - other control fields, which have to be initialized with these start values are empty.

Before I called this SubVI as "stricktly typed", parameters were wired to VI inputs and everything went OK, except that I couldn't call the stricktly typed SubVI as reentrant - only one instance was active, next was opened only when the previous was closed.

What is the problem?

Thank you in advance for answers

 

0 Kudos
Message 1 of 4
(2,906 Views)
Solution
Accepted by topic author pericles

You are spawning the VIs as it seems.

The reason for the "Call by Reference" Node not to work like you expect is simple: The Call by Reference node will only terminate, if the VI which is called is finished.

 

I do not recommend you to use datasocket for data transfer. It is overhead you do not need. Still you can do it, but you have to write the data in order to update the values. Simply bind it is not sufficient.

Either pass the values using VI server (you have to pass each parameter in an individual node) or you use other transfermechanisms:

- FGV, also known as AE

- Notifier/Queue

- TCP based protocols like STM

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 4
(2,900 Views)

Dear Norbert,

thank you for the answer - I'll use passing parameters by means of VI server nodes, I used this method already. Among other methods you meant I wonder how one can use que or notifier in this case: I thought that they are "known" only within one and the same application/VI. Is it possible to communicate over que between applications? Or have I misunderstood your message?

0 Kudos
Message 3 of 4
(2,891 Views)

Queues/Notifier work (if named or if the reference is passed) within the same application instance. So you cannot use them to exchange data between two running exe's.

If you are working with a "traditional plugin architecture", the VIs you call are executed within the same application instance (even if they are not compiled into the exe!) and you can use queue/notifier for data transfer.

 

Norbert

 

[Edit] This is of course also true for FGV/AE 

Message Edited by Norbert B on 12-11-2009 07:14 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 4
(2,889 Views)