LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subpanel feature; how to read the value of an indicator

Hi everybody,
 
I need to write a software which does roughly the following. I need to acquire the read data from threee channels of an oscilloscope and then make a 3D plot of the data and possibly take some other actions.
I already have a program which performs the acquisition. SInce this program takes care of all the settings of an oscilloscope, it has a control panel which is rather complex. Ideally I would like to use it as a subpanel of another VI, so I do not have to wire all the controls again. I managed to write this as a subpanel, following the examples shown in Labview 8.
But I need to do two other things still:
1)I would need to be able to control when the oscilloscope VI runs (so something similar to the run button of the control panel
2)I would have, after the program run, to be able to read the data, which is an indicator in the oscilloscope VI
I would greatly appreciate any hints of this
 
Thank you,
Adrian
0 Kudos
Message 1 of 7
(3,978 Views)
You could insert it by reference in the subpanel, and then just drop the VI in where you want to run it.  However, that will give your user a view of the non-running VI if you do it too early.
 
edit - Actually, after more thought, the only feasible way to make that work properly would be to remove all user interaction while the SubVI is running, and just have them set the values before you actually call the SubVI.


Message Edited by JeffOverton on 03-03-2008 10:11 AM
0 Kudos
Message 2 of 7
(3,958 Views)

Hi JeffOverton,

Thank you for your reply.

Unfortunately - I do not understand very well what you mean. I am very new to this part of LabView, could you please send me more explanation, or refer me to some existing example?

 

Adrian

Message 3 of 7
(3,946 Views)

When you insert a VI reference into a subpanel, it displays the front panel of the VI whether it's running or not.  So one option would be to insert the VI in the subpanel, have the user enter the control values while the subvi is not running, and then drop the actual vi into the block diagram to run it.

Another, and better, option would be to put all your indicator values into an Action Engine (http://forums.ni.com/ni/board/message?board.id=170&thread.id=240328&view=by_date_ascending&page=1) at the end of the subvi, and then call the action engine again in your main vi to read the data.



Message Edited by JeffOverton on 03-03-2008 10:53 AM
Message 4 of 7
(3,939 Views)

I have to second Jeff's suggestion to turn your sb-VI into an action engine.

One action could be "Set-up" where you show the FP of the sub-VI and allow the user to interact with same. When this action terminates it should first save the users setting in shift registers so they can be used on latter calls.

Another action would be "Grab-data" that again invokes the Action Engine but uses the previously specified settings and returns the acquired data to the caller.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 7
(3,932 Views)
You may also want to read up on State Machines in order to fully understand Ben's post and the difference between Action Engines and LV2 Globals.
0 Kudos
Message 6 of 7
(3,922 Views)

Thanks guys for your suggestions.

Finally I managed to get it working in the following way:

1)I create a VI reference and use "Insert VI"

2)then I have a loop which waits for a button to be pressed; before pressing the button I can change the FP of my data acquisition subVI; once the button is pressed the subVI is running

3)after having run the subVI, I read a global variable which is written by subVI

So I have more or less what I wanted, though the solution with the global variable written by the subVI is not that elegant. I will try to look into your suggestions.

I have also trid to use the "Find control by name" VI in LV8 to obtain a reference which afterwards can be used to read the value of the indicator that I am interested in. But then I obtain a "Value", I can see that it makes sense when I wire an indicator to it, but it seems impossible to convert to something useful (in my case an array of DBL).

0 Kudos
Message 7 of 7
(3,910 Views)