Jump to content

How to ingegrate two VIs developed by two different people


pockey

Recommended Posts

Hi,

I need to integrate two VIs developed by two people. I need to show both the front panels to user. However, when I open one VI in another one, it is a icon and I could not show the two front panels together.

I could only choose the "SubVI Node Setup" and to show the second VI during running. To exchange two front panels is troublesome...

Is there a way to copy the whole VI(both front panel and diagram) to another VI? So it will look like a single VI.

Well, I still have a problem to stop the two VI at the same time.

Thanks!

Link to comment

Pockey,

If you want to have only one front panel shown to the user, can you either:

-Copy and paste the entire front panel / block diagram from the SubVI to your main VI (There's no easier way that I know of other than 'Select All', 'Copy', 'Paste'. Your VI will get pretty ugly, though, since you now have two VIs in one.

-Run your SubVI through a subpanel. With a subpanel, you can "run" another VI and show it's front panel as part of another. Instructions for that can be found here:

http://zone.ni.com/reference/en-XX/help/37...el_in_subpanel/

That said, in either case you'll need to create a way to get both VIs to stop simultaneously. I'd probably create a notifier in the "main VI" which sends a notification when the stop button is pressed. Then, have your subVI listen to the notification in its idle case and have it stop on a notification.

Let me know if you need more help.

~Jeff

Link to comment

Thanks, Jeff Plotzke

By just copy and paste: if I copy all the components of the front panel, I lost the connections of block diagram

if I copy all the components of the block diagram, I could get the original connections, however, the front panel is too strange. The copied front panel is somewhere far away from the original one....It\'s a little bit troublesome, anyway, I\'ve got that.

However, I did not know how to make the global \"Stop\" button, the structure of the VIs is shown as below:

post-6631-1170136028.gif?width=400

I want to try the method of SubPanel, however, I also come accross some problem:

I want to make "Part 2" as the SubPanel...

"Wire the path of the VI whose front panel you want to load to the vi path input of the Open VI Reference function."

The above is from \"Loading a Front Panel in a Subpanel Control\" on NI Page, I did not know what is the \"path\"??

Is it the location of the VI in my computer? Such as: \"E:\\Pockey\\job6 - DSP\\SRF24-58RFMTester\\Meas_SINAD_rev1.0.vi\"??

So how could I combine the two VIs together? If I send the final VI to some other user in different folder location, will the program run correctly??

Link to comment

Thank you, Omar Mussa

I've known how to make a global button to stop the three parallel while loop, however, I still did not know how to implement the SubPanel solution.

I place the "Current VI's path" and the VI I want to call is in the same folder as the main VI, so I just put the Sub VI's name in the path, however, the program says it could not find the VI I want to call.....

Strange, or something wrong with my "path"???

Link to comment
I place the "Current VI's path" and the VI I want to call is in the same folder as the main VI, so I just put the Sub VI's name in the path, however, the program says it could not find the VI I want to call.....

Can you post a screenshot of the code that you're trying for the subpanel? If you wire a path to the Open VI Reference VI, it will load the VI from the path you give. If you just give a VI file0name (with no absolute path), it will load from the current running VI's folder.

For example, I just tested with the code attached. I have "C:\master.vi" running "C:\subVI.vi" in a subpanel. It works either with "C:\subVI.vi" or "subVI.vi" wired to Open VI Reference. (I made sure all VIs were out of memory before each test)

As for distribution, you'll need to either make sure that if the user won't have the subpanel VI in the same folder, that your program accounts for this and asks the user to enter the location of the VI. That way, you can build the path to pass to 'Open VI Reference'.

post-4078-1170299042.jpg?width=400

Link to comment
But could I make the scrollbar invisible?

I've set the height and width to the same as the called VI, why there is still scrollbars??

The subpanel uses the same properties set in the 'Window Appearance' VI Properties. So, in your subVI that you want in a subpanel, open up VI Properties -> Window Appearance -> Customize -> Uncheck 'Show Vertical/Horizontal Scroll Bars'

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.