ela-compil / BACnet

BACnet protocol library for .NET :satellite:
https://www.nuget.org/packages/bacnet/
MIT License
215 stars 95 forks source link

WriteScalarValue issue #45

Closed sjpkt closed 5 years ago

sjpkt commented 5 years ago

I got an exception unhandled when I was trying to write a value to multi-state-value. It say "System.Exception: 'Error from device: ERROR_CLASS_PROPERTY - ERROR_CODE_INVALID_DATA_TYPE'" Here is my code. uint bacnetinstaid = Convert.ToUInt32(changemode.Bacnet_Instance_ID); int bacnetid = Convert.ToInt32(changemode.Bacnet_Instance_ID); WriteScalarValue(deviceid, new BacnetObjectId(BacnetObjectTypes.OBJECT_MULTI_STATE_VALUE, bacnetinstaid), BacnetPropertyIds.PROP_PRESENT_VALUE,new BacnetValue(2) ); What am I doing wrong here? also what does invalid data type mean?