キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Call by Reference node

Hello everyone,

 

I have a LV module that calls test modules dynamically through Call by Reference Node. I do the following:

 

1. Start to run a script that contains these test modules in a specific order.

2. In the order, I open the VI reference to a specific test module, run it through 'Call by Reference Node' and store this VI reference in a shift register. (The reason for storing the VI references is that the test modules might need to share data between themselves and hence they gotta be in memory)

3. I close all the references at the end - when the script has been completely executed.

 

With this module still in the running state (module is idle and it is not running any scripts), I try to open a test module in LV and I find that it is actually showing the "SubVI waiting to run" glyph.

 

I would like to know whether this is the behaviour expected and what should I do if I have to make the test module editable while my module calling the tests is still running?

 

I am using LV8.6 

 

Thanks in advance,

Saranya

0 件の賞賛
メッセージ1/8
3,934件の閲覧回数

Once you open a reference to a subVI, the subVI will be in the "waiting to run" state.  You need to close the reference to get the subVI back to an editable state.

 

If you need to pass information between subVIs, I would recommend you use one of the standard singleton data objects (single-element queues or action engines) to do this.  This will allow you to open and close the VIs as needed while keeping the data persistent.  Those links contain example code and full explanations.

0 件の賞賛
メッセージ2/8
3,915件の閲覧回数

Hi DFGray,

 

I am closing the VI reference when the entire script has been completed. I am trying to open the test module only after closing the VI reference. Even then, I see that test module having "SubVI waiting to run".

 

Thanks,

Saranya

0 件の賞賛
メッセージ3/8
3,911件の閲覧回数

Saranya,

 

you have to store/close the reference to each VI loaded that way. I fear that you only store the reference to the last VI in the shift register and close only that... is that possible?

 

Posting the calling code could shed some light on this...

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 件の賞賛
メッセージ4/8
3,909件の閲覧回数

Norbert,

 

I am storing all the VI references in an array in the shift register and I close all the references at the end of the test at one stretch. I am able to see that the VI references are being closed and no longer exists in the shift register.

 

Thanks,

Saranya

0 件の賞賛
メッセージ5/8
3,903件の閲覧回数

I think we have reached a limit of what we can debug using descriptions.  Can you post your code so we can look at it?  If not, can you post a screenshot (PNG or GIF format is best, please do not use BMP or a Word document, JPG is marginal)?  Something is keeping your subVI open, but without the code, it is hard to tell.  Some options:

  1. You are opening the VI reference twice but only closing it once.
  2. You are using the VI directly in another location (check the VI hierarchy).
I do what you are describing all the time (run code dynamically, modify while it is not running, run again) with no issues, so it is possible.
0 件の賞賛
メッセージ6/8
3,875件の閲覧回数

This is just a shot in the dark...

 

LV keeps track of which resource where opened by each VI as part of its house-keeping routines. When a VI goes idle all of the resources allocated by that VI are closed etc. So opening and running VI's by a VI that completes and goes idle will terminate those VI's that were created. Two techniques to avoid this situation are;

 

1) Make sure the VI that opens the VI's stays running until everything is done.

 

2) Have the dynamic VI open a ref to themselves so that they keep themselves open.

 

sS I said, just shooting in the dark,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 件の賞賛
メッセージ7/8
3,867件の閲覧回数

Sorry Guys. I know that posting a code would ease the process. I am just held up with few other things in the project. I will post a sample code as soon as possible.

 

Thanks,

Saranya

0 件の賞賛
メッセージ8/8
3,860件の閲覧回数