**************** BUG ALERT **************
We found an issue with the CLICK PLC that prevents Modbus TCP from working properly with a GS4 drive.
We discovered the GS4 drive closes the TCP connection pretty quickly after CLICK sends a command. But the CLICK does NOT open this connection back up as it should. We expect a release that will fix this issue in the September to October 2020 time frame.” This notice will be removed when the issue is resolved.
Meanwhile, there are a couple temporary workarounds:
1) Add a timer and a Receive command to check the status of the drive (408449). I put a timer in for 250ms. This keeps the TCP connection alive and prevents the problem from occurring.
2) Changing the com port setup "Server Inactivity timeout" from 60 seconds to 1 second. The drive waits a little over 2 seconds before it FINs the TCP connection on its side. So CLICK closing at 1 second negates this. If the program is sending messages faster than 1 second, the connection won't go down at all.
- Learn how to connect a CLICK PLC to a GS4 Variable Frequency Drive (VFD) via Modbus TCP in this live tutorial Video/Demo from AutomationDirect.com.
Our FREE Practical Guide to Programmable Logic Controllers eBook: https://www.automationdirect.com/ebooks/plc-handbook
We want a CLICK PLC to talk to a GS4 Drive over Modbus TCP. To do that, you need to have a CLICK PLC with an Ethernet Port, of course, and connect it and your GS4 Drive to your Ethernet Network. You will need the GS4 Drive’s optional com card to communicate via Modbus TCP. I’m using a little test network in my office with these IP addresses, yours will probably have different IP Addresses. In the CLICK software, let’s have the rising edge of contact C1 .. Send … a Frequency command. We want Port 1, which is the Ethernet port on this CLICK, and the Modbus protocol. Let’s set up the CLICK’s ethernet port. We want to set the IP Address to be compatible with our network, so I’ll give it this address, mask and gateway that we had on the previous diagram. The rest of this is fine so hit OK. Enter the IP Address of the GS4 Drive that we saw on the network diagram just a minute ago, here. The GS4 Drives ID is a 1. We want to write to a singer REGISTER. Using Modbus. And if we look in the GS4 manual we see these are the addresses we need to control the Drive. Frequency is this address so we put that here. Notice that the CLICK uses the 40 here instead of the 4 shown in the GS4 user manual. That’s important, don’t miss that. And we’ll put the frequency value to send in this register. I’ll fill out the status data just in case we get an error. Perfect. Well, that set up the frequency command. I’m just going to copy that rung, and paste it and let’s have C2 send a RUN command. The GS4 user manual tells me that is at address and we have to add a 40 for the CLICK. And we will use DS2 to hold the RUN command which we will set to a 2 in a Dataview in just a minute. Copy that rung and paste it and we’ll have C3 be the stop command. It’s identical except it sends a 1 which we will store in DS3. Copy that rung, paste it and let’s have C4 send a Forward Command. That’s at the same Modbus address and we’ll put the forward command in DS4. Copy that, paste it, and let’s have C5 send a reverse command, which uses the same address, but will send the contents of DS5 which will be a 32. And don’t forget the END instruction. Great. Let’s write that to the PLC. I’ve already created a data view with all of the control bits, created Nicknames for all of those, and I put the values we need for the various commands in the DS registers. Let’s put a frequency of 33 Hz in here. I already setup the GS4 to accept RTU commands using this video … so let’s try it. Make sure the click is in RUN mode. If I toggle C1 to change the frequency, sure enough the drive responds. If I toggle C5 to change to reverse, yep, the drive got it. Toggle the run bit, the drive starts spinning. Toggle the forward bit and it starts to change direction … and toggle stop and the drive ramps to a stop. Well, that ought to be enough to get you started. Click here to learn more about GS4 Drive. Click here to learn about AutomationDirect’s free support options. Click here to subscribe to AutomationDirect’s YouTube channel so you will be notified when we publish new videos.