How do I remove 22 thru 27 of the data array as shown? I just want to pass out the first 21 data values.
To make the function 16 modbus write work i need to have the data array be the same as the quantity of values it writes. Im sure its an easy code line so i didnt bother putting the flow or values up properly but i can if anyone needs them.
i would think it would be something like msg.payload.value[21] = msg.payload.data[27]; but this isn't right
by the way .. i notice in your screenshot that you do a bunch of delete to clean up a msg.
if its easier .. you could do the opposite and create a new msg with a new structure based on some of the values of the old msg.
let newMsg = {
"payload" : "new payload",
"values" : msg.payload.data.slice(0,21),
"topic" : "new topic"
}
return newMsg;