Previous Value Returned by Shared Variable

Updated May 9, 2018

Reported In

Software

  • LabVIEW

Issue Details

I am writing to a Network Public Shared Variable (NPSV) and immediately reading back the value. Even when using the Flush Shared Variable Data VI, the value returned by the NPSV always returns the previously written value. Thus, I need to run my code twice to receive the latest value. Why does this occur, and what can I do to avoid it? 

Solution

Even though the Flush Shared Variable Data VI flushes the data buffer so that the data is sent over the network immediately, there is still finite delay between when the data is written and when it is available for reading. Thus, when the variable is read immediately after being written, there is a chance that the read can occur prior to the data value being updated. To avoid this, try one of the following:

WAS THIS ARTICLE HELPFUL?

Not Helpful