
Zane797 (Customer) asked a question.
I am working on a non critical monitoring project. The basis of the project is to use arduino based, WiFi connected, micro controllers to serve as low cost and easily installed RIO points. These RIOs will collect data from whatever transmitters need to be monitored in that area (the base package will be temp and humidity then expanded as needed). I have coded the RIOs to serve as Modbus TCP Servers, I confirmed they are operating and providing good data from CASModbusScanner when read over the same wired network as the PLC, and I have confirmed that I have the correct Modbus addresses.
My goal, and current stumbling block, is to have my central CLICK PLC read the Modbus TCP data from these RIOs. Currently I just want to read the data for data aggregation purposes, making the connections to my SCADA simpler since I am more familiar with PLCs and communication standards. I will need to collect data at the CLICK for process control and write commands out in the future so I need to get the comms between my RIOs and the CLICK sorted out.
Has anyone else run into issues like this with their CLICK PLC's trying to setup Modbus TCP comms? I haven't had any luck with send commands either. The CLICK CPU model I am working with is the C0-10DD2E-D.
For the Click what is the value in each of the status flags? Success, Error, & Exception response.
That is another one of the odd issues I've had because it just get's stuck on Receiving. No other status flags are triggered.I'm not sure what part of the Modbus TCP protocol triggers that flag, I would assume confirmation of a data source acknowledging the request.
Search this forum for similar questions related to Modbus communication, but in general, troubleshoot as follows:
1) Establish what type of data (real, int dint etc) you're trying to read from one register in your device.
2) Try to read one known good address from another program. (Sounds like you've already done this with CASModbusScanner)
3) The attached screenshots show you trying to read from a single register (16-bit) and put that into a single 16-bit location. Be aware that for dints you have to read two registers and put into two 16 bit registers or 1 32 bit register. For reals you'll have to read two 16-bit registers and put into a real memory block.
4) Other issues may exists, namely: register offset by 1 and word swap.
I'm going to look again but I didn't see any Modbus issues similar to what I had, but it was late when I looked so I may have simply missed it.
1) I know that the source data is an int, I have a block of 10 ints I'd like to read eventually but I wanted to get one to read properly before I get overly ambitious.
2) Yes I'm fairly confident that the addresses are known and good.
3) I'd like to read in reals but my plan is to just multiply the source reading by 100 and divide by 100 on the PLC end to keep things simple and only use one int.
4) I'll try adjusting the offset and and starting point, maybe something there is not meshing between the two systems.
I appreciate the help and guidance.
What logic are you triggering your Receive instruction with?
Are you using an edge contact so it only sends one request?
If not try doing that. If it fails you should get an error. If you are using a level contact it will attempt to read every scan of the plc and will show receiving all the time.
If you are seeing failures, do you have modbus slave software on the pc you are testing with and can you target the test sw as a server to eliminate network.
I tried shifting it to use an edge contact with a timer bit triggered every second but it was still resulting in errors. I also switched it to a manually triggered bit and still no luck. I am getting the error but not an error code, remains at the initial value of 0.
I have been trying to get slave software working on my PC but haven't had luck, outside of my previous experience so learning on the fly here. Unfortunately I don't have any modbus devices at the office that are more typical purpose built industrial devices for me to test the communications on.
You can download Do-More-Designer software from AD. This software has a built in simulator that you can use to send/receive commands to the click that will replicate a "real" industrial device. You can also download the Modbus TCP Master tool from AD to check comms.
Thanks for the tip I didn't realize the Do-More-Designer had it included. This CLICK is my first foray into AD so I'm still getting my bearings. I'll also take a look at the Modbus TCP Master Tool. I appreciate the guidance.
So you are getting an error with no code. That means it is never reaching the device. If you were getting something in the error it would mean the device responded and something was not configured correctly in the read.
Since you are not getting errors it points to a network error. What are the ip settings for the MB scanner sw you are using?
Ok so the error message requires some manner of interaction with the Modbus Server, that makes sense. Thank you for the information. The machine the Modbus scanner is installed on is 192.168.1.173. The network everything is running on is pretty flat, so I'm not contending with any network configuration oddities. I am uploading another screen cap to show the code I currently have running it. I setup Modbus TCP Server simulation code on one PC and polled that register with the same Modbus Scanning program I used to read the RIO and it worked fine. I have pinged the PLC from both of those PC's to verify as best as I could that there are no restrictions. I don't suppose the CLICK software has some sort of network explorer to see if it can see everything else?