This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

2 byte error message
#1
Hello (again)!

I have a UK24EIB Gateway which has a 2byte error message for each MP-Address.

Error codes for High-Byte: 
0b0000’0000 = No error present 
0b0000’0001 = Connected actuator does not correspond to parameterised type 
0b0000’0010 = No communication possible at this address 
0b0000’0100 = Connected actuator signalling error, see Low-Byte 
0b0000’1000 = No valid Min / Max values 
0b0001’0000 = Non-Hall sensor motor actuators only: Actuator not yet synchronised 
0b0010’0000 = Test run active 
0b0100’0000 = Monitoring time of reference value elapsed 
0b1000’0000 = Not used Several errors can be present together, OR-gated bitwise 

Error codes for Low-Byte: 
0b0000’0000 = No error present 
0b0000’0001 = Stop & Go ratio 
0b0000’0010 = Increased position travel 
0b0000’0100 = Overload, reference position not attained 
0b0000’1000 = No support at present 

The first 4 Bits are always 0. Several errors can be present together, OR-gated bitwise


Is there a way to present these values in visualization?
Reply
#2
Hi,

Use function getbit() from this post:

https://forum.logicmachine.net/showthrea...50#pid2850

BR,

Erwin
Reply
#3
It can also be done like this, but if you have several error messages the resulting string can be too large (string type is limited to 250 characters).
Code:
value = event.getvalue()

-- table key is bit number starting from 0
errors = {
  [0] = 'Stop & Go ratio ',
  [1] = 'Increased position travel ',
  [2] = 'Overload, reference position not attained ',
  [3] = 'No support at present',
  [8] = 'Connected actuator does not correspond to parameterised type',
  [9] = 'No communication possible at this address',
  [10] = 'Connected actuator signalling error, see Low-Byte',
  [11] = 'No valid Min / Max values',
  [12] = 'Non-Hall sensor motor actuators only: Actuator not yet synchronised',
  [13] = 'Test run active',
  [14] = 'Monitoring time of reference value elapsed',
}

result = {}

for i = 0, 15 do
  mask = bit.lshift(1, i)
  if bit.band(mask, value) ~= 0 then
    if errors[ i ] then
      table.insert(result, errors[ i ])
    end
  end
end

text = table.concat(result, '; ')
grp.update('1/1/1', text)

You can also make it multi-line by replacing '; ' in table.concat with '\n', but then you need some extra CSS:

Set "Additional classes" of your text object to "multiline" (without quotes) in Visualization editor.

Add to Custom CSS (Vis. graphics > Edit custom CSS)

.multiline {
white-space: pre;
text-align: left;
}
Reply
#4
Thank you so much for the help, exactly what I was looking for!
Reply


Forum Jump: