LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does a sub-vi require controls?

I've been writing LabVIEW programs for a couple of years but my programs are unwieldy because I never did understand the concept of sub-vi's I know they are supposed to be sub-routines but the places I need them in programs don't have controls or indicators. It is my understanding that sub-vi's require these, at least that's what the books say. Maybe a sub-vi isn't what I'm looking for. Is there a way in LabVIEW to save part of a program that doesn't have controls and indicators and use it over and over in other parts of the program. For example, I am now sampling 28 channels from 2 NI-4351 cards. 28 icons on the diagram take up a lot of space. Is there a way to reduce these to less icons since the all perform the same function?

Bob
0 Kudos
Message 1 of 15
(2,841 Views)
Bob,

Think of a control as an input and an indicator as an output. They don't need to be shown on the screen, but they are the methods LabVIEW uses to puch variable data around. Any wire on your diagram can become either a control or an indicator on the front panel of a subVI.

Some of the icons on your unwieldy diagrams are actually subVIs. Double-click one and you will see its front panel. The wires going into the icon are connected to controls through the connector pane. The wires comming out are connected to indicators in the same fashion.

Controls and indicators are LabVIEW's answer to parameters in those primitive text languages.

- Dan
0 Kudos
Message 2 of 15
(2,841 Views)
Dan,
OK, so the next question is, how can I find out how to do this? In this specific instance, I have an "unbundle" icon and I'm unbundling into 28 wires and feeding them thorugh a bunch of icons to an array. What type of control do I put on the front panel to represent the unbundle icon? There isn't an unbundle control as far as I know or is it in the pallette somewhere. And what of the output? What type of indicator does one use for "Build Array"? From my viewpoint, there is something missing in the tutorial about how one goes about doing this. Do I create a ficticious control for an input and then hide it somewhere off the screen and feed the undundled wires into this fake control? I don't understand the path of the data flow as it goes in and o
ut of the sub-vi. I know, the book says it goes through the icon connector, but what does that mean? If we think of a water pipe, somewhere the pipe to and from the connector pane isn't connected to the rest of the plumbing except through controls and indicators that don't exist in the rest of the program. So how does one connect the connector pane to things that don't exist? Do you understand my dilemna?
Bob
0 Kudos
Message 3 of 15
(2,841 Views)
The unbundle function operates on clustered data. You can create a cluster control on the front panel. When viewing a front panel, you can right-click on the icon displayed in the upper right corner and select "Show Connector". You can use the wiring tool to connect the control to the connector pane by first clicking on the control and then on one of the slots delineated on the connector.

Who sold you LabVIEW? Your local DSM should be able to show you this fundamental stuff. If you have a mission-critical application and a budget, ask your DSM to recommend an Alliance Member. We develop LabVIEW applications every day. You can use the VIs and subVIs developed for you as good example material. You might also want to check out some of
the hundreds of examples that come with LabVIEW.

- Dan
0 Kudos
Message 4 of 15
(2,841 Views)
We bought it from National Instruments, didn't know anyone else sold it. If I then include the unbundle in my sub-vi, this still doesn't solve my problem, it only means then I have to find a way to connect to the next block back. And then if I include that in the sub-vi and so forth I am back to where I am now with no sub-vi's. That is my problem, I don't want to wire to a control, I want to wire to another part of the program that is not a control. From what you say, it can not be done.
What is a DSM? As far as I know, NI has nothing in the Philly area. I have to call Texas for help.
Bob
0 Kudos
Message 5 of 15
(2,841 Views)
Couldn't help but stick my $.02 in but it seems that for someone who's been using LabVIEW for a couple of years, you've missed out on understanding some of the basic concepts. I would suggest that you look at some of the VIs under the DAQ palette. These "icons" are subVIs and you should be able to see how they can remove clutter on your diagram - not add to it. Try highlighting a section of your diagram and then under the Edit menu, select Create SubVI.

As far as Pennsylvania, NI has a list at http://digital.ni.com/domestic_sales.nsf/byregion?readform&region=us&subregion=pa&node=174691_us. Give one of them a call and see if there are any local user group meetings or LabVIEW classes.
0 Kudos
Message 6 of 15
(2,841 Views)
Good call, Dennis. I was about to direct Bob to the same place!

- Dan
0 Kudos
Message 7 of 15
(2,841 Views)
Yes, of course you are correct. I have no training in the basics, I've learned through trial and error. I do have some very workable programs that do marvelous things and save the company money, but I'd like to do these programs more effeciantly. I took the Basics I and DAQ course and was not impressed. The instructor said he had his own way of doing it and wouldn't be following the NI curriculum. He never fired up the computers. He said he was going to teach us unknown tricks that only the power users know. It was a complete waste and ended up quite confrontational because the students were so angry. I bought the book, LaBVIEW for Everyone but still don't understand the sub-vi thing and also I still can't change the c
olors to what I want. It's too bad there isn't a basic tutorial somewhere that is for self-study. I'm on the phone almost every day with NI support and they have been very good but when I ask these very basic questions they find it difficult to believe someone could write these large programs without understanding some concepts. I have become very good at working my way around the software, but I realize the software should be helping me instead of being a hindrance that I have to work around.

Bob
0 Kudos
Message 8 of 15
(2,841 Views)
New to This,

LabVIEW for Everyone is probably worth the money. But it isn't
expensive. The current Course Kits are much better. At $300 a pop
they should be. With the new Course Kits for Basics I and II and
maybe the Advanced Course you could learn the "correct methods." (I
haven't found the DAQ class material to be all that great. And the
signal conditioning info that I do use is available elsewhere. Maybe
if they updated it the quality of the Basics Course Kit...)

Even though the NI run classes would be much better than the bootleg
class you took, you are probably too far along to really get much out
of them. (I just took the classes in December and am functioning
pretty well now a
fter some excellent help line help; taking the
classes would be useless to me now.)

You have a DAQ board, I presume. The other ingredient would be a
Signal Accessory. If you studiously work your way through the course
kits with the signal accessory you will be back on track. I have come
to appreciate the Signal Accessory. It is a good tool for working out
a VI without actually having the hardware all set up. Notice that the
help line folks all have one and use it constantly.

Good luck,

Mike Ross
0 Kudos
Message 13 of 15
(2,646 Views)
This "Bootleg" course as you call it was done by NI and my employer made the check out to NI, and the cost was close to $2000. It is my understanding that NI's instructors do not have State certified teaching credentials. They are merely engineers who know how to use LabVIEW, and in some instances they have no teaching qualifications. As such, some classes are really good and others are really bad, it is the luck of the draw.
Bob
0 Kudos
Message 14 of 15
(2,646 Views)