LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to debug multiple copies of a dynamically load vi

Solved!
Go to solution

I have one subvi which is dynamically load by several VIs. How can I debug the subvi for each instance? It seems that I can only open one copy of the subvi but I want to get the front panel for each instance. Is it something possible? Thanks!

 

Tom

0 Kudos
Message 1 of 7
(4,023 Views)

A couple options:

  • Set a breakpoint in the VI. Each instance will pause on that breakpoint when it hits it, allowing you to start debugging.
  • Set an Invoke Node to open the VIs front panel at the beginning. Once it's open, you can get to the block diagram and start debugging each instance.



In each case you'll have to remember to remove these items when you're done debugging.

Jarrod S.
National Instruments
Message 2 of 7
(4,013 Views)

Hi Jarrod,

  

    Thanks for your reply.  If multiple instance of the same subvi are called at the same time I still can get only one front panel open. Do I miss something? I attached a simple test program I tried. Thanks for help!

 

    Tom

0 Kudos
Message 3 of 7
(4,001 Views)
Solution
Accepted by topic author tom_z

You need to do two things to open multiple instances of the same VI dynamically.

 

  • Make sure the VI is reentrant
  • Set the options input on Open VI Reference to the value 8, indicating you are opening the VI for reentrant run.


Otherwise you are simply opening a reference to the same VI twice, and this instance can't execute in two places at the same time. The second call to the VI will have to wait for the first to end.

Jarrod S.
National Instruments
Message 4 of 7
(3,988 Views)

Hi Jarrod,

 

     Thanks! It works. I know in LabVIEW 8.6 if I call the subvi which is reentrant I will get multiple instance for the same subvi. It gives the same results as what you suggested. However if I use the same configuration for VIs running on Real Time target it doesn't work. I have make sure the subvi is reentrant and preallocate instance for each clone. But when the main vis runs I click the subvi icon in the diagram only one subvi front panel opens and it doesn't correspond any of the instance. Is the subvi running on RT target is different?

 

    Tom

0 Kudos
Message 5 of 7
(3,950 Views)
The execution is the exact same on RT. You can run multiple reentrant instances of a VI just like on Windows. But I don't believe you can debug different instances of a reentrant VI on RT. My best advice I suppose is to do as much debugging on Windows as possible before going to RT.
Jarrod S.
National Instruments
Message 6 of 7
(3,944 Views)
Thanks! You confirmed what I thought.
0 Kudos
Message 7 of 7
(3,926 Views)