Parse PLC tag value from OMRON Fins node

Searched and found one of your solution

but did it differently using function node.
image

Code used in function node :point_down:

var a = parseInt(msg.payload.D2020).toString(16);
var b = parseInt(msg.payload.D2021).toString(16);
var c = parseInt(msg.payload.D2032).toString(16);
var d = parseInt(msg.payload.D2033).toString(16);
var ST_1 = Buffer.from(a, 'hex').toString().split("").reverse().join("");
var ST_2 = Buffer.from(b, 'hex').toString().split("").reverse().join("");
var SP_1 = Buffer.from(c, 'hex').toString().split("").reverse().join("");
var SP_2 = Buffer.from(d, 'hex').toString().split("").reverse().join("");

msg.ST = ST_1+ST_2;
msg.SP = SP_1+SP_2;

return msg;