Simple Decision

From OpenMotics
Revision as of 07:01, 18 May 2014 by Wilbert (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A Simple Decision allows you to perform IF THEN ELSE functions.

A more simpler way has been implemented to support IF THEN ELSE functionality (See Action Types list Action 240). This function is still implemented to support the older installations.

The Master Controller supports 192 (0-191) Simple Decisions.

Each simple decision is written in 8 bytes.

  1. Decision byte 0
  2. Data Byte 1
  3. Data Byte 2
  4. Data Byte 3
  5. True Action Type Byte 4
  6. True Action Number Byte 5
  7. False Action Type Byte 6
  8. False Action Number Byte 7

How does it work:

Decision Byte 0
  • Bit210=000: check status Output
  • Bit210=001: Check status Input
  • Bit210=010: Check status Temp
  • Bit210=011: Check status brightness
  • Bit210=100: Check press time selected input
  • Bit210=101: check power level
  • Bit210=110: check time
  • Bit210=111: check validation bit
  • Bit43=00: true if equal with data field
  • Bit43=01: true if higher then data field
  • Bit43=10: true if lower then data field

Bit 4 and 3 are not applicable when Bit210=000, Bit210=001 or Bit210=111.

Data Byte

Data Bytes are used to put which input/output needs to be compared with the compared data field (see data byte3), which temperature needs to be compared, which brightness level needs to be reached etc

  • Data Byte1:
    • output nr (0-239)
    • input nr (0-239)
    • brightness module nr (0-29)
    • temperature module nr (0-29)
    • power level module nr (0-29)
    • check press time selected input number
    • check validation bit number
  • Data Byte2: sign temperature
  • Data Byte3: compared data field.

For example: Decision Byte0/Bit210=001, Data Byte1= 18,Data Byte3=1 -> If input 18 is high (=1) then apply “TRUE” action, if input 18 is low (=0), then apply “FALSE” action. Also number of seconds an input must be pressed before the TRUE action will be taken will be written in this field.

When decision byte0/bit210=100, this is only applicable for inputs and decision Byte0/bit43 can only be 00. Please also note that, when nr of seconds are measured when an input stays activated, only the true action (when the number of seconds are reached) will be performed, the false action will always be ignored !

True Action

Byte 4 and 5: “TRUE” action fields If the comparison is true then the Basic Action to be executed can be found back in Byte4 and 5.

If byte4 or 5 = 255 -> do nothing

False Action

Byte 6 and 7: “FALSE” action fields If the comparison is False then the Basic Action to be executed can be found back in Byte6 and 7.

If byte6 or 7 = 255 -> do nothing

Note: The false action is not applicable when Byte0/bit210=100.