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.

writing to a bit object
#1
Hi,

 If I do grp.response('1/1/1',1,dt.bool)  the value is not always written to the bus,  unlike when I write grp.response('1/1/1',true,dt.bool) it is always written. Specifying the data type makes no difference.

As a workaround I have to do this

Code:
function tobool( val )
    if ( val == nil || val == false || val == 0 || val == "0" || val == "false" ) then return false end
    return true
end       
local receivedcommand = string.split(response[2],' ')
       local sw= tobool(dim[1])
       grp.response('11/1/14',sw,dt.bool)

That way I get the string into a number which is then converted to an boolean,  which seems a lot.

Note I have noticed this behavior in all firmware releases and is the same for grp.write.

Thanks,

Roger
Reply


Messages In This Thread
writing to a bit object - by rocfusion - 29.06.2017, 20:02
RE: writing to a bit object - by admin - 30.06.2017, 06:33
RE: writing to a bit object - by rocfusion - 30.06.2017, 19:34
RE: writing to a bit object - by admin - 01.07.2017, 09:03

Forum Jump: