LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVi Button Control

I am trying to use a sub VI as a control and it doesn't seem to be working. I tried it as a control and as a sub VI but do not know what is wrong. I think the buttons might need to be placed in a cluster.  Would you please help.

Thank you.

 

Download All
0 Kudos
Message 1 of 14
(4,382 Views)

You did not include your subVIs or typedefs. Please attach them too.


nicholas03 wrote:

I am trying to use a sub VI as a control and it doesn't seem to be working. I tried it as a control and as a sub VI but do not know what is wrong. I think the buttons might need to be placed in a cluster. 


 

 

I don't know what you mean by using the subVI "as a control". Can you elaborate?

Why do you think "cluster"? Makes no sense. I cannot follow your thought process here.

 

Is the subVI set to open FP when called? The Main VI will not be able to proceed until the subVI completes.

 

Is there a reason you did not continue this discussion in the original thread?

Message 2 of 14
(4,370 Views)
Sorry about that.
Download All
0 Kudos
Message 3 of 14
(4,361 Views)

I am working on an experiment to capture temperture.  I have the SubVi to tell what state each Thermocouple is in. Right now the buttons are manually switched but I want to be able for the temperture itself to switch them. For example, if TC1 were to start by pressing it, then once it reaches say 150 degrees F, it would change states. The three states are Waiting for Gel, Waiting for Peak and Idle. I think I need a Waiting to Stop so when the TC1 would reach its peak temp it would stop. The SubVi is just a control that is used to tell what case each thermocouple is in and where the buttons are located. If I am still not clear let me know.

Thank You.

0 Kudos
Message 4 of 14
(4,334 Views)

Currently, you are calling an interactive subVI without showing its front panel. This means that you cannot interact with it or ever return to the toplevel VI.

 

I think you still have some serious misconceptions about how dataflow works. What currently happens, is:

  1. You start the main VI, which reads its controls and feeds them to the subVI.
  2. The subVI starts running with the values it received from the subVI.
  3. The subVI waits for user interaction, but nothing can ever happen since the front panel is not shown. Even if you feed it a TRUE for stop, it still will still stall since the stop event never gets triggered.
  4. Nothing further happens. Control is never transferred back to the main VI.

As a start, you should right-click on the subVI icon in the main VI and select "subVI node setup". Select "open FP when called an close afterwards." (see image).

 

 

If you now run the main VI, the subVI opens and you can interact with it. Once you stop the subVI , the output is transferred to the connected indicators in the main VI. Still, this seems like a silly exercise. How exactly do you want this to operate from the perspective of the user?

Message Edited by altenbach on 01-18-2009 09:18 AM
Message 5 of 14
(4,323 Views)

I changed the controls connected to the SubVi to constant. This way the MainVi just shows the data not the buttons.  I still have to figure out how to synchronize the buttons with the temperature.  For example, if TC1 were to start by pressing it, then once it reaches say 150 degrees F, it would change states. The three states are Waiting for Gel, Waiting for Peak and Idle. I think I need a Waiting to Stop so when the TC1 would reach its peak temp it would stop.

This TC vi gathers temperature which I can use forcontroling the buttons.

0 Kudos
Message 6 of 14
(4,311 Views)

Here is a picture of configuring test #1.

I want to be able to configure each thermocouple with this test simultaneously and/or independently.  I think I need a consumer producer loop system but I am not sure.

Message Edited by nicholas03 on 01-18-2009 02:02 PM
0 Kudos
Message 7 of 14
(4,297 Views)

I tried to change the button's boolean text and it seems to work.  When I push the button the name goes to the next state.  This is good but now can I use this text to trigger something else?

 

 

Message Edited by nicholas03 on 01-19-2009 02:22 PM
Message Edited by nicholas03 on 01-19-2009 02:24 PM
0 Kudos
Message 8 of 14
(4,240 Views)

nicholas03 wrote:

Here is a picture of configuring test #1.


Well, you're jumping around between subVI issues, button labeling issues, and automation issues. It is a bit difficult to tell what you actually want. 🙂

 

In my early example posted here, I use the timeout case to update the clocks and do tests to decide if the current state should change automatically. This can easily be expanded to test for temperature drops, etc. have you tried? 😉

Message 9 of 14
(4,232 Views)
Sorry for jumping around.  I am trying to build an application that records temperature vs time and calculates time intervals and temperatures.  One test is shown in the diagram I posted above named Test 1.  There will be other tests and I will eventuall need to another Sub VI Button Control that has five states.  I trying to understand if the Buttons should be saved as VI's, Type Defs or Controls. Would it be better to show you a flow chart?
0 Kudos
Message 10 of 14
(4,207 Views)