|| 5 out of 5
Automatically Creating and Binding Shared Variables to OPC Items
Primary Software Version:
Primary Software Fixed Version:
I have a large number of OPC Items that I would like to access in LabVIEW. I have created an OPC client in my project explorer using the LabVIEW DSC module (see the Related Links for more information), but now I want to bind shared variables to these items. I know that I can manually create and bind each individual shared variable, but is there a way that I can automatically create and bind shared variables for each OPC item?
Yes there is the option for a library in a LabVIEW project to automatically create and bind shared variables to all of the OPC Items that you select. Below is the process to accomplish this:
Related Links: KnowledgeBase DIRECT-45GPMH: How Do I Use OPC in LabVIEWProduct Manuals: Batch Variable Creation Dialog Box
- Create a new library in your project explorer by right-clicking on My Computer and selecting New » Library.
- Right-click on the newly created library and select Create Bound Variables... from the shortcut menu.
- In the dialog box that appears, browse to the OPC Client that you have created in your project and select the OPC items that you want to bind to a new shared variable.
Note: To select multiple OPC items at once you can hold down shift to select a grouping or control if you would like individual items as you click the desired items.
- Once you have all of the OPC items selected, click the Add» button to move them over to the Added variables box.
- When you are finished adding the OPC Items, click on OK to close the dialog box.
- LabVIEW will create the bound shared variables and then bring up the Multiple Variable Editor dialog box.
- You can use the Multiple Variable Editor to change the names of your newly created shared variables as well as other properties.
- Click Done in the Multiple Variable Editor.