LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fishing for opinions

As a relatively green developer, each project I approach has elements that are new to me.  My latest is no different.  

This project is what we refer to as a "durability" tester.  The idea is that a part is placed in a "nest" and "operated" either until it breaks, or completes a large number of cycles.  

In this particular case, 4 parts will be tested at once.  But they will not necessarily be the exact same part, or running the exact same test.  As well, if one part fails or finishes early; That "station" will be reloaded with a new part and testing will continue where it left off on the remaining stations while re-starting on the new one.    

This is where my question is; In the past, developers here have created a separate state machine (using NI SDTK) for each part.  As well, front panel controls and DAQ all happen in separate, top level While Loops.  This makes for many parallel loops running at the top level, as well as a HUGE block diagram.   

I'm interested in how others would approach the problem of 4 independent parts under test.  Does having 4 top level state machines seem reasonable?  Or is there a specific reason not to do things that way?


Thanks for reading.  Smiley Happy  

---------------------
Patrick Allen: FunctionalityUnlimited.ca
Message 1 of 8
(3,752 Views)

Hi

This may be a quiet difficult approach if you're not so used to LV yet:

Last year a made the program for a test rig, where 7 units are tested in parallel. So I used opengoop to create an object for each item, which was passed from test to test, as each item was moved on to the next station after the test. In the main application I have a statemachine, which runs 7 subvis (one for each test) in parallel in the test-case. So no huge block diagram and furthermore some tests were similar, so I made the subvi reentrant to really run them in parallel.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 8
(3,752 Views)
Thanks for the reply becktho,

I've not used OpenGoop at all yet, so I think I'll be best to stick with what I know for this one.  In this case parts are not transfered to different nests during the testing process, so I don't need to track a part that has moved to another station.

I've not yet worked with reentrant VIs.  But I think the example I've been looking at was attempting to do the same thing by having 4 separate main state machines running on the top level.  Since each part is more or less treated as though it's running on a separate machine, this probably seemed like the easiest way to do it.

I will look over the documentation and application notes I have downloaded to see if I can incorporate this methodology and try to keep things a little cleaner.    


---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 3 of 8
(3,720 Views)
Maybe the state machine toolkit would help.
Message 4 of 8
(3,708 Views)
I'm counting on it.  Smiley Very Happy


It's one of my favorite tools. 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
Message 5 of 8
(3,690 Views)
What comes to my mind if you say "top level while loops" - make subvi. Each while loop could also be a subvi.
 
This makes your main vi definitly more readable.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 8
(3,660 Views)
I just recently discovered how I could make state machine into a SubVI.  I'd always thought the only way to create a SubVI was to select the items I wanted included and then goto the Edit-->Create SubVI menu.  This method doesn't work very well for code that includes loops.  

If I do convert my top-level state machines in SubVIs, will I have to set them as reentrant to run at the same time?
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 7 of 8
(3,638 Views)
If you have the same vi three times to run in parallel, then you have to make them reentrant. If you have three different vis, you do not have to make them reentrant.
 
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 8 of 8
(3,631 Views)