‎10-04-2010 07:41 PM
I'm writing code for 16 test stands all of which are the same, except that different CAN circuits are used, i.e. CAN0 through CAN15. The approach I'm planning on using is 16 VIs, one for each test station running independently and in parallel, i.e. they can be stopped and started at different times. Each of the 16 VIs have about 10 complex subVIs which are all the same. Even though I dont use any uninitialized shift registers I'm wondering if there is any advantage to using a reentrant approach, or even if it will work for my application. Any suggestions are appreciated as I have no experience using the reentrant approach.
Thank you.
Solved! Go to Solution.
‎10-04-2010 09:20 PM
The advantage to making the common subVI's reentrant is that the execution of one subVI for one test station won't block the execution of the same VI in another test station.
I have no experience with this topic, but I am sure someone else will be ready to post into this thread that it sounds like you want to use LVOOP (LabVIEW object oriented programming) to define classes where you can duplicate objects for each test stand to have a modular programming architecture.
‎10-13-2010 09:01 AM
I have made all VIs in my application reentrant, including subVIs. I noticed that when I go to VI Properties of a VI which I have made reentrant, it is disabled, but if I go to VI Hierarchy->File->VI Properties->execution is enabled. Why is VI Properties disabled for a VI, which means if I wanted to change it back from reentrant to nonreentrant I would have to go to VI Hierarchy?
Thank you.
‎10-13-2010 09:14 AM
It sounds like the subVI and the parent VI are in separate projects?
‎10-13-2010 09:16 AM
I"m not using "Projects", but all the VIs are in the same directory.
‎10-13-2010 09:17 AM
First, I would strongly recommend that you write a single rentrant subVI that can be used for all your stations. Use configuration files to provide the configuration differences. You can use configuration input to determine how many stations you have and how many tasks you need to run. You can then dynamically start the individual tasks for each station.
By using this approach you have less code to maintain and your system can easily expand if needed. Using 16 subVIs which as all the same except for the CAN circuit configuration if you need to change you algorithm or fix a bug you have to modify ALL of your subVIs.
I suspect that when you open your subVI now you are actually getting a clone of the VI. Look at the name of teh subVI. If it has a number after it you are getting a clone. The clone itself is not editable. You need to open the primary VI directly.
‎10-13-2010 09:20 AM
You are correct, I am opening a clone. How do I open the primary VI directly?
Thank you for the suggestion for using configuration files, I will take that approach.
‎10-13-2010 09:22 AM
First, you should get in the habit of using projects. They are very useful. If the code is in a project you can open the VI from there.
‎10-13-2010 09:45 AM
If you're opening a clone then you can also hit Ctrl-M to switch to Edit Mode. That should open the original VI.
‎10-13-2010 09:47 AM
That's very helpful! Thank you.