I have several motorized Modbus devices, and must be able to select one as the controller and the others as followers. I can use a metadata or virtual source to select which device is the controller, and then write appropriate values to Modbus registers on all the devices to make sure all devices are set properly based on changing the selection. I have to write many different Modbus registers based on one point selection.
If I use a Scripting Data Source:
- I would be able to write all the Modbus registers without creating a point link for each register, correct?
- The selector point will have to be polled with a cron job every second or so. This seems like a lot of overhead for a change that does not occur frequently.
- The selector point could be polled once per minute, resulting in large latency and user confusion as it would take anywhere from 1-60 seconds to update the other points.
If I use a MetaData script:
- The script will execute whenever a user changes the selector point.
- I cannot write Modbus register values from a single script because MetaData scripts can only update their own script value through a
returninstruction. They cannot update other points.
- I must create one MetaData point and one point link for each register
If I use event detectors:
- I could detect the first event, and use it to trigger the other write commands
- I cannot have more than one target Modbus register per event handler
- I would need a lot of event handlers
I have another Modbus device where I use event detectors and event handlers to trigger a cascade of events that update other registers. This is nice because the writes are sequential, and the order is well defined. The problem is that the cascade of events (write commands) can be triggered inadvertently by an intermediate modbus write in the middle of the event chain, when I would prefer that the event handlers only trigger the write cascade based on
It seems to me that the ideal option would be to use a Scripting data source that can write to multiple Modbus registers from within the script, and can be triggered upon the context update of whichever points I select (like the Meta data "updates context" flag. However, it seems that this is not available for Scripting data sources.
This leads to my questions:
- What is the optimal means to configure multiple Modbus writes triggered by a single virtual or meta point change?
- Is it possible to launch a Scripting data source based on a "context update?"