Convert 2 byte to bits - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Convert 2 byte to bits (/showthread.php?tid=5402) |
Convert 2 byte to bits - Joep - 02.05.2024 From a Gira weatherstation i recieive an error code as a 2 byte value. Each bit represents an error code like below. Now i like to create a text object that shows the current state of this error object. So if there's one or more error it should show me all errors (in a loop by more then one error). Bit 0: Condensatiebeveiliging actief Bit 1: Droogfase van het sensoroppervlak Bit 2: Waarden van digitaal-analoogomzetter ongeldig Bit 3: Meetwaarde van druksensor ongeldig Bit 4: Meetwaarde van helderheidssensor noord ongeldig Bit 5: Meetwaarde helderheidssensor oost ongeldig Bit 6: Meetwaarde van helderheidssensor zuid ongeldig Bit 7: Meetwaarde van helderheidssensor west ongeldig Bit 8: Schemermeetwaarde ongeldig Bit 9: Meetwaarde van globale stralingssensor ongeldig Bit 10: Meetwaarde van luchttemperatuursensor ongeldig Bit 11: Meetwaarde van neerslagsensor ongeldig Bit 12: Meetwaarde van windsnelheidssensor ongeldig Bit 13: Meetwaarde van windrichtingsensor ongeldig Bit 14: Meetwaarde van de vochtmeting ongeldig Bit 15: Interne systeemfout RE: Convert 2 byte to bits - admin - 02.05.2024 See this: https://forum.logicmachine.net/showthread.php?tid=1081 RE: Convert 2 byte to bits - Joep - 02.05.2024 (02.05.2024, 07:46)admin Wrote: See this: https://forum.logicmachine.net/showthread.php?tid=1081 Thanks admin. So far so good.. But now i like to make a text loop showing each error for 2 seconds. Code: value = event.getvalue() RE: Convert 2 byte to bits - admin - 02.05.2024 Set the event script execution mode to "Last instance only" and add this code: Code: if #result == 0 then RE: Convert 2 byte to bits - Joep - 02.05.2024 (02.05.2024, 11:50)admin Wrote: Set the event script execution mode to "Last instance only" and add this code: Thanks admin. This works great. |