LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Calling A SubVI

Hello all -

Trying to debug this situation...I've got a control VI.  It contains a boolean control. 

When this boolean control goes true, I'd like for the SubVI (Software Change Reqest) to open (Not just "Show" and "Hide" with property nodes).  This is so multiple people can use this application a day, and I don't have to code the software to clear all the fields each time, yadda yadda.

Once open, the boolean control will go back to false, and the control will be done with its part and waiting for another action to make the subVI pop up again.

As for the SubVI, when it has been opened...  This hasn't been tested yet so its bound to have errors in the code, and well it was quickly coded for testing purposes.  Regardless, it will create a txt file, and put in all of the information from the fields listed on the front panel, and save it to a place on our network.  When its done, and the file has been created, it will close itself.


Given the code posted, anyone see the problem in why its not popping up?
LV7.1, LV8.5, LV2014/15/16
Download All
0 Kudos
Message 1 of 8
(3,438 Views)
Well, if you want a main VI to call a subVI, you actually have to put the subVI in the main VI's diagram. Either that or call it dynamically. The only thing you have in the main VI is an Open/Create/Replace File function.
 
You might want to think about taking a LabVIEW class to get familiar with some of the fundamentals. See some of the links at http://zone.ni.com/devzone/cda/tut/p/id/5199.
0 Kudos
Message 2 of 8
(3,436 Views)
Dennis -

Sorry I missed that, the control vi I gave you was something I just put up on here real fast so I didn't have to upload our whole test program just for that boolean.

Just drag the subvi icon into the true statement and it does what I meant it to do posting it on here.  Its just not being visible.  When you press the T/F boolean, it runs the program, you can see the messages to the user popping up, it just doesn't show the front panel - I'll reattach the corrected control VI for others - Sorry was trying to be too fast.

The main program I have us using for our control uses about 15 subVI's to keep everything from eating up cycle times when not in use - but they are just used, under the main program, they aren't actually showing the front panel.  I guess thats where the question comes in.  Does a property node "have" to be used for this or can can it just naturally be visible.


Message Edited by leachdor on 11-27-2006 09:34 AM

LV7.1, LV8.5, LV2014/15/16
Download All
0 Kudos
Message 3 of 8
(3,433 Views)
Shoot ok trying to do this again -

Added the wrong files on there, and went to edit the post and who knows what happened.

Anyhow these should be corrected
LV7.1, LV8.5, LV2014/15/16
Download All
0 Kudos
Message 4 of 8
(3,421 Views)
If you simply want to make a subVI's front panel visible, you have a couple of options. Open the subVI and go to VI Properties>Window Appearance>Customize. Select 'Show front panel when called' and 'Close afterwards if originally closed'. This setting would be used if you want to show the front panel every time the subVI is called. If you have multiple instances of a subVI in a main and only want to show the front panel some of the times, in the main, right click on the subVI and select 'SbuVI Node Setup'. You will have the same options as in the above.
0 Kudos
Message 5 of 8
(3,421 Views)
If you don't have the base version of LabVIEW, you might also want to think about using the event structure. Here's a modified version of your subVI. It also eliminates the sequence structure. The event structure is much more efficient than polling and the sequence structure is seldom required in any program.
0 Kudos
Message 6 of 8
(3,415 Views)
Thanks dennis I've got it working pretty good now...Dunno if you tried to run it though?

Did you get this error "Command Requires GPIB controller to be Controller in Charge"?

Sounds like something is wrong with one of the inputs into the write file function.  Not sure what though, I've used this method all over our other programs with no fault.  The file is created before trying to write to it by the "Create or replace", so shouldn't be that there isn't a file?  A folder with that directory is there also...

Did you get this when you ran it or is it just local to me?
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 7 of 8
(3,400 Views)
Sure, I got the error but I ignored it because I don't have the same folder. You have two possible causes for that error. I don't know why you oicked the second possibility as you don't have any GPIB functions. The first one - 'An input parameter is invalid.' is what you need to focus on. Look at your file name. You can't use nn/nn/2006.txt as a file name. The '/' character should be replaced with something else.
0 Kudos
Message 8 of 8
(3,395 Views)