LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sub vi

I am having problems creating a sub vi from drivers I downloaded from the IOtech website. Specifically, there is an example VI for my Personal Daq56 board that involves the acquisition and display of 10 different inputs. In this case the inputs would be thermocouples. The VI runs fine and it is what I intend on using for my project. However, the front panel of this VI is very cluttered with options for which type of thermocouple, signal range, duration, etc. For my experiment, all these will be fixed values for the proper equipment so I have no need to change these. My challenge is that I want to make this entire VI into a sub VI so that I can create my own front panel which displays only the options I want and so I don't have to set/change these options for each of the experiment variations.

 

Now I had hoped to do this by making the VI into a sub vi so that I could just paste it into my new VI, and tweak it from there. When I attempt to create the sub vi by clicking and dragging a rectangle around the desired code, then Edit->Create subvi, it gives me undesired results. First off, a popup prompts about the while loop that I'm trying to include in the sub vi. Secondly, the only thing that appears to be subbed, is a sub vi that was already in the code. To me, it looks like the while loop messes everything up and sub vi-ing isn't really achieved.

 

I am probably missing something really stupid, but regardless, I don't know my way around this obstacle. Any and all help is much appreciated.

 

 

Download All
0 Kudos
Message 1 of 7
(2,996 Views)

What you are attempting to do makes no sense. You are trying to create a VI from a VI that already exists. Calling this example as a subVI would be wrong in any case. You would soon be posting a question about how to stop it and why your graph in the top level VI does not update. You should probably spend some time with the LabVIEW tutorials.

 

If you want to use this without the front panel control, simply go to the diagram and right click on the terminal and select 'Change to Constant'. Modify the values as you like and you are done.

 

p.s. You did not attach the llb with all of the low level functions.

0 Kudos
Message 2 of 7
(2,982 Views)

Hey csmrunman,

 

I would have to agree with Dennis on this one. If you are looking to rid your front panel of certain parameters because they are to be constant, the best option would be to right click on them and select change to constant. This would make them constants on your block diagram, and they would no longer be present on your front panel.

 

As an alternative, you could right click on the terminals on the block diagram and select "hide control." However, Dennis' idea is much cleaner.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 3 of 7
(2,957 Views)

Ok, that all makes sense.  In the future, when I get further along in the code and I want to have the ability to choose different temp routines, that control my experiment, how might I do that? I was going to have about 10 different temp routines for my experiment, all preset by me, and hopefully there would a be a pop down menu to choose the routine. Any suggestions on how to do this?

Thanks

0 Kudos
Message 4 of 7
(2,949 Views)

Hey csmrunman,

 

The best way to do what you are looking for is to use a case structure with an enumerated control. Check out this Tutorial. More specifically, the end of the tutorial talks about case structures and enumerated controls. This would allow you to choose what test to perform, and then each test could be its own case.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 5 of 7
(2,912 Views)

BCho,

 

That helped a lot with my brainstorming of the code. The next step after assigning a routine would be choosing which furnaces to apply the chosen routine to. Is there a way that the user can select multiple items from a pulldown, for the previously chosen temperature routine to be applied to? I was thinking I might be able to do the Choose a Routine, Choose a Furnace(s), and so on, in a flat sequence structure.

thanks

0 Kudos
Message 6 of 7
(2,890 Views)

Hi,

 

I would suggest using a ListBox if you absolutely need to select multiple items. The listbox has a property called "selection mode" that has an option for selecting more than one input.   However, this outputs numbers and won't have the same easy user interface that enums do.  

 

Try this out, and post back if you have more questions.

 

Cheers, 

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 7 of 7
(2,863 Views)