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

Writing a Single Data Point To an Implicit Network Variable Causes Two Data Values to be Buffered

Primary Software: LabWindows/CVI Run-Time Engine
Primary Software Version: 8.5
Primary Software Fixed Version: N/A
Secondary Software: Measurement Studio>>.NET Support

Problem:
In LabWindows/CVI 8.5, writing a single data point to an implicit (i.e system) variable causes two data values to be buffered in a buffered subscriber. Why does this occur and is there anything I can do about it?

Solution:
This behavior is occurring because LogosXT causes an extra item with quality=NO_KNOWN_VALUE to be sent for implicit variables. You can avoid this behavior by using one of the following options:

Option 1

When reading from the buffer, check for data items with quality having the NO_KNOWN_VALUE flag and discard those items.

Option 2

Use explicit variable.

Option 3

Disable LogosXT; Refer to the Network Variable Performance topic in the LabWindows/CVI Help for instructions. This option is not recommended.

Note You will also see this behavior in the Measurement Studio Network Variable Library (version 8.1.2). An example code-snippet of implementing Option 1 when using the Measurement Studio Network Variable Library is shown below. There is also an attached project that contains this code as well.

NetworkVariableData readData = subscriber.ReadData();

// The first read is likely to have a quality of "No Known Value"
if (readData.HasQuality && readData.Quality == NetworkVariableDataQualities.NoKnownValue)
{
  // Pass over the value and accept the next value
  readData = subscriber.ReadData();
}


Related Links:

Attachments:


BufferedSubscriber.zip


Report Date: 08/28/2007
Last Updated: 11/20/2007
Document ID: 49OFK90S

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