Hi Guys, bare with me on this one, so looking for someone to show me how to configure the Modbus Client within Siemens TIA portal for the following parameters.
Pretty much I am looking at communicating to a nice wee cheap Ethernet Relay via Modbus TCP and I'm flying blind, I've already had a wee play and done some research but everything is based around rather complex read/writes, I essentially just want to write to the WebRelay from the S7 PLC to tell it to turn the output on or off via Modbus TCP. The WebRelay has a built in Modbus Server so that side is covered.
Now I know it sounds like I want someone to do the job for me, well you're right, I'm half way there already but thought it would be easier to jump on here, have someone that knows what they're doing quickly show what needs put where and whammo I'll be away and will be able to reverse engineer and have all the planets align.
So here goes this is the info direct from the WebRelay manual, I have the IP address etc so that part isn't needed, so any help with pics would be grand.
3.4.3 Write Single Coil (Modbus Function Code 05 (0x05))
Request:
Modbus/TCP
Transaction identifier (2 Bytes): 0x0001
Protocol identifier (2 Bytes): 0x0000
Length (2 Bytes): 0x0006
Unit identifier (1 Byte): 0xff
Modbus
Function code (1 Byte): 0x05 (write coil)
Output address (2 Bytes): 0x0000
Output value (1 Byte): 0xff - turn relay on, 0x00 - turn relay off
Padding (1 Byte): 0x00
char write_coil_mb_request[] = {0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xff, 0x05, 0x00, 0x00, 0xff,
0x00};
Response:
Modbus/TCP
Transaction identifier (2 Bytes): 0x0001
Protocol identifier (2 Bytes): 0x0000
Length(2 Bytes): 0x0006
Unit identifier (1 Byte): 0xff
Modbus
Function code (1 Byte): 0x05 (write coil)
Output address (2 Bytes): 0x0000
Output value (1 Byte): 0xff - relay on, 0x00 - relay off
Padding (1 Byte): 0x00
Modbus Error:
Function code (1 Byte): 0x85
Exception code (1 Byte): 0x01 or 0x02
Exception codes:
0x01 - Function code not supported
0x02 - Incorrect starting address / quantity of outputs combination
Character String Example:
char write_coil_mb_response[] = {0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0xff, 0x05, 0x00, 0x00,
0xff, 0x00 };
Cheers in advance.
Pretty much I am looking at communicating to a nice wee cheap Ethernet Relay via Modbus TCP and I'm flying blind, I've already had a wee play and done some research but everything is based around rather complex read/writes, I essentially just want to write to the WebRelay from the S7 PLC to tell it to turn the output on or off via Modbus TCP. The WebRelay has a built in Modbus Server so that side is covered.
Now I know it sounds like I want someone to do the job for me, well you're right, I'm half way there already but thought it would be easier to jump on here, have someone that knows what they're doing quickly show what needs put where and whammo I'll be away and will be able to reverse engineer and have all the planets align.
So here goes this is the info direct from the WebRelay manual, I have the IP address etc so that part isn't needed, so any help with pics would be grand.
3.4.3 Write Single Coil (Modbus Function Code 05 (0x05))
Request:
Modbus/TCP
Transaction identifier (2 Bytes): 0x0001
Protocol identifier (2 Bytes): 0x0000
Length (2 Bytes): 0x0006
Unit identifier (1 Byte): 0xff
Modbus
Function code (1 Byte): 0x05 (write coil)
Output address (2 Bytes): 0x0000
Output value (1 Byte): 0xff - turn relay on, 0x00 - turn relay off
Padding (1 Byte): 0x00
char write_coil_mb_request[] = {0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xff, 0x05, 0x00, 0x00, 0xff,
0x00};
Response:
Modbus/TCP
Transaction identifier (2 Bytes): 0x0001
Protocol identifier (2 Bytes): 0x0000
Length(2 Bytes): 0x0006
Unit identifier (1 Byte): 0xff
Modbus
Function code (1 Byte): 0x05 (write coil)
Output address (2 Bytes): 0x0000
Output value (1 Byte): 0xff - relay on, 0x00 - relay off
Padding (1 Byte): 0x00
Modbus Error:
Function code (1 Byte): 0x85
Exception code (1 Byte): 0x01 or 0x02
Exception codes:
0x01 - Function code not supported
0x02 - Incorrect starting address / quantity of outputs combination
Character String Example:
char write_coil_mb_response[] = {0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0xff, 0x05, 0x00, 0x00,
0xff, 0x00 };
Cheers in advance.