I am new to working with Modbus protocol. To understand how things work with Modbus and how would we collect the Data from Modbus using Industrial Connectivity, I am using Modbus Slave simulator which sends dummy data to some Register Addresses.
I have used My IP address for Host and 502 as a Port number. The simulator is kept refreshing the data every 1 sec.
To collect the data in Industrial Connectivity I have created new Channel with Driver: Modbus TCP/IP Ethernet and Port Number 502. Then I have created Device within Modbus Channel with the following Configuration:
After that, I have created new Tag with 40001 Address and Datatype Default. But I am not receiving any data. To verify my connection, I did Launch Quick OPC Client but I am not receiving any data:
Can you please help me out, I have only four days trial version of Modbus Simulator. I can't work with Edge MS as suggested here: Modbus PLC Simulator, ThingWorx and You aAs I am not able to download the Modbus Package.
Thanks in advance.
Solved! Go to Solution.
It looks like you have only one network adapter (NIC) available on this PC. The Device ID of 127.0.0.1 (loopback adapter address), and the Device ID of 192.168.0.15 (the IP address of the NIC itself) will both signal the Modbus TCP driver to enter into Modbus Slave mode. You want the Industrial Connectivity Modbus Master to communicate with the Modbus Slave Simulator software. When both applications are fulfilling the role of Modbus Slave, you will not be able to read values from the Modbus Slave Simulator, you will be reading the values for the Industrial Connectivity Modbus Slave (which default at zero at startup).
To solve this, you will need to do one of the following:
1. Install the Modbus Slave Simulator software on a different PC. You will want the two PCs to ideally be on the same network, or at the very least they need to be able to form a TCP socket connection from one to the other.
2. Install a new NIC on the PC, and use one NIC for your Modbus Slave Simulator software, and the other NIC for the Industrial Connectivity Modbus Master driver. The Device ID will then be the IP address of the NIC the Modbus Simulator Software is binding to.
3. Multi-home the NIC, giving it more than one IP address. Then, when you open the Channel Properties in Industrial Connectivity, you will see each IP available for selection from the Network Adapters list. You will assign a unique IP to each application, just as with Step 2.
The key will be that the Industrial Connectivity driver and the Modbus Slave Simulator are not both binding to the same NIC.
You may want to take a look at the Manufacturing Apps portal. It has some examples.
You need to register first. You can also post questions related to these manufacturing apps.
Looking at your screenshots, it appears the tags you have created are reading as "Good" Quality in the Quick Client. This implies the Industrial Connectivity OPC DA Server has attempted to communicate with the Device at those tag addresses, and it has received a valid response for this driver. Since the driver is configured as a Modbus TCP master, this also implies it has received a valid Modbus response from the device. It is likely the address being requested from the Modbus Simulator has a Value of "0" for the address requested.
Perhaps the Modbus simulator is using address 40001, with zero-based addressing disabled. With your current settings, try creating a new tag in the Industrial Connectivity server with an address of 40002. Do you find the value you are expecting now appears in the Quick Client?
Thanks for your response.
I have tried your solution but it didn't work. I am not receiving any values. Strangely I am receiving some values in item SuccefulReads of Channel Statistics which is keep updating. It is not making sense to me.
I am new to this Modbus protocol so probably I am not understanding the configuration in right way. I am using Modbus Simulator as a Slave and Modbus TCP driver in industrial connectivity as a Master which will read data from Simulator. Is this correct ?
Yes, your description is correct.
That incrementing value for _SuccessfulReads reflects each successful attempt on the part of the Driver (the Modbus Master) to read a value from the Device (the Modbus Slave simulator), and this will increment at the rate of the requests being sent by the OPC Quick Client. This means the Modbus Slave simulator currently holds a value of "0" for the address being requested; and there have been 351 successful read request / read response transactions since you opened the QuickClient.
What values do you expect to see for these addresses?
Thanks for the response again.
My Simulator is generating values for around 10 addresses. Please see the image below:
And this is the Map Address Configuration for my Slave of device id 10
Thank you for the screenshots. It looks like you may have the Industrial Connectivity Device (Modbus Master) configured to communicate with Slave ID 1. The format for the Device ID, in the Device Properties, is '<IP Address>.<SlaveID>'.
Try entering this into the ID field: <192.168.0.15>.10
Or, if the Modbus Slave simulator application displays the Slave ID in Hex, you will want to use this ID: <192.168.0.15>.16
Do the values you are expecting display now?
I was using SlaveID 1 earlier but I changed it to 10 and I made the updates both in Slave Simulator and Industrial Connectivity. I have also received this message in Event log of Industrial Connectivity "Created memory for slave device. | Slave device ID = 10". But I am not receiving any values other than 0
Would it possible for you to try the same Simulator at your end? I feel I am very close to making it work but the values aren't updating, It would be very appreciated if you can give it a try.