LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get a subvi to show continuous reading?

Hi, I'm not sure if this is the right board but here goes. I'm taking readings from a tachometer via USB - 6009, i can get the program to display the results fine the problem is when I transform this to a subvi. I want to put all this into a subvi so I can use that program but only displaying the indicator. When I run the program the result displayed id the final result before the program is stopped. Is there a way I get the indicator from the subvi to continuously display the results?

Thanks
Kyle
0 Kudos
Message 1 of 14
(4,119 Views)
Hi Kyle

Use a control reference.

In you main vi you create a reference of the indicator. Wire this reference to the subvi. In the subvi, wire the control-reference to a property node. There you can write the value-property and the indicator in the main vi is updated, everytime you write a new value to the property node.

Hope this helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 14
(4,115 Views)
Thomas, Thanks for your reply. I'm having some trouble implementing your suggestion. I put the property node into the program that makes up the subvi, correct? I'm then having trouble defining these terminals as inputs to the subvi to connect the control reference to. is this all there is to do or hav i to connect the output from to the property node as well? I can show you the program I'm working on if that is of any help. tit'll only work if DAQmx Base is installed.

Thanks,
Kyle
0 Kudos
Message 3 of 14
(4,099 Views)
Hi Kyle

There are several possibilities to make it work.

A simple solution was the following (if just small code):
In you main-vi, create a property-node of your indicator. Build the whole logic to ste the value around this property-node. Then select this logic an create a sub-vi (menu >> edit >> create subvi).


Another solution (the one I prefer) is the following:
Create a vi, which will be your sub-vi. There place a refnum-control (palette >> controls >> refnum). Right-click on it an select "Select VI Server-class" to define the type of control you want the reference to represent. Then on the diagram place a property-node (palette >> functions >> application control). Wire the refnum-control to this property node. Now you have to link the frontpanel refnum-control to the connector, to make it available in any calling vi.

I attach you a very simple example, so that you can see how it should look like.

Hope it helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 14
(4,099 Views)
Sorry

Late in the afternoon my brain switches to standby.

Here's the attachment...

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 5 of 14
(4,075 Views)
Thomas, thanks very much worked a treat!!

kyle
0 Kudos
Message 6 of 14
(4,061 Views)
I'm having the same problem again, I'm trying to ouput a voltage and be able to change it from a control knob in a subvi. the program is only outputing the voltage setting the knob is at before as the program starts. I tried using the property node again changing the "property" part to value and wiring it to the wire from the control knob. Is this where I'm going wrong? Again your help would be brilliant.

Kyle
0 Kudos
Message 7 of 14
(4,030 Views)
Hi Kyle

As you described it, you wired the value of your control to the property node, which is wrong.
Right-click the control, select Create >> Reference. Wire this reference to the property node.

If it still doesn't work, it would be helpful to see your vis.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 14
(4,029 Views)
I think that's what I was doing, I've attached the programs so maybe you can see where I'm going wrong.

Thanks
Kyle
0 Kudos
Message 9 of 14
(4,022 Views)
Could you attach them as LV 7.0?

(Save with opions >> save for previous).

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 10 of 14
(4,021 Views)