LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for scalable examples of a VI

Solved!
Go to solution

Hi all,

 

Fairly new using Labview but excited to get started on my first project. The project I inherited now is that I have a single output channel for a single UUT with multiple controls and indicators.

The goal is that I need to convert this into a multiple UUT configuration.

Creating a scalable VI seems the way to go here (unless you guys tell me otherwise) so I was hoping you guys have some examples to look at. If it helps, I could share some of the code I'm working with.

 

Thanks in advance for your time 

0 Kudos
Message 1 of 8
(1,108 Views)

@Ed11bay wrote:.

Creating a scalable VI seems the way to go here (unless you guys tell me otherwise) 


What do you mean by scalable VI?

 

You usually try to design a VI so it does something, and then use it N times to do N X something.

 

Alternatively, you can make it do something and then make it do that in a loop, to make it do N X something.

 

@Ed11bay wrote:.

so I was hoping you guys have some examples to look at.


Yes, once we know what you mean, we could probably share some examples.

 

@Ed11bay wrote:.

I could share some of the code I'm working with.


Yes, that always helps.

0 Kudos
Message 2 of 8
(1,082 Views)

Please feel free to watch the attached from one of the NI courses online. Thank you for your time

0 Kudos
Message 3 of 8
(1,058 Views)

That was an interesting "introduction to a scalable appropach".  Did you try to follow the suggestions in the video?  I don't know what they suggested, so I'm reluctant to share how I "scaled" a behavioral monitoring task involving a behavioral sensor, a video camera to capture the behavior (about 5 seconds of behavior every 5-10 minutes over a two-hour observation time) and "scale it" to handle 24 stations.

 

Why don't you be a little more forthcoming about what you are trying to do (show us the code for N = 1).  Also, instead of attaching a "teaser film" that defines the concept of a scalable VI, why not attach a link to the video so that we can view it for ourselves and get an idea of what techniques you might be considering.

 

Are you prepared to "duplicate the hardware"?  You don't want one DAQ device (or one camera, or one TCP/IP port) to be "time-shared" among multiple stations.

 

Bob Schor

0 Kudos
Message 4 of 8
(1,026 Views)
Solution
Accepted by topic author Ed11bay

Hi Ed11bay,

 

Below is my understanding of the topic:

Scalable VI in general would be a VI that can grow (you can add more code) as per requirement of your VI/ Project grows without requiring a major redo of the code. Followings can make a VI fall into category of Scalable:

 

1) Using a state machine- Has different cases, if a new logic is needed, you simply  add a new case and write the additional code into that case instead of creating a slightly different version of the same VI.

2) Using typed defs- using Strict or Typed defs are a good practice to make VIs scalable. Say you want to add a new entry in an enum or ring control, you change it in one place and it apply to the rest. Instead of having to update each instance manually.

3) Using Clusters/ Array: Say you have an application that is transferring information from one loop iteration to another using a shift register but is using several wires, you may want to bundle them in a cluster or make an if data types are same to keep it easily manageable and if you need to add more wires, you simply grow that cluster/ array as needed.

 

There will be more examples as per the use case. But the basic idea is to think about the possibilities of future additions that may be required in the code and plan your current VI to accommodate additions in future without having to re-invent the wheel.

Hope this helps.

0 Kudos
Message 5 of 8
(1,025 Views)
Solution
Accepted by topic author Ed11bay

Thanks for your reply. I actually found an example in which typed defs and clusters/arrays are used so I think that's the best approach as it looks very similar to my original application. 

Thanks again for your time. 

0 Kudos
Message 6 of 8
(1,019 Views)

@Ed11bay wrote:

Thanks for your reply. I actually found an example in which typed defs and clusters/arrays are used so I think that's the best approach as it looks very similar to my original application. 

Thanks again for your time. 


Just a warning is that this can be a very tedious, mistake-prone mission if the original programmer did not use typedefs and you have to hunt down all the potential candidates for a replacement.  But it has to be done.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(963 Views)

To add to the discussion, I never use state machines nor type defs...

 

Clusters\Array I do use of course, but the trick is to use a cluster (class?) or array when appropriate. Or a map, set or whatever structure when appropriate. It's when you get this wrong, things get rough.

 

In a perfect world, I'd suggest to start with OO, as it's not harder than learning 'normal' programming (and in fact is used to make things easier). However, OO course material is somewhat lacking, and usually assumes LabVIEW knowledge so the OO can be added as icing on the cake.

 

So perhaps a good way to start is indeed with state machines and type defs.

0 Kudos
Message 8 of 8
(878 Views)