05-12-2008 02:00 AM
05-13-2008 02:43 PM
Hi Steve,
It sounds like you are seeing the behavior discussed here. The first DataSocket Read returns the default value of 0. As you have seen, actual values from the OPC server are read after that. To avoid this, ignore the first value that is returned.
05-13-2008 04:56 PM
05-15-2008 06:57 AM
Hi Steve,
I tested two and three sequential DataSocket Reads with a URL pointing to NI OPC Server. The first read always returned a default 0. The remaining reads were dependent on "wait for updated value" and the timeout. In general, setting "wait for updated value" to false returned 0 with a quality of 0, although once or twice the value was actually correct. The same is true if the timeout period does not allow enough time for the value to update.
To ensure you are reading valid data, it is best to use one of the methods you mentioned.