Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Why Can't I Read a Boolean Tag in the RSLinx OPC Server?

Primary Software: LabVIEW Development Systems>>LabVIEW Base Package
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I am accessing tags on an RSLinx OPC server with DataSockets or with front panel databinding in my LabVIEW VI.  I cannot read from a boolean tag, however I can write to it.  I can also read and write tags of any other data type.  What is the workaround for this?

Solution:
This problem occurs because RSLinx requires the OPC client to configure what data type each tag should be.  LabVIEW does not support this, so the read accesses the tag as if it were a double. 

There are two possible workarounds for this problem:

1)  Read the tag as a numeric type, and then convert it to a boolean:


2)  Use the attached XControl, which will allow you to bind to a numeric tag on the OPC server using front panel databinding, but will appear as a boolean control.

Related Links:
Developer Zone Tutorial: Connecting LabVIEW to an OPC Server Using Front Panel DataSocket

Attachments:
Numeric to Boolean XControl.zip




Report Date: 11/14/2008
Last Updated: 11/14/2008
Document ID: 4RDE7CRQ

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