LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC DataSocket error 42 in writing negative values

I was playing around with OPC and using the DataSocket pallete. Although I've used it reliably for a while and am content, I was baffled by one error. I was hoping someone could explain why this error occurs or how to solve it.

In the NI Distributed System Manager I've created an Shared Variable of the type single, with Read/Write access.

 

Problem

When writing a value less or equal to 0 to an OPC URL, I get an error 42. When using the equivalent PSP URL, I don't get it.

 

Using this VI snippet code.

opc.png

 

I get these paths and errors:

 

opc FP.png

 

This error 42 comes for all values below zero and for zero. For all positive values I don't get this error. What's the reason for this behaviour? In my humble opinion this is not wanted behaviour, as OPC tags should accept the whole value range of the single.

0 Kudos
Message 1 of 6
(3,373 Views)

I didn't mention it well enough, but this is true for Single-precision floating-point number (SGL). When selecting in the NI Distributed System Manager the value of the type Double-precision floating-point number (DBL), I don't get this error. However, most clients are storing values in the type SGL instead of DBL, so therefor this data type was selected.

0 Kudos
Message 2 of 6
(3,369 Views)

So is it a feature or a bug?

0 Kudos
Message 3 of 6
(3,327 Views)

I was still hoping someone would respond.


For all details, I'm using LV2013 SP1 32-bit, NI Distributed System Manager 2013.

 

The interesting thing is that for the above example I was using the method ReadWrite and would create the Error 42. However, when I'm using the method Write, it won't create any error, but any negative value is simple not written to the Shared Variable ...

opc-2.png

0 Kudos
Message 4 of 6
(3,271 Views)

Hello,

 

I think that the problem is that you have "space" in the OPC URL. -> opc://localhost/National Instruments......

 

Can you try to put the variable to different URL (without spaces) and see if it works? Here is some useful info for DSC: 

 

http://www.ni.com/pdf/manuals/372946d.pdf


Check it out and let me know if this solves your issue.

 

Best,

 

Bozhidar

0 Kudos
Message 5 of 6
(3,214 Views)

White spaces are allowed in OPC URLs, so that cannot be the issue.

 

I've tested with another LV2013 computer and NI Distributed System Manager 2013 and got the same errors. However, when I tested it on a LV2012 and NI DSM 2012 it was all working. Quite strange.

Now I'm wondering if it's something local or that the bug was introduced in the 2013 distribution and if it has been solved in the 2014 version ...

 

Could someone test it on LV2013 and/or LV2014, just to check if the problem occurs for other installations in LV2013 and if the problem has been solved in LV2014? Please indicate LV version and DSM version.

0 Kudos
Message 6 of 6
(3,158 Views)