Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 4 out of 5     Rate this Document

How Can I Prevent DataSocket from Resetting Value to Zero When a Write Connection Is Made?

Primary Software: LabWindows/CVI Development Systems>>Full Development System
Primary Software Version: 5.5
Primary Software Fixed Version: N/A
Secondary Software: Other NI Software>>DataSocket

Problem: When connecting to a DataSocket or OPC Server in Write mode, the first value written to the server is always zero. How can I make it so that DataSocket does not initialize the value when the connection to the server is made?

Solution: When calling the DS_Open function to open a connection for a specified tag, the second parameter represents the access mode. This is a bit-oriented parameter, so each bit is interpreted separately. If bit number 6 is set, DataSocket won't change the tag value. To set this bit, add 64 to the parameter value.

For example: hr = DS_Open ("opc:/Server1/Item1", DSConst_Write | 64, NULL, NULL, &opcHandle);

Related Links: KnowledgeBase 1TB9LPWV: How Do I Set an Initial Value for a DataSocket/OPC Connection in LabVIEW?

Attachments:





Report Date: 07/18/2000
Last Updated: 05/28/2004
Document ID: 1ZHCF7J6

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