can someone help me with string concatenate problem. I read data from register. It's function utf(regAddr, length). I get table with decimal numbers, then I transform it into hex and to string in loop. I need concatenate these strings into one. there is not in Lua something like .= operator
function utf(regAddr, length)
stringTable = {}
table.insert(stringTable, {mb:readregisters(regAddr-1,length)})
for key, value in pairs(stringTable) do
for i=1, length do
v = value[i]
v = lmcore.inttohex(v, 4)
v = cnv.hextostr(v)
log(v)
end
end
end
-- function(regAddr, length)
utf(30,20)

table.insert(stringTable, mb:readregisters(regAddr-1,length))?m inserting a table into stringTable only once. its not in loop. I can also read this register as value1, value2, value3, ... , value20 = mb:readregisters(regAddr-1,20) but I think better is work with table and loop. I don`t want to have 20 variables. I need iterate via table and for each variable in table use lmcore.inttohex and cnv.hextostr to get ASCII string. Final text must be "Power Meter" in one variable.