Today is...
Thursday, October 19, 2017
Welcome to Control.com, the global online
community of automation professionals.
Featured Video...
Featured Video
Watch an animation of a conveyor stacking operation demonstrating the use of a move on a gear command.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive
TCP MODBUS Gateway
Connecting Modbus gateway to PC running TCP Modbus

Hi,

I am making a VISUAL STUDIO software that reads MODBUS data from MODBUS rtu device. I need to know that how should connect them together as I have to use ethernet network..

By now I know that I need to use MODBUS gateway... But can I directly connect MODBUS gateway to my pc running TCP MODBUS master?

You mean something like this:

PC--ModbusTCP----Gateway----ModbusRTU--RTU_Device

Yes, you can do that. Example of a such a gateway
https://www.icpdas-usa.com/tgw_715i.html

Just a note, you can use VS to create program to communicate "directly" with the RTU device. As the PC/Master most probably won't have serial port, you can use an USB to RS485 converter. So you don't "need" to use gateway specifically.

Thanks for your reply sir.

Yes I have tested my VS with direct com port and it is working properly. You understood my network exactly how it is. But to overcome distance issues I am using TCP

By now I know that I can use a gateway that receives TCP messages and my rtu devices can be connected to it.
I am stuck at :-

1. If my rtu slave ID is 5 which is connected to gateway, how do I ask gateway to read register form this id?

>1. If my rtu slave ID is 5 which is connected to gateway,
>how do I ask gateway to read register form this id?

That will depend on the gateway (GW) that you use, but most will do the same or similar like the one I linked above.

Your application has to send MBTCP queries to the IP of the GW. This will then get the query and send out to the RS485 port. The ID and register information that you put in the original query is for the RTU slave. The default ID of the GW is 255, so if you send message for ID 5, it will be sent to RTU with ID 5.