Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BACnet error:invalid data-type #81

Open
Pandacli opened this issue Apr 10, 2023 · 4 comments
Open

BACnet error:invalid data-type #81

Pandacli opened this issue Apr 10, 2023 · 4 comments

Comments

@Pandacli
Copy link

Hi,all . I use writePropertyRequest to write a new presentValue , but unfortunately it response a wrong code

invalid data-type. could you give us any advise? thanks

there is my code
` WritePropertyRequest writePropertyRequest = new WritePropertyRequest(
objectList.get(i),
PropertyIdentifier.presentValue,
null, new Real(setVal), new UnsignedInteger(BaConfig.priority));
ObjectType objectType = writePropertyRequest.getObjectIdentifier().getObjectType();
ServiceFuture send = localDevice.send(remoteDevice, writePropertyRequest);

            ReadPropertyAck ack = localDevice.send(remoteDevice, writePropertyRequest)
                    .get();`

【project details 】
setValue = 1;
priority is 9 ;

Device detail like this
image

@kishorevenki
Copy link

HI,
Based on your above information, I noticed couple of points:

  1. Since the Present_Value is not of array datatype, this value can be omitted. Mentioning Null is not correct.
  2. Since the Object Type is Binary Value, the datatype of PV is not Real, but BinaryPV. Hence the value can be new BinaryPV(1).

Regards,
Kishore

@Pandacli
Copy link
Author

Hi Kishore ,thanks for your advise
and we fix it to change the BinaryPV ,not a Real.

HI, Based on your above information, I noticed couple of points:

  1. Since the Present_Value is not of array datatype, this value can be omitted. Mentioning Null is not correct.
  2. Since the Object Type is Binary Value, the datatype of PV is not Real, but BinaryPV. Hence the value can be new BinaryPV(1).

Regards, Kishore

@kishorevenki
Copy link

Hope you will remove Null field as well.

WritePropertyRequest writePropertyRequest = new WritePropertyRequest(
objectList.get(i),
PropertyIdentifier.presentValue,
new BinaryPV(setVal), new UnsignedInteger(BaConfig.priority));

@Pandacli
Copy link
Author

Hope you will remove Null field as well.

WritePropertyRequest writePropertyRequest = new WritePropertyRequest( objectList.get(i), PropertyIdentifier.presentValue, new BinaryPV(setVal), new UnsignedInteger(BaConfig.priority));

Yes,it work . I should use BinaryPV.active to control Bacnet device . thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants