LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 42 Network Stream Write Using XNet Database

Attached is an example of a bug in the Network Streams API.  Run the Host, then run the Client.  On the host you should see the error out populate with error 42 on the Write Single Element.  On the block diagram of the host you can change the disabled diagram structure to the other case and run both Client and Host and it works as expected.  When it doesn't work it is because we are taking the XNet Database constant and putting it into a variant, which we then try to send on the Network Stream. 

 

The simple work around is to use the concatenate to string on the XNet Database, and just send the data as a string.  But my real annoyance is with the use of the error code 42 "Generic Error" when the API could be more verbose and say something like "The datatype being sent is not compatible".

 

LabVIEW 2018 SP1 f4 32-bit, Windows 7 x64.

Message 1 of 5
(2,851 Views)

Just tested in LabVIEW 2020, XNet 20.0 and this bug still exists.  NI can I get a CAR for this?

0 Kudos
Message 2 of 5
(2,446 Views)

I too just ran into this one. LabVIEW 2020 SP1 f1, XNET 21.0.1

 

Thanks for sharing the workaround!

0 Kudos
Message 3 of 5
(1,658 Views)

3 year later and this bug still remains.  I reported it in the LabVIEW 2022 beta, but I just tested it in LabVIEW 2022 Q3 32-bit, 22.3.1f8, with XNet 22.5 and the behavior is the same.  A non descript "Generic Error", instead of just working, or giving an appropriate error.

0 Kudos
Message 4 of 5
(1,437 Views)

I still have this error with Labview 2023 Q1 and Xnet 2023 Q1.

0 Kudos
Message 5 of 5
(856 Views)