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


Messages In This Thread
250 byte string: strange behavior - by Domoticatorino - 02.12.2020, 08:52

Forum Jump: