03-17-2011 02:41 PM
I've had network streams working great (love them!!) for a while with a type def cluster of some numerics and strings. I've changed the type def numerous times and haven't had a problem. The last time I changed it, however, I started getting this error from the "Write Single Element to Stream" primitive.
"LabVIEW: Unable to read or write the stream endpoint with the specified data type. The data type isn't compatible with the data type used to create the stream."
I don't get an error when I initialize the stream with "Create Network Stream Writer Endpoint". Yes, the same datatype is being passed to both primitives. It's the same code that has worked hundreds of times until now.
My best guess is that the Network Streams Engine is somehow caching the old datatype. I've restarted both the local and remote (LV RT) computers multiple times, to no avail.
Maybe this is a red herring, but I'm using LV 2010 SP1 with LV RT 2010 (no SP1). The computer is in another state and not easily upgraded, but I'm working on that as a possible solution. I doubt that's the problem, however, since it has worked up till now.
What would cause me to get this error even though I'm using the same type def for both the initialize and write?
Solved! Go to Solution.
03-21-2011 06:57 AM
Hi Robert,
It very well might be that the Network Stream is somehow still registering the old data type. If this is the case, try deleting the Create Network Stream, the Write Single Element, and one of the type defs. Then, place down a new Create Network Stream and Write Single Element, and ensure that it's a copy of the type def. that you're wiring for both the initialization and the write. If replacing the Network Stream VIs fails to do the trick, I'd like to see if I can't replicate the error your getting on my end. To replicate your setup, can you tell me the data type of your type def.?
On a final note, I searched through the 'Known Issues' for LabVIEW 2010 and 2010 SP1, and found that there is a known issue which might help explain the error you're receiving:
233205 | — | Network Streams do not support enums, data types w/ units, substrings, subarrays, & fixed-size array... |
03-21-2011 11:06 AM
I tracked the problem down to a property node. I am using a property node to query the connection status. When I updated the type def going into the initialize and into the write, the Network Stream reference coming out of the initialize updated as well. The reference going into the property node updated, but the reference coming out did not. The reference coming out of the property node had somehow cached the old data type, and was passing this info into the write, which was then causing the error. Deleting and recreating the property node fixed the problem.
Thanks,
Robert