Program a modbus touch panel to open a relay in a modbus relay board

217 views Asked by At

I have modbus touch panel with 4 buttons which is connected to a modbus relay board via rs485(A and B).

I want to program the touch panel so when i click a button to open a specific relay in relay board.

As i see from the touch panel manual and his registets every button has 0 or 1 value.

My question is what i need to do?? Should i write to touch panel registers or write to modbus relay?? How can i take the command that is coming from the panel and day to relay to open? I am a little confused withbthe process i need to follow.

1

There are 1 answers

3
faster.bicio On

First of all you have to know that Modbus communication works in a Master/Slave perspective, in which only master can send requests, slave will only reply to those requests.

So touch panel have to be the master in communication, the relay board will be slave.

Then, Modbus identifies every 16bit parameter with a Register Address; a list of addresses make a Modbus Map. To correctly send request to the relay board, you have to know the modbus map of the relay board:

(for example)

  • Register: Relay 1 command, Address: 0
  • Register: Relay 2 command, Address: 1
  • Register: Relay 3 command, Address: 2 etc...
  • Register: Relay 1 status, Address: 10
  • Register: Relay 2 status, Address: 11 etc...

The task you have to accomplish is to make your touch panel send a write request to the relay board; the request will be to write a "1" in the register linked to relay.

Commercial touch panels often have wizards and the implementation shouldn't be too much specific