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.

250 byte string: strange behavior
#1
Code:
require('custom.fbeditor20.Time')

functions_Time_json_fbe_operating_hours_input_1 = grp.find('0/1/1')
functions_Time_json_fbe_operating_hours_input_2 = grp.getvalue('32/1/3')
hours = fbe_operating_hours(functions_Time_json_fbe_operating_hours_input_1, functions_Time_json_fbe_operating_hours_input_2, 'fb__New_diagram__fbe_operating_hours__id')
if hours ~= nil then
    grp.checkupdate('32/1/2', hours, 0.01)
end

value = grp.getvalue('32/1/2')

x = math.floor(value)
y = value - x
z = math.ceil(y * 60)


grp.write('32/1/4', x .. ":" .. z) -- 32/1/4 address 250 byte string

Hi there, I use math.floor function to make readable in time format the value of timer. Everything works fine (if 32/1/2 is 3,5 then 32/1/4 = 3:30) but when value of 32/1/2 does not change I do not read 3:30 anymore but a strange string ASCII.

How is it possible? It seems it happens only in a LM machine. In another is ok.

Thanks.
Reply
#2
What value exactly do you get in 32/1/4? Try adding log(value, x, y, z) before grp.write to check the variable contents.
Also getvalue() there is not needed since hours variable already contains the same value.
Code:
if hours ~= nil then
    grp.checkupdate('32/1/2', hours, 0.01)
else
  return
end

hour = math.floor(hours)
minutes = string.format('%02d', math.floor((hours % 1) * 60))
text = hour .. ':' .. minutes
grp.write('32/1/4', text)
Reply
#3
(02.12.2020, 09:01)admin Wrote: What value exactly do you get in 32/1/4? Try adding log(value, x, y, z) before grp.write to check the variable contents.
Also getvalue() there is not needed since hours variable already contains the same value.
Code:
if hours ~= nil then
    grp.checkupdate('32/1/2', hours, 0.01)
else
  return
end

hour = math.floor(hours)
minutes = string.format('%02d', math.floor((hours % 1) * 60))
text = hour .. ':' .. minutes
grp.write('32/1/4', text)


Enclosed what I mean. But the log of hour and minutes is correct. It seems that this problem occurs only in the machine LM5CLp2.

In LM5Lite knx no problem.

Thanks.

BR

Attached Files Thumbnail(s)
       
Reply
#4
Do you have FB editor with same version on both devices?
------------------------------
Ctrl+F5
Reply
#5
Is the value displayed correctly in the object list in LM configurator? Or is it the same as in Mosaic?
Reply
#6
(02.12.2020, 12:42)admin Wrote: Is the value displayed correctly in the object list in LM configurator? Or is it the same as in Mosaic?

Hi admin,the fb editor is the same. And the problem occurs in Mosaic and object list as well.

Thanks.

Br
Reply
#7
Can you provide a backup from this device?
Reply
#8
(02.12.2020, 12:53)admin Wrote: Can you provide a backup from this device?

Sent you by private message.

Thanks.
Reply
#9
You have a resident script "Date & Time" that's writing different data to the same object:
Code:
grp.update('32/1/4', time, dt.time)
Reply
#10
I am sorry for that! I did not check inside that script which I do not use.

I have to send you a gift for Xmas.

Thank you mate!!
Reply


Forum Jump: