LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subpanels

Hi to All,

 

I have a problem related to subpanels. When I searched the forum, I saw 100posts related to subpanels. But din't knew exactly which post to follow. Below is the problem description:

 

I have to pass the ouput of subpanels into my main program. I have to make a path from string concatenation in the main VI for which I need the output of subpanels.

The path should be something like this: opc://localhost/National Instruments.NIFB_OPCDA.3/E-LD PORT 1002.TMux_1.0.AI1_TMux_1.PV.STATUS

 

I was able to do this  using combo boxes. But in order to make the code more user friendly, I am planning to use subpanels.

 

I have attached the code for reference. Please let me know in which post I can find the solution to this problem. If not then please suggest your inputs on this. Also suggest your inputs on the code(Like if it requires any tweaking or alterations or modifications).

 

Let me know if you require any further information.

 

Thanks & Regards,

Sushruth.

0 Kudos
Message 1 of 12
(3,447 Views)

I'm confused as to what you are trying to do.

 

Normally, if you want to run a subVI inside a program, you simply insert the subVI where it is needed.  You don't need to specify its path and then call it, etc... 

 

You have VIs called. 'Port 1 P Selection" and "Port 1 MUX Selection."  Why didn't you insert these directly into your main program?

 

If you want to pass the output of a subpanel out to a main program, you simply wire the output terminal to a connector on the icon and then wire the icon out to the program.

 

Either you are trying to do something very unusual, or you are making this about 100 times more difficult than it needs to be.

 

Also, you have a few places where you wired a value out to an indicator and also to a property node of the indicator.  That is not necessary.

 

 

 

0 Kudos
Message 2 of 12
(3,437 Views)

It looks like you want to have the ability to do one of the following four things:

 

  • measure temperature from port 1
  • measure pressure from port 1
  • measure temperature from port 2
  • measure pressure from port 2

 

Is this correct?

0 Kudos
Message 3 of 12
(3,430 Views)

Hi,

 

Thanks a lot for your swift reply. My professor wants it to something similar to pop ups. Hence was using subpanels. Also, Pls let me know how I can use these as subVIs in my code. I dont know exactly how to wire the output terminal to a connector on the icon. Also it would be of great help if you indicate the mistakes in my code as I have lot to learn in Labview. This will be a real training for me. I tried the code using pop ups. But problem with pop ups is U need to call them each time which I dont want to. Hence was using subpanels. I will also try using the subVIs.  Thanks a lot for your suggestions. Will improve in these areas.

 

Best Regards,

Sushruth.

0 Kudos
Message 4 of 12
(3,427 Views)

Yup......I select 1st port 1. then device type. Based on this, the subpanel will appear. The output of this is required to form the Path.

0 Kudos
Message 5 of 12
(3,426 Views)

Also I have yet to code the appropriate channel selection of pressure or temperature designs. If I get my subpanels right then I can proceed with another subpanel which gives user to select channel depending on the device.

0 Kudos
Message 6 of 12
(3,425 Views)

To add a SubVI to your code, right click on the block diagram and choose "Select a Vi..."  Navigate to the SubVI you are looking for and it will appear in your code.

 

SubVIs can work in several different ways.  Normally, they do not show up when called.  If you want to make them appear as panels when called, do the following: 

 

Select "File" on the menu bar, then "VI Properties".  Under the category of "Window Appearance" select "Dialog."

 

Passing data into and out of SubVIs is done through connectors on the Icon.  To set these, go to the front panel of the SubVI.  Way up at the upper right, there is the ICON for the subVI.  You can click on this and select "show connectors" (or something like that, it's a little different in some version.)  Select a Pattern that has the right number of connectors.  Then click on a connector on the icon and then a control or indicator on the front panel.  This creates a connection between the SubVI's icon and the code.

 

Also, your event structures are way too complicated.  The attached code shows how to make case structures for the four cases I outlined above.

 

 

 

 

0 Kudos
Message 7 of 12
(3,416 Views)

Hi,

 

The SubVIs doesn't serve the purpose. Hence I have to go with subpanels. I found out 2 ways to pass the data from subpanel to main VI. one is by using value signalling and the other is by using Ques. But I am unable to implement them in my code correctly. I need your help to resolve this. Please suggest your inputs.

 

Thanks & Regards,

Sushruth.

0 Kudos
Message 8 of 12
(3,383 Views)

I have attached a zip file of my codes. I want the string output of the subVIs in my main VI inorder to create a URL which is later fed into Datasocket connection. I tried to use control get function. But its not working(in Port 1 P). Can u please help me out to resolve this issue???

0 Kudos
Message 9 of 12
(3,381 Views)

Here is the attachment....

0 Kudos
Message 10 of 12
(3,379 Views)