This gives the result as 15,3492 so how can this be formatted to give the actual register value of 986532 to send to the IoT MQTT
In the 2nd example, it's an array type. So you may need to use a :foreach on the results of the "/iot read-holding-registers"
To be more specific, each member of the array I think is 16-bit. So you can multiple the first element (15) * 65536, the add the 2nd 16-bits (3492) to that.
So 15*65536+3492 = 986532, which is what you're expecting.
I don't have a KNOT, but this should be pretty close:
{
:local modbusread [/iot modbus read-holding-registers slave-id=1 num-regs=2 reg-addr=514 as-value once];
:local reg514 ( ( ($modbusread->"values"->0) * 65536 ) + ($modbusread->"values"->1) )
:put $reg514
}