OPC UA Client .net - write 'long' type error|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
OPC UA Client .net - write 'long' type error
Avatar
Andrea Carlini
New Member
Members
Forum Posts: 1
Member Since:
05/16/2017
sp_UserOfflineSmall Offline
1
06/15/2017 - 03:24
sp_Permalink sp_Print

Hi!

I'm writing a .net application based on opc UA base libraries. It manages read, write and subscriptions and it's almost working fine. I'm testing it with the opc foundation server and with a kepware opc ua server.

I have an error when trying to write a tag of type 'long' on the kepware server. The error i get says: BadTypeMismatch,0x80740000,The value supplied for the attribute is not of the same type as the attribute's value.

I'm the C# code i convert the long type to 'System.Int64' .net type. I guess it's the wrong one, but i can't find what's the correct .net data type i should use.

Thank you very much!
Andrea

Avatar
Guest
Guests
2
06/15/2017 - 23:19
sp_Permalink sp_Print

When writing to a Variable Value it is required to use the correct DataType. If you do not know it you should read the DataType Attribute prior to writing.

'long' is no UA DataType. I assume that it means Int32.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 14
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1353
Posts: 4589