I’m faced with an unusual task.
The Wago PFC200 is connected via Ethernet to the MOXA.
The MOXA is configured to operate the TCP Server on standard port 4001. It will send Modbus Master RTU via RS-485.
It is necessary to make software conversion Modbus Slave TCP to Modbus Slave RTU somehow. Is that possible?
P.S… I have previously done a similar conversion for FbMbMasterTcp (WagoAppPlcModbus). There it is done quietly via eMbFrameType.0.
Hi Tomas,
What is the role of the PFC200 in your setup? Do you need it to act as a Modbus TCP Slave and a Modbus RTU Master?
BR,
The PFC200 will be in the Slave role
Yes, you use the 750-8212 serial port as a ModbuRTU slave. You can right click on the left side and add Modbus Slave to the tree, then you can configure the register arrays.
Please keep in mind that these variables are not retentive, so you will need manage this in your program. (write every few seconds to retained variables, and then read/load the values on power up, etc)
Thanks for the reply, I know that way.
I need to forward Modbus TCP to RTU.
In the program tree will be Ethernet - Modbus TCP Slave.
Hi Tomas,
You can use the MemCopy function to copy data from your TCP register array to your RTU register array and visa-versa:
VAR
myTCPHoldingRegisters : ARRAY [0..199] OF UINT; // Holding Registers for ModbusTCP
myRTUHoldingRegisters : ARRAY [0..199] OF UINT; // Holding Registers for ModbusRTU
END_VAR
//Copy myTCPHoldingRegisters TO myRTUHoldingRegisters
MemCopy(pDest:=ADR(myRTUHoldingRegisters[0]) , pSource:=ADR(myTCPHoldingRegisters[0]) , udiSize:=SIZEOF(myTCPHoldingRegisters) );
If the MOXA should act as a Modbus TCP Master and Modbus RTU Slave, nothing special has to be done in the PFC200 other than setup the Modbus TCP slave on port 4001 (default is 502).
It is the MOXA that needs configuration/ preparation to copy the TCP-master registers to RTU-slave registers.
Have you tried it yourself?
I wrote at the very beginning, please re-read.
MODBUS RTU MASTER connected to MOXA…
I’m still not clear on what you are trying to do. All your posts mention ModbusTCP server, including the MOXA. What device is the ModbusTCP Client that? Or, stated another way, if the MOXA is acting as the physical gateway between Modbus ethernet and serial, then I believe the logical gateway function will need to be deployed there as well.
Colleagues are very simple. I thought to eat a software solution. During the analysis, I realized that there is only a hardware solution.
Moxa Mgate solves this problem. Initially, I wanted to solve the issue using Moxa NPort, as it turned out to solve this problem, only MOXA MGATE is needed.
Not very clear in what you wrote…
But, glad it worked out!