NubeIO / driver-bacnet

0 stars 2 forks source link

Write vaue to BI and AI not working #15

Closed NubeDev closed 2 years ago

shomaglasang commented 2 years ago

@NubeDev mate the current implementation is you can only write to PROP_PRESENT_VALUE of AI if the value of PROP_OUT_OF_SERVICE is true (or 1). Like this sequence of commands:

$./bin/bacrp 1234 0 0 81 
FALSE

$./bin/bacwp 1234 0 0 81 0 -1 1 1

$./bin/bacrp 1234 0 0 81
TRUE

$./bin/bacwp 1234 0 0 85 0 -1 4 101.22

$./bin/bacrp 1234 0 0 85
101.220000

But for BI, you can write to PROP_PRESENT_VALUE anytime.

$./bin/bacrp 1234 3 0 81
FALSE

$./bin/bacwp 1234 3 0 85 0 -1 9 1

$./bin/bacrp 1234 3 0 85
active

$./bin/bacwp 1234 3 0 85 0 -1 9 0

$./bin/bacrp 1234 3 0 85
inactive

I am not sure if this is how it should be implemented. But the existing code behaves this way. Please let me know if we will change this.

shomaglasang commented 2 years ago

@NubeDev I removed the checking for out_of_service when updating AI present_value.

$./bin/bacrp 1234 0 1 81
FALSE

$./bin/bacwp 1234 0 1 85 0 -1 4 101.50
WriteProperty Acknowledged!

$./bin/bacrp 1234 0 1 85
101.500000