Closed pranny closed 6 years ago
To reproduce the issue it is required to setup the environment with your OPC server.
TitaniumAS.Opc.Client.Interop.Helpers.TypeConverter.FromVarEnum does conversation from Variant enumeration to .Net type. It seems that it converts the value to the TitaniumAS.Opc.Client.Common.IllegalType type. You can set breakpoint in the function and check what values are converted to IllegalType.
I think that the workaround is can be to extend OpcDaItem with CanonicalDataTypeRaw RequestedDataTypeRaw property and store the values without conversation. We can merge pull request if someone implements it.
Hi,
I am looking for the correct way to get Canonical Data Type for tags. I have tried a few approaches but none of them work across all the OPC Server scenarios that I am testing against:
Approach 1) Using Group
This prints
Random.Int4....System.Int32
,Random.Real4....System.Single
on Matrikon OPC Simulator. What I am really looking for is the OPC Data Type like VT_R4 or the OPC Data ID like 4,3 etc. This seems to be happening because of https://github.com/titanium-as/TitaniumAS.Opc.Client/blob/06584d25ca3c3d538c518f24597af88e90c16159/TitaniumAS.Opc.Client/Da/OpcDaItem.cs#L39 but I am not sure how to get it back to the original form.Approach 2) Using browse to get the item properties
This does seem to work on Matrikon Simulator and one more, but on another system it throws garbage values like
I confirmed by using OpenOPC that the CDT values are set and OpenOPC shows them correctly. I am not sure why I get this error on a particular machine only. It's been on my head for more than a week now. Any idea what should I try or what am I missing here.