LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Shared Variable Control" combo box on Front Panel is empty after Build

Hello;
 
I have a project using shared variables and the DSC module. I am working on building a .exe application now that the project seems to run well.
 
I have several places on the front panel where I have shared variable controls. These combo boxes allow the user to click the drop down button and browse the list of shared variables in the project, as well as "browse". When I run the VI from the project, the combo boxes fully populate with all of the deployed tags in the project (I have only one .lvlib in the project).
 
When I build the project and run the executable, the only item in the combo box list is the "browse..." selection. I can click on that and browse to my variables, but it is much more time consuming to do so than to simply select the desired variable from the drop down list.
 
So, how can I populate the list of shared variables from a particular library ino the Shared Variable Control combo box in a project build?
 
A couple of things I have done to try to esolve th problem are ensure that the "Enable Enhanced DSC Run-Time Support" box is checked in the advanced tab of the build window, added the appropriate .lvlib file to the "Dynamic VI's and SUpport Files" window under the "Source Files" tab of the build window, and properly deployed the tag library programmatically in the project.
 
Thanks,
Michael Hampson
Michael Hampson
President
XL Automation, Inc.
0 Kudos
Message 1 of 6
(7,401 Views)
Hi Michael,
What you see in the development environment is to make it easier for developers, and as far as I know, there's no way to automatically populate the shared variable control during run time in an executable.  The reason being that the shared variable control would have no way to know which process it should be using to get the variables from.  The attached vi demostrate how you can acquire the list of shared variables in a process.  You can also set the default values of the shared variable control by right clicking it on the front pannel, go to Data Operations->Make Current Value Default.  I can do some more research on this, but I'm about 95% sure that there's no way to convert the array of shared variables to populate the shared variable control, as the shared variable control is a special type of xControl.

Yi Y.
Applications Engineer
http://www.ni.com/support

Message Edited by Yi Y on 07-02-2007 01:27 AM

0 Kudos
Message 2 of 6
(7,207 Views)

OK, I thought that might be the case. I already use code similar to yours to get a list of shared variables that I use elsewhere in the program. Perhaps I can just populate generic combo boxes with this list and (if necessary) convert the result of the combo box to an SV from a string. I will try to do that. That might actually be convenient, because maybe I can strip the {Server\library\} prefix from the items in the viewable drop-down list to make viewing the variables easier.

Does the combo box control in LV have the ability to have multiple columns, so that I could put the trimmed down SV names in one column, but bind the control to another zero-width column containing the entire SV path\libraray\name nomenclature? I often do this in VB 6.0.

Michael

Michael Hampson
President
XL Automation, Inc.
0 Kudos
Message 3 of 6
(7,174 Views)
Hi Michael,

Combo boxes does not support multiple columns.  List Box allows you to have multiple columns, but it might be a little bit less inuitive to use List Box because it's basically an Enum, and you'll have to deal with property nodes.  I think the easiest way would be to concatenate a string programmatically to the string output of the combo box, then convert that to a SV.
Hope this helps!

Yi Y.
Applications Engineer
http://www.ni.com/support
0 Kudos
Message 4 of 6
(7,140 Views)

Yi,

Is there a way that I can programmatically get a list of shared variables from a REMOTE PC's deployed network shared variables? The "Get Shared Variable List" vi seems to only allow me to get a list of shared variables in a local host's (my own PC) process list. I need to do this to be able to populate the combo box above. The only solution I can imagine is to create another local "dummy" .lvlib library with all of the same variables as the remote PC's process, and then use the "Get Shared Variable List.vi" to obtain this list and then strip the path, i.e. \\localhost\library\, then att the appropriate remote path, i.e. \\RemotePC\Library, then convert back to tags. I don't want to deploy the same library on the slave machine(s) that is deployed on the host, because I don't want multiple PCs all banging on the FieldPoint devices at the same time. The object was to have the master PC polling the Fieldpoint and updating shared variables, and the slave PCs would just access the networked shared variables for read/write access to the Fieldpoint.

Let me know if there is an easier way.

Michael Hampson

Michael Hampson
President
XL Automation, Inc.
0 Kudos
Message 5 of 6
(7,057 Views)
Hi Michael,
That's a good question.  I know you can see the list of deployed variables at Tools->DSC Module->Monitor Variables.  I'm not sure if this is do-able programmatically.  The thing I can think of on top of my head is to run a remote VI on the target computer that gets the info and send it back.  I'll have to look more into this and see if there's a better option.

Yi Y.
Applications Engineer
http://www.ni.com/support
0 Kudos
Message 6 of 6
(7,043 Views)