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

Issue writing to LAVs #455

Open
michael-senva opened this issue May 31, 2024 · 3 comments
Open

Issue writing to LAVs #455

michael-senva opened this issue May 31, 2024 · 3 comments

Comments

@michael-senva
Copy link

michael-senva commented May 31, 2024

I'm having some trouble writing to an LAV. I am able to read out a value correctly but get hit with an 'Invalid Constructor Datatype' error when attempting to write the value back.

Here's a snippet to illustrate what I mean:

import BAC0
network = BAC0.connect()
network.read('X.X.X.X largeAnalogValue 1 presentValue')
>>> 0.0
network.write('X.X.X.X largeAnalogValue 1 presentValue 0.0 - 1')
>>> Error (Invalid Constructor Datatype)

I've dug through the library/docs, and it looks like it's expecting the Double object type where the error is raised.

Am I querying correctly? Any recommendations on getting it working?

I've read a bit about creating custom constructors but hit a wall with getting that working. Any help or direction is appreciated! :)

@michael-senva michael-senva changed the title Issues writing to LAVs Issue writing to LAVs May 31, 2024
@bbartling
Copy link

i dont think i have ever heard of a LAV? Large Analog Value? Is that in the BACnet spec?

@michael-senva
Copy link
Author

michael-senva commented Jul 2, 2024

Large Analog Value, that's correct. It's effectively BACnet's Double type. BAC0 doesn't have trouble with reads, but it doesn't appear to detect a written double and throws an incorrect data type error. I've tried a variety of permutations without success.

It looks like bacpypes supports the Double type under the hood, so the solution may just be creating a new class to handle it (similar to this one for writing text with spaces), but no success so far- I don't have much experience in how Python class structures work, so it may be a fairly straightforward fix I'm just not seeing.

@bbartling
Copy link

Gosh interesting, i have yet to run across a Large Analog Value in the wild.

What does your code look like so far? I am fairly handy in bacpypes too.

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