-
Notifications
You must be signed in to change notification settings - Fork 96
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
Can readProperty but can't writeProperty #58
Comments
Hi @Panibrat Thanks for reporting an issue 👍 The error message is generated by node-bacstack itself if he is not able to encode a write-property telegram. The root cause for this issue is a breaking change, which is not yet available on NPM but already updated in the documentation (see 35a46ce). Could you therefore change your code as following and retry it: client.writeProperty('192.168.0.127', 2, 3000052, 85, 12, [
{tag: bacnet.enum.BacnetApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 77}
], function(err, value) { // NOTE: `type` changed to `tag`
console.log('writeProperty: ', value);
console.log('writePropertyError: ', err);
}); This issue/inconsistency should be solved in the upcoming Thanks! |
Now it works! :) |
The same issue with Binary Value:
Console:
Try to write:
Please advise! |
Hi @Panibrat The two exceptions If we compare the console output of your readProperty command ( client.writeProperty('192.168.0.222', 5, 11, 104, 12, [ {tag: bacnet.enum.BacnetApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: 0} ], function(err, value) { // NOTE: type changed to correct value
console.log('writeProperty: ', value);
if(err) { console.log('writePropertyError: ', err); }
}); This should then be accepted by your device. I will therefore close this issue, feel free to re-open it if something is still not working. Cheers |
Everything OK for now! |
Read function works fine:
Code:
client.readProperty('192.168.0.127', 2, 3000052, 85, null, function(err, value) {
console.log('readPropertyAV: ', value);
});
Console:
readPropertyAV: { len: 14,
objectId: { type: 2, instance: 3000052 },
property: { propertyIdentifier: 85, propertyArrayIndex: 4294967295 },
valueList: [ { len: 5, type: 4, value: 12.6 } ] }
But I can't write the same point:
Code:
client.writeProperty('192.168.0.127', 2, 3000052, 85, 12, [
{type: bacnet.enum.BacnetApplicationTags.BACNET_APPLICATION_TAG_REAL, value: 77}
], function(err, value) {
console.log('writeProperty: ', value);
console.log('writePropertyError: ', err);
});
Console:
D:\PANIBRAT\WEB-2\NodeJS\BACnet\test\node_modules\bacstack\lib\bacnet-asn1.js:496
throw 'Unknown type';
^
Unknown type
What wrong?
Any suggestions?
The text was updated successfully, but these errors were encountered: