connect to Ethernet relay board
-
i want to connect to relay board from "robot-electronics.co.uk ETH-RLY16 V3"
could you please help me to pick the recommended datasource type, i tried to use tcpip but need help to put the right settings for data point any advice.thank you
-
The relay board supports modbus tcpip so that will be your easiest data source type. I browsed through the manual quickly and saw that its set to automatically get a dynamic IP address which is not ideal so i suggest that you read the manual on how to change the IP address to make it static. This is in the manual...
To set up your data source all you'll need is the boards IP address. Then you can start testing with the mango modbus test tool.
The board supports 3 modbus functions: Read coils ( function 01) this reads the status of the relays. Read Holding registers (function 4) this will read the 2 analog inputs on the board and write to coils (function 5) this will be used to activate the relays. the manual indicates that the relays are located at coil 1-2 so writing a "1" to these coils with the mango modbus test tool should energise the relay... try to get that right before you make the data points if you don't come right export your data source and data points as json here and ill try to help.
-
@craigweb said in connect to Ethernet relay board:
mango modbus test tool.
thank you for replay .. but be noted that board "robot-electronics.co.uk ETH-RLY16 V3" is not modbus tcip its an ethernet relay and as you mentioned i changed its ip to static an i can reach that ... my problem is setting data source ... tcpip datasouce and it's datapoints ... i attached relay board settings , datasource and data point configuration ... hoping you or any here could help to set the rights settings.
-
-
-
My apologies I looked at the wrong model on the website. unfortunately I haven't used such relays before.
-
Thanks for the effort though, CraigWeb! Welcome to the ecosystem!
Hi Joe,
Interesting use of the TCP/IP data source! What have you gotten working so far? I hadn't used it as an HTTP GET'er before, but it works! I think you're going to need more HTTP in your read command. I would open the developer tools when you request the page in your browser and see the GET request that loads the page. You may need to have some of those headers in your HTTP GET, and you may need the double newline at the end of HTTP messages. For instance, to get the /help.htm page in my data source, I had to supply a Host header in my read command, like,
GET /help.htm HTTP/1.1\nHost: localhost\n\n
I think you'll also want to adjust your write commands.
I didn't seek how write commands are specified in the manual (if you can post the relevant section I can look), butif you send a constant like 1 that will be the only thing sent when the value is set, regardless of what the value is. But, I may be misreading, that may be anl
which should turn relay 8 on. The main issue I think you're going to have is setting the values, since that requires particular ASCII characters for turning on or off a relay. I think the easiest way to handle that will be either- hard code the logic for what character means on/off for what relay into your interface. Have every toggle on the interface set out the appropriate character to the same point, which is only settable and has the settable command
VALUE
. If you are comfortable with old Mango pages not having these points be settable, and only opening/closing the relay through an appropriate point, this is a good option. - Have a level of indirection for points. This would be a scripting data source or some arrangement of point links that enabled virtual points to receive sets, which can then be translated into the appropriate character and sent to the device, or which the device's response to polling is set into.
- Similar to 1, create a point link that maps a human input to the appropriate character, then set that out to the device. For instance, set values to a virtual point like "1-ON" and the point link convert that into
e
and set that out the command point. Then use this virtual point when you need to open or close a relay, and the other point for current relay status. Edit: point link on this one, not meta
Given solution 3, you may consider using the HTTP retriever for getting values and only use the TCP/IP data source to send the relay set open/closed character.
- hard code the logic for what character means on/off for what relay into your interface. Have every toggle on the interface set out the appropriate character to the same point, which is only settable and has the settable command