Ok perfect we need to shift registers by -1
Try starting with this
For bits you have to add each bit as separate line and add bitmask
Code:
bit 0 = 0x1
bit 1 = 0x2
bit 2 = 0x4
bit 3 = 0x8
bit 4 = 0x10
bit 5 = 0x20
bit 6 = 0x40
bit 7 = 0x80
bit 8 = 0x100
bit 9 = 0x200
bit A = 0x400
bit B = 0x800
bit C = 0x1000
bit D = 0x2000
bit E = 0x4000
bit F = 0x8000
2. Profile type field should be register instead of inputregister
3. String values are not supported by modbus mapper. It can be read via a script, but do you really need these values?
2. I tried yesterday with both formats: same result.
3. Yes, I need theses values to work with the exact product internal date&time for my process
Have you got an Lua script example for this ?
Hi
2. Looks OK, I would contact SE and ask them for function they use to read this value.
3. You already have product identification in register 100 only in numeric format. Product identifier 17032 = IFL12H
function readstring(mb, address, length)
local data = { mb:readregisters(address, length) }
local bytes = {}
for _, reg in ipairs(data) do
if type(reg) == 'number' then
-- high 8 bits
local b1 = bit.band(bit.rshift(reg, 8), 0xFF)
if b1 > 0 then
bytes[ #bytes + 1 ] = b1
end
-- low 8 bits
local b2 = bit.band(reg, 0xFF)
if b2 > 0 then
bytes[ #bytes + 1 ] = b2
end
end
end
-- convert table of byte values to string
return string.char(unpack(bytes))
end