Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
1 ratings:
 5 out of 5   

Automatically Creating and Binding Shared Variables to OPC Items



Primary Software:
Primary Software Version: 8.5.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
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?

Solution:
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:
  1. Create a new library in your project explorer by right-clicking on My Computer and selecting New » Library.
  2. Right-click on the newly created library and select Create Bound Variables... from the shortcut menu.
  3. 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.

  4. Once you have all of the OPC items selected, click the Add» button to move them over to the Added variables box.
  5. When you are finished adding the OPC Items, click on OK to close the dialog box.
  6. LabVIEW will create the bound shared variables and then bring up the Multiple Variable Editor dialog box.
  7. You can use the Multiple Variable Editor to change the names of your newly created shared variables as well as other properties.
  8. Click Done in the Multiple Variable Editor.


Related Links:
KnowledgeBase DIRECT-45GPMH: How Do I Use OPC in LabVIEW
Product Manuals: Batch Variable Creation Dialog Box

Attachments:





Report Date: 09/04/2008
Last Updated: 01/07/2009
Document ID: 4P396DKG

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit