I am working with the node "node-red-contrib-modbustcp" and I am trying to create a server. I know that the server is working because I am connected to it by using a modbus master. The problem is that I need to transform the field payload that you can see remarked in red in the image attached into a string array and I don't know how to get it.
Are you sure you want as a string with embedded values, not as an array for example?
Whichever, first have a look at the article on working with messages in the docs, which will show you how to access the components. Then if you do really want it as a string as you have shown then you can use the string interpolation technique to build the string in a function node, something like this
The Modbus Server says this: "msg.payload must be an array of numbers or strings with values between 0:65535". I understand that I need an array but that its composed by strings.
The square brackets tell it to construct an array containing the values.
There are other ways rather than using a function node, but for learning a bit about javascript that is a good way.