salt Posted May 19, 2022 Report Share Posted May 19, 2022 Hi, How can a trigger be set for modbus writes on a slave device? The requirement is for the slave device to perform an action when a master device sets holding registers. Link to comment Share on other sites More sharing options...
Fernando Castro Posted May 19, 2022 Report Share Posted May 19, 2022 1 hour ago, salt said: Hi, How can a trigger be set for modbus writes on a slave device? The requirement is for the slave device to perform an action when a master device sets holding registers. just use a contact to execute the action and let the Master set that contact on the Slave. Modbus writtes the values on the slave device I think on visilogic is the force coil funciton under modbus, or you could use the preset holding register of 1 byte and use the bit operations to extract the bits to contacts. Link to comment Share on other sites More sharing options...
salt Posted May 19, 2022 Author Report Share Posted May 19, 2022 Thanks. How would you implement in the slave the option of writing to its operand and reading from it by master while still enabling writing to it from the slave itself (by a display) if you don't want the master to access directly the operand? Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted May 19, 2022 MVP 2023 Report Share Posted May 19, 2022 I'm interpreting this as you want the master to send stuff to the slave that it immediately reacts to and subsequently updates it's own readings, which the master then reads after the updates are done. If this is correct, to me this all depends on the slave's capabilities, whether it's a dumb sensor or a bit clever. cheers, Aus Link to comment Share on other sites More sharing options...
Fernando Castro Posted May 19, 2022 Report Share Posted May 19, 2022 8 hours ago, salt said: Thanks. How would you implement in the slave the option of writing to its operand and reading from it by the master while still enabling writing to it from the slave itself (by a display) if you don't want the master to access directly the operand? banks on the device but Modbus protocol by itself it's like "sharing" the address of the slave so the master writes in it and usually, the slave does not need to do anything else to "receive"... At most in some PLCs you map Modbus addresses to PLC memory. You also mentioned a display, take into account that one slave usually can only respond to one master, the master can access multiple slaves but the slave only responds to a single master Link to comment Share on other sites More sharing options...
Fernando Castro Posted May 19, 2022 Report Share Posted May 19, 2022 Pretty much we need to know the master and slave specs, the implementation of the protocol should be on the vendors manual of each deviece Link to comment Share on other sites More sharing options...
salt Posted May 20, 2022 Author Report Share Posted May 20, 2022 12 hours ago, Ausman said: I'm interpreting this as you want the master to send stuff to the slave that it immediately reacts to and subsequently updates it's own readings, which the master then reads after the updates are done. If this is correct, to me this all depends on the slave's capabilities, whether it's a dumb sensor or a bit clever. cheers, Aus That's correct. The slave is a unitronics plc with hmi, therefore a user can also update operands. This operand is the "original" operand that participates in what the plc cintrols. A problem arises when there is a need for the "external" operand that the master accesses to be different than the "original" and to be also read and write from it, because for the master to read it the slave plc needs to constantly copy the "original" to the "external" and vice versa, and without any indication that the master writes to the "external" in order to update the "original" the master's value will be overwritten (depending on whether the net in which the slave's copy command was executed after the master's connection). Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted May 20, 2022 MVP 2023 Report Share Posted May 20, 2022 What distance are the units apart? I ask because this situation is likely much easier done by using UniCAN. Read up on it in Help/CANbus UniCAN. cheers, Aus Link to comment Share on other sites More sharing options...
Gabriel Franco Posted May 20, 2022 Report Share Posted May 20, 2022 I would use two different MB, one for local control and another for Modbus commands. In ladder, use one or another based on your requirements (Modbus control enabled - remote control - or local control). In Vision family once you enable Modbus as a slave, you cannot restrict access to only desired operands, all of them can be read/writen using proper addresses. Link to comment Share on other sites More sharing options...
salt Posted May 20, 2022 Author Report Share Posted May 20, 2022 1 hour ago, Ausman said: What distance are the units apart? I ask because this situation is likely much easier done by using UniCAN. Read up on it in Help/CANbus UniCAN. cheers, Aus Ok thanks. No restriction set on distance. Modbus over Ethernet is the currently used communication method. Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted May 20, 2022 MVP 2023 Report Share Posted May 20, 2022 7 hours ago, salt said: No restriction set on distance. ???? 2m? 100m? 1km? The other side of the world? Link to comment Share on other sites More sharing options...
Fernando Castro Posted May 20, 2022 Report Share Posted May 20, 2022 9 hours ago, Gabriel Franco said: I would use two different MB, one for local control and another for Modbus commands. In ladder, use one or another based on your requirements (Modbus control enabled - remote control - or local control). In Vision family once you enable Modbus as a slave, you cannot restrict access to only desired operands, all of them can be read/writen using proper addresses. this seems the best approach, because I don't understand why do you need to use 2 different values from 2 different sources for the same operation, jus enable an option to toggle between those 2 if you want to preserve both, although I don't understand why you just simple use the address as it is, I mean master will read whatever the original value is and only be changed if the user actually changes that value. In that case whay do you want to keep the previous value entered from the HMI? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now