11-19-2008 04:00 PM
Ok, Now I understand that the real problem is that the attach datasocket method or the shared variable binding do not work
with vi's that are in a project. If my vi is standalone then I can programmatically bind to either datasocket or
NSV. Perhaps there is some secret URL neeed. I know it is possible since the Front Panel Binding Mass Configuration Utility seems to be able to do the job.
11-20-2008 08:54 AM
Problem Solved! Thanks to everyone who responded. It seems that my last issue was the result of trying to run my binding vi outside of the project that contained the HMI vi that I was trying to perfom the binding on. When I
included the binding utility in the same project everything worked as advertised.
11-20-2008 11:06 AM
sachsm wrote:Problem Solved! Thanks to everyone who responded. It seems that my last issue was the result of trying to run my binding vi outside of the project that contained the HMI vi that I was trying to perfom the binding on. When I
included the binding utility in the same project everything worked as advertised.
I'm not sure what was going wrong in your case.
In general, binding of front panel controls, either while the VI is running (if the control/indicator is already bound to the same type of connection) or remotely from another VI should work both inside and outside of a project. Also you can have the VI with the front panel control inside the project and the VI doing the binding outside.
For direct binding to the Shared Variable Engine using PSP I found that the following path works well across the board
\\lumpy5\SVLib\Variable1
lumpy5 is the name of the computer on the network. To programmatically change a PSP binding use the Data Binding>Path property.
If you use DataSocket to bind the control to the shared variable the URL is
psp:\\lumpy5\SVLib\Variable1
To programmatically change a DataSocket binding use the DataSocket>URL property.
In either case if you want to change the binding of a front panel control while the VI is running, the control must already be bound to a shared variable using the same binding type (either PSP or DataSocket) as you are attempting to reassign.
If you want to bind a front panel control which is currently unbound, the VI with the front panel control must be in edit mode (not running). Then you can either interactively make the binding using the dialog window, or you can use another VI to programmatically create the binding in the non-running VI. To programmaticaly make the binding it is easiest to use either the DataBinding>Bind to Network Path method for PSP or the AttachDataSocket method for DataSocket.
I have attached my test VIs and project for reference.
12-03-2008 11:05 AM
sachsm wrote:It appears that Programmatic binding of Front Panel Controls do not work when they are located on a tab control.
Is this a known issue in LV 8.6?
I am running LV 7.1, and am having a similar issue.
More specifically, when I open a reference to a vi and get the control text labels it skips over any controls within a tab structure,
so I can't even get a reference to a control in a tab, to attempt to bind to it.
See the attached image - maybe there's another way to go about getting the refs?
Thanks!
12-03-2008 11:18 AM
12-05-2008 04:18 PM
Thanks for the tip - I'm running LV 7.1, so I wasn't able to access your examples.
However, I was able to get it working. I am referencing a tab control from an external vi, so I had to pull out the tab control reference from the array of all refs and cast it to a tab reference - which worked.
I was then able to pull out the refs of the controls on the tab control.