I'm trying to build an interactive dashboard for commissioning multiple Modbus devices that are identical.
I want to display several read-only values to the dashboard, as well as allow the user to read and write to certain values.
Most of these values are non-sequential registers.
New to the process, I've just gotten it up and running by using a single Modbus-Read node per register wanting to be read.
On the R/W nodes, I've got the Modbus-Read node going into a Dashboard Numeric Node, which then goes out to an individual Modbus-Write node.
This works, but it's primitive.
I'm trying to find a way to have an input box on the Dashboard for the UnitID. The user would fill that in, and that value would propagate to all of the Modbus-Read/Write nodes.
Similar with the Server field.
Because the devices are identical, all registers and other fields will be unchanged, with only the UnitID changing.
My best idea is that this can be done with individual Function nodes, grabbing a flow.UnitID value, then compiling the relevant msg.payload into a Modbus Flex Getter node. I think this would solve the the issue of programmatically changing the UnitID, but requires an individual Function node for each msg?
I have wired the controller up to a USB-to-RS485 converter and used modscan without issue. By default, Modscan polls 100 contiguous registers.
I don't know how to poll non-contiguous registers in Modbus, as the necessary parameters are [starting] register, and number of registers to get. I assume you would send an additional request in queue for each non-contiguous chunk.
What I thought would work is to programmatically change the server settings via the Modbus Flex Connector. Specifically the UnitId parameter.
Upon changing this, it is not reflected in other Modbus nodes that are configured to use that server, so the change does not propagate.
Is this a bug? Or am I missing something?
I don't believe that's what I'd does or how it is designed to work.
The flex getter node is for a dynamic one off request to a particular "thing". Of course you can repeat the command as many times as you wish. The point is more that the properties you set in the message are used that one time for that request.
Take a look at the building examples that node has provided. Use ctrl-i examples.
I've looked at the examples. While I greatly appreciate this Modbus package, it is actually poorly documented. Many things are inferred or left out entirely, such as this issue I'm running into.
I thought for sure I could use the Flex Connector to programmatically change the UnitID. I didn't even think I was being clever. I legitimately though that was its intended purpose.
As far as the examples, I have to reverse engineer most of them to even have a basic understanding of what they're doing.
How would you go about programmatically changing the UnitID?
For example, I want to populate a dashboard with values all from a single controller. I want a snapshot of that controller while I'm working on it.
Then I want to swap out the UnitID and get that same dashboard populated with data from the next controller, and so on.
I really just want a text entry field I can pop the MAC address into and then it shows all the data fields I'm polling.