SoftingIndustrial / OPC-Classic-SDK

Softing OPC Classic SDK
https://industrial.softing.com/de/produkte/opc-ua-und-opc-classic-sdks.html
MIT License
53 stars 22 forks source link

VT_BOOL True is represented as 0xFFFF #17

Open kusmmat opened 1 year ago

kusmmat commented 1 year ago

Hello. We are trying to integrate to an older system that is also using Softing OPC Classic libraries (years 1998-2000). This existing system is for some reason exchanging Bool data types in OPC representing True as 0x0001.

Now, we are using current Softing OPC Classic library, and it represents Bool True as 0xFFFF. Reading through Opc foundation and Microsoft documents, it looks like that is correct representation, it is no mistake:

VARIANT_BOOL A 16-bit Boolean value. A value of 0xFFFF (all bits 1) indicates true; a value of 0 (all bits 0) indicates false. 
No other values are valid.

I have also found that there was something like OBSOLETE__VARIANT_BOOL, but I don't know how to use that in Softing Library.

But we have to integrate to this existing system that expects datatype VT_BOOL, and True represented as 0x0001 (or 1). How to achieve that in Softing OPC Classic Library (C#)?

Thank you. Regards Mateusz.