Modbus value display problem

Hello everyone,

I'm having a problem with Modbus and data display.

(I'm a beginner, but I think I understand the basics of Node-RED.)

When I send a query of several words to a PLC, the data arrives correctly (in an array), it's accurate, and it appears in the debug window without any issues.

However, I can't get the value, for example, [1] from the word table to display in a numeric field.

Could you please explain why? It works in debug mode but not in the dashboard, as a numeric type.

Thank you in advance.

Note-Red : 4.1.10

Welcome to the forum @jlt57

From looking at this fragment of your screencapture:
image
I think you are using the original node-red-dashboard extension.
Be aware that the original dashboard is deprecated, and if you are new to Node-red you should probably consider working with an alternative such as @flowfuse/node-red-dashboard, which is sort of the official replacement.
Other dashboard extensions are available too.

If you were to pass your array to a dashboard text widget you would see both elements

But you are using a numeric input widget, which expects to receive a single value and it gets confused.

Further, you have told it, if a number is entered, to set msg.topic to msg.payload[1], which I suspect was clutching at straws trying to get it to work!

I suggest that you would benefit from watching this playlist: Node-RED Essentials. so that you know more about messages and their properties.

How can you fix it?
Unless you switch to the new dashboard, your best bet is to use a change node to set msg.payload to msg.payload[1] before you pass it to the numeric input node.

But is a numeric input widget the right one? Are you allowing the user to change the value, or just displaying it?
Perhaps a text node is all you need, set to display msg.payload[1]

NB if my screen captures are too small for you to make out the detail, just click to see the full sized version.

Hello
Thank you so much for all these explanations.

I'll look into it and keep you posted.

Thanks again
Have a good weekend

Hello Jbudd,

I looked at the links you sent, thank you.

My tests are working now, I'll continue.

I now need to look into how to secure access to the dashboard from outside the local network.

I already have an OpenVPN tunnel that I open when needed, which is already secure for accessing the local network.

Have a good day!