02.12.2020, 08:52
(This post was last modified: 02.12.2020, 08:56 by Domoticatorino.)
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.