From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-07-2014 10:19 AM
I have a SubVI that I want the user to be able to launch (up to) 4 separate instances of. It's a small grouping of indicators that represent possible error conditions for 4 separate but identical sections of the hardware being monitored.
To accomplish this, I set up the following code:
I need the indicators that are in the SubVI to be updated even when the user isn't looking at them (because there is separate history tracking going on), so as you can see above, I make 4 (nearly) identical calls to run the VI, then in an event structure, when the user clicks on the control associated with each section, it executes the FP.Open command for that particular VI's reference.
When I executed this, the only one that will open is the first one (vertically), the one that's set to the base address of 10000. I presume this is because it's the fist reference that runs when the main program executes.
So then I went and edited the properties for the SubVI to set its reentrant execution to "preallocated clone reentrant execution", but this made no difference.
Any thoughts on how to solve this problem? thanks in advance
07-07-2014 10:25 AM - edited 07-07-2014 10:27 AM
You need to pass in a 0x40 to the options on the Open VI Reference
I would also put the intialization inside of a FOR loop and autoindex the reference. Then you have an array of VIs and you just have to choose which index to mess around with. This will make it very simple when you need to add another VI. It is also a lot easier to have just 1 set of wires instead of 4 being passed around.
07-07-2014 10:28 AM
I'm sorry, can you be more specific? You mean the FP.Open method? What property?
07-07-2014 10:29 AM
I'm sorry, Open VI Ref...I see what you mean, my bad. Thanks
07-07-2014 10:36 AM - edited 07-07-2014 10:36 AM
I thought I was pretty clear by calling the function the Open VI Reference. That is its name after all.
Here's what I am suggesting.
07-07-2014 11:24 AM
I followed your example...now each one opens, but they all have the same base address value of 10000...I double checked that I used 4 different indices in the event structures:
07-07-2014 11:44 AM
Looks like I mislead you. You need the options to be set to 0x08. 0x08 is "Prepare for reentrant run" while 0x40 is "Enable simultaneous calls on reentrant VIs". Since you are using the Run method, we need to use 0x08.