Jump to content

Modbus slave trigger in Visilogic


Recommended Posts

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

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

  • MVP 2023

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

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.