LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instances of a subVi to display data

What is the best method for creating and using a subVi that was created specifically for displaying results?

I created a subVi for displaying stress (tension & compression). I started with a Numeric Control/Vertical Pointer Slider which I changed to a Numeric Indicator. I added 2 LEDs for out of bounds indicators (+ and -). I used the Property Node for the Slider to permit setting the minimum and maximum values for the scales. The subVi has only two inputs; the min/max scale value and the data to be displayed. I added a Decoration in the form of a graduated color scale to match that used in PTC's Pro/E.

When I use the subVi each instant in the Block Diagram uses the same Front Panel. This makes the Slider or Needle flicker.

What I'd really like is for my subVi to work and act like the original Vertical Pointer Slider and appear directly on the main Vi.

I know I can create multiple copies of the subVi's file in the folder on the disk but that makes maintenance a pain because each change will require the duplication once again. This will still create multiple Front Panels to display the data.

I need a solution that will work with the data for about 20 strain gauges displayed on the screen at the same time.

Copying and pasting the Block Diagram for my stress subVi into the main VI will work but will also create a wiring nightmare

How do create this type of display.

 

0 Kudos
Message 1 of 15
(5,804 Views)
Have you tried making your VI re-entrant?

Every instance of a re-entrant VI has its own memory space and you should be able to display multiple times.

You can make a VI re-entrant by checking the lbox in the VI Properties -> Execution window.

     Rob
0 Kudos
Message 2 of 15
(5,795 Views)

Hi JoeSz,

      Would you like all the sliders/limits on a single panel, like so(?):

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 3 of 15
(5,793 Views)
If I understand your issue properly, you have a VI that will basically work like a dialog box showing data. The problem is that you want to be able to have multiple copies open at the same time. Correct so far?
 
The way to do that is give your finished dialog box VI the file extension .VIT. This makes it a template VI so every time you open it you are creating a whole new copy of the code running in its own memory space. To use this template, create a VI that uses VI server calls to open your template VI whenever the operator wants to display another dataset.
 
The process to open and run the template is:
  1. Open a reference to the template using the Open VI Reference function. Note that what you actually get here is a reference to a new copy of the template--not the template itself.
  2. Use calls to the Set Control Value VI method to pass the data to your new copy of the template.
  3. Call the Run VI VI method to start the copy running.
  4. Call the Open FP VI method to open the copy's front panel.
  5. If you aren't going to need the VI reference you opened in step 1, close it. You can also use all the references you create to programatically close the clones.

One thing is to be sure to provide some way (label, window title, etc...) for the user to keep track of what data is in each window. If you need more help, I can put together a simple example. Let me know...

Mike...

Message Edited by mikeporter on 09-10-2005 08:26 AM


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 15
(5,608 Views)
Thanks for the "Slider.vi". It was close to what I needed but:
1. I wanted to put an image of the test article at the center of the screen with the indicators surrounding the image and indicate the location of the strain gauge with an arrow. The uniform layout of the indicators fills the screen and doesn't seem to allow me to move the indicators to where I want to. I've not found a solution to this yet.
2. Any processing of the data (range check, setting +/- scale bounds, conversion from strain to stress) can't be wired into the solution your came up with. I tried but the only things I could place into the cluster were the indicators. All the wiring was ignored as were all the non-indicator items. I might be able to wire a non-display subVi to create the data I need but I've not tried this yet.

What I was hoping to be able to do was create a display & calculation "object" (like I've done in Java) and place instances of the objects where I wanted to and feed them the data I wanted to display.

I've only been using LabView for about a 1 1/2 weeks so there is still a lot for me to learn about how to do things the LabView way.

Thanks for the help.

0 Kudos
Message 5 of 15
(5,752 Views)
No I don't want a dialog box-like display. Something like what "Dynamik" sent is like what I'm looking for except that I wanted a picture of the test article at the center of the screen with the indicators all around with arrows pointing to the location of each sensor. The goal is to create a easy to view real-time display of the stress on the test article while saving the data to a file for later analysis.

A picture of the subVi I wanted to duplicate for each strain gauge can be seen in the "FrontPanel-BlockDiagram.gif" file attached to this message.

What I was hoping to be able to do was create a display & calculation "object" (like I've done in Java for a non-LabView project) and place instances of the objects where I wanted to and feed them the data I wanted to display.

I've only been using LabView for about a 1 1/2 weeks so there is still a lot for me to learn about how to do things the LabView way. That said, I just didn't know how to make use of the instructions you sent me. I couldn't find the "Open VI Reference" to begin the sequence you sent me. Since I only want a single window with all my indicators I'm not even sure I can use your instructions. When you state:

              One thing is to be sure to provide some way (label, window title, etc...) for the user to keep track of what data is in each window.

It leads me to think your method will create 20 (or however many) indicator windows.

0 Kudos
Message 6 of 15
(5,551 Views)

Hi JoeSz,

      I think you're doing GREAT, for only having used LabVIEW for 1+ weeks.  Have you programmed in any other language?

See attached Slider2.vi - perhaps it's closer to what you need(?)

Note, all the slider controls are inside a cluster, and they're processed as an array.  You don't have to do it this way.  The alarm limits are also housed in an array.  While the VI changes one of the "Thermometer"'s scale via its property node, the other Thermometer scales are changed through a reference to the control - which eliminates the need for 8 seperate property nodes on the diagram.  However, you should use the seperate-property-nodes method.  The reference method makes a lot of assumptions about the individual clusters and their contents.

Did you plan to use multiple pictures for your multiple DUTs?

Cheers

When they give imbeciles handicap-parking, I won't have so far to walk!
Message 7 of 15
(5,740 Views)

P.S.!!!

If, as it seems, you will have multiple - identical - clusters ( grouping the slider control & two alarm LEDs ) then consider making that cluster a "type-def".  Otherwise, you may find yourself devoting a lot of time to the formatting & cutomization of (20?) individual cluster controls.  Oh yeah, you mentioned "Arrows" to identify the strain gauge selected/applicable?  This is certainly doable, but I'm GUI-challenged.  Try posting it as a seperate question (like "how can I make 'arrows' - pointing to controls - appear/dissappear on the Front Panel?".

Cheers

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 8 of 15
(5,730 Views)

Dynamik,

Thanks for "Slider2.vi" it was quite informative! It's taken me a while to get back to working on my VI.

I tried to create a modified version of "slider2.vi" so I would understand what you had done (I still don't understand everything) as well as creating the vi I needed for my testing. I succeeded except for being able to display the information on the front panel. For some reason I create a cluster with 20 clusters within it each of them containing a slider (with a multi-colored scale) and hi/lo out of bounds indicators. I used "Cluster to Array" so I could use "Bundle by Name" within a "For Loop" to set the values. The problem comes when I attempt to take the array information and apply "Array to Cluster." The resulting cluster only has 9 elements. What happened to the other 11 elements? The "Help" has not been very helpful. With the broken wire deleted, I've inserted an indicator for the "For Loop" index and a "Wait" to slow down the loop so I can follow the values. The index goes from 0 to 19 as expected.

I'm at a loss as to how to proceed. I've attached my "Test-problem.vi" to this message. Is there something fundamental I've missed? Where is the problem?

 Thanks


To answer your question: I've been programming for 25+ years, Everything from assembly language, to procedural languages (FORTRAN, PL/I, PASCAL, C), to object oriented languages (Java), to scripting languages (C Shell, Perl).

Message Edited by JoeSz on 10-05-2005 06:17 PM

Message 9 of 15
(5,668 Views)
Hi JoeSz:
I haven't looked at anything else you have doen, but one thing I do know you haven't done.  It may seem stupid, but the "Array to Cluster" VI doesn't know how big your array is.  The default is to have the cluster have 9 elements, which is what you got.  You need to right-click on that node and select how many elements of your array will become cluster parts.  That should get you closer to what you expected.
Bart

Message 10 of 15
(5,651 Views)