I’m getting from a PLC a 32bit decimal entry, for more details 2013265974. That is stored in influx. I need to get different bit’s to know if an alarm is enabled or no.
Decimal to binary logic is explained in this webpage:
In 2,0 there doesn’t appear to be any bitwise operators in the flux language.
In the older sql-style query language there is something you might be able to use:
This older query language is still available via the rest interface too in 2.0
If you get it working, we’d greatly appreciate it if you posted a reply here on this thread outlining in brief what the raw data looks like, and what your final queries ended up as.
I was also interested in the question and I also did not find any bitwise operators in the documentation…
I cannot believe it…
I could think of a few workarounds.
You could convert the integer input into bytes with the bytes() function.
Bit 8 is the first bit of the second byte.
So you could treat the second byte with modulo % 2.
If the result is 1, bit 8 is set.
If the result is 0, bit 8 is not set.
It’s rather complicated, but you should be able to do it roughly.