Question about Unity pro, Modbus simulation

timcph2008

Member
Join Date
Jul 2015
Location
United State
Posts
33
Hello guys,

I have some question about modbus simulation between PLC and laptop. However, The PLC and the slave simulator actually not communicated. Would you guys please help me take a look of my configuration? Thank you!

I set PLC as master, use Modbus Slave Simulator from ModbusTools, and configure laptop as number 3 slave. Ideally I want to use RS232 connect laptop and PLC, but I dont have RS232 cable right now, so I use ethernet to serial and serial to USB cable to instead RS232 cable(I dont know is it right to do it.)

I also attach screenshots of configuration of the PLC, Read_VAR, WRITE_VAR function flock, and Slave Simulator.

PLC_Configuration.png

FunctionBlock_Configuration.png

Simulator_Configuration.png

Simulator_Configuration2.png
 
Hello guys,
I use ethernet to serial and serial to USB cable to instead RS232 cable(I dont know is it right to do it.)

It definitely won't work without the correct physical connections and I have no idea what you mean by this type of connection. The USB to serial might be OK on the PC side, but many of those don't work very well for automation work. The pinouts all have to be correct - no idea what an Ethernet to serial cable is, suspect it is some sort of DB9 to RJ45 cable - Like a Cisco console cable?
 
ethernet to serial

By ethernet, do you actually mean ethernet or just the shape of the connector. Because the typical ethernet connector shape is actually called RJ45, while ethernet is a communications protocol that is completely different to the RS232 protocol.

You can't tell the PLC to transmit modbus RS232 from its ethernet port. It has to come out of its serial port because RS232 is a serial protocol.
 
I am pretty sure there are limitations of the PLC simulator in Unity, one of those is physical Ethernet connections don't work, i.e. You can't use read_var to read as you would with the physical PLC, check the manual for the full list of limitations.

Also you have your read_var configured to read 200 registers, there is a maximum read block size of 125 on modbus.
 
It definitely won't work without the correct physical connections and I have no idea what you mean by this type of connection. The USB to serial might be OK on the PC side, but many of those don't work very well for automation work. The pinouts all have to be correct - no idea what an Ethernet to serial cable is, suspect it is some sort of DB9 to RJ45 cable - Like a Cisco console cable?

By ethernet, do you actually mean ethernet or just the shape of the connector. Because the typical ethernet connector shape is actually called RJ45, while ethernet is a communications protocol that is completely different to the RS232 protocol.

You can't tell the PLC to transmit modbus RS232 from its ethernet port. It has to come out of its serial port because RS232 is a serial protocol.
Yes, as you said the pinout must be correct. We use multimeter to test the Ethernet to serial cable, to find out Ethernet pin to the DB9 serial port wire mapping. Then we use the RJ45 port diagram (which is the port connect with RS232 cable) and PLC manual to confirm which RJ45 pin is for RS232. Pin 1,2,3,6 are for RS232. Then I use the below cable to find out how the DB9 cable connect from PLC to PC.

RJ45_serial_port.jpgCable.jpgIMG_20150731_104306.jpg


and hope this would work lol...but it is not working
 
Last edited:
I am pretty sure there are limitations of the PLC simulator in Unity, one of those is physical Ethernet connections don't work, i.e. You can't use read_var to read as you would with the physical PLC, check the manual for the full list of limitations.

Also you have your read_var configured to read 200 registers, there is a maximum read block size of 125 on modbus.

After we change the read_var size to 100, the connection is happen, but no data transfer... we are using a actual PLC connect with our PC, did not use the unity PLC simulator.
 
Last edited:
OK, so it is working now. There has two mistakes we made.

1. The read_var configuration. The read black size is over 125.

2. The address in slaves simulator. In PLC, we configure the address start from 40300.
In the slave simulator, we set as 40300, but it should be 300 only, because the "Function" option take care the 40000 area.

Thank you guys, Thank you for your help!
 

Similar Topics

Hello All! I am new to unity and I have a quick question. I am using Indusoft and It seems I need to assign a memory word to each tag. That is...
Replies
3
Views
2,659
Hi guys, I mostly used AB product to work in my life, View Studio ME, RSLogix500 and RSLogix5000. Some company asked me to work for them and...
Replies
6
Views
3,493
How to store a elapsed time in Unity pro? For example I want to store a elapsed time and replace this elapsed time with a new elapsed time if it...
Replies
0
Views
1,255
Hello everyone; We have trouble with connecting 2 PC to one simulator. We have 2 laptop and we connected them viia tthe ehternet cable. Than we...
Replies
2
Views
6,934
Hi, Could anyone help me with the following problem? The setup is as follows: Schneider M340 with a NOE 0100.2 ethernet card connected to a...
Replies
3
Views
8,346
Back
Top Bottom