LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best approach for identical code used for 16 test stations

Solved!
Go to solution

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.

0 Kudos
Message 1 of 10
(3,481 Views)

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.

Message 2 of 10
(3,471 Views)

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.

0 Kudos
Message 3 of 10
(3,394 Views)

It sounds like the subVI and the parent VI are in separate projects?

Message 4 of 10
(3,385 Views)

I"m not using "Projects", but all the VIs are in the same directory.

0 Kudos
Message 5 of 10
(3,383 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 6 of 10
(3,382 Views)

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.

0 Kudos
Message 7 of 10
(3,376 Views)
Solution
Accepted by topic author chuck72352

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 8 of 10
(3,373 Views)

If you're opening a clone then you can also hit Ctrl-M to switch to Edit Mode. That should open the original VI.

Message 9 of 10
(3,351 Views)

That's very helpful!   Thank you.

0 Kudos
Message 10 of 10
(3,349 Views)