Austin Nelson Posted October 9, 2019 Report Share Posted October 9, 2019 Hello, I am trying to communicate to an Automation Direct VFD through Modbus. Since this is just a small proof of concept project I have taken the Modbus example code and modified it to attempt the read the output frequency of the drive. Unfortunately I am not getting any communication between the VFD and HMI and am unsure why. No one in our office has much experience with Modbus, and none with Unitronics Modbus programming so I am hoping someone on here can help. I've made a cable using a RJ4C6P connector on each end of the cable. I made the cable similar to the one described in the GS2 manual as seen below, but pin 2 to pin 2, pin 3 to pin 3, pin 4 to pin 4, and pin 5 left blank. Using RS232, switches are in default on HMI and VFD switches set to RS232. I have changed the following parameters: P9.01 to 1 - 9600 baud rate P9.02 to 5 - Modbus RTU Mode, 8 Data bits, Odd Parity, 1 Stop bit I am hoping someone has some ideas to get me going in the right direction, any help is greatly appreciated. GS2 Manual if needed: https://cdn.automationdirect.com/static/manuals/gs2m/gs2m.pdf MODBUS TEST.vlp Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted October 9, 2019 MVP 2023 Report Share Posted October 9, 2019 You are trying to use 232 when the link is wanting to run on 485. To do this, you have to use pins 1 & 6 on the plc, and set jumpers accordingly. You may have to try swapping the lines if this doesn't work in the first place. As well, it would appear that the drive doesn't have the "normal" modbus comms settings that most of the gear I use does.......8 bits, no parity and 1 stop. You will have to find the best setting amongst all of the RTU options listed in the drive manual on page 4-56, and match these in the PLC's Com Init ladderwork. You should eventually find the one that works the best. For my stuff I always run on 9600, but in theory faster is possible. You again have to see how things go and find the most stable connection type and speed. cheers, Aus Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted October 9, 2019 MVP 2023 Report Share Posted October 9, 2019 1 hour ago, Austin Nelson said: VFD switches set to RS232 OK. Set your com parameters 9.02 to mode 4 - 9600 8E1. For some reason Even works better than Odd if None is not available. Cut off the end of your com cable on the PLC side and put a new one on- This is in the Visilogic Help if you dig deep enough. PLC VFD 2 2 4 4 3 3 You also don't need to put the "4" at the front of the Modbus address. This is implied as it's a holding register. Confusing, yes. And Unitronics starts counting at 0, so you need to subtract 1 from the register you want, so for frequency you need address 8450. Also confusing. I've hacked the program a bit. Let us know if it works. Joe T. MODBUSTEST_JT.vlp 1 Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted October 9, 2019 MVP 2014 Report Share Posted October 9, 2019 The other thing you can do to score a few confidence points is to use a PC-based Modbus tool. There are master and slave programs available. One example as follows: https://www.win-tech.com/html/demos.htm You can test: Unitronics PLC master to PC-Simulator Slave PC-Simulator Master to VFD Slave You can also try PC-Master to PC-Slave and even PLC-Master to PLC-Slave (using two COM ports). In each case the goal is to confirm that at least one side of the communication is working OK, by process of elimination. The V570 also has a built-in COM port sniffer, so you can monitor the traffic. It is accessible thorugh the info mode. It will be all HEX data, but at least you will be able to see if the drive is responding or not, as the TX and RX data are displayed separately. The issue may be as simple as just swapping RX and TX wires. The most frustrating thing about debugging comms is the way it can all just sit there not working, and you feel like it's all a dark secret. Use any trick you can to "open up" the system and let it show you where the problem is. Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted October 10, 2019 MVP 2023 Report Share Posted October 10, 2019 7 hours ago, Austin Nelson said: VFD switches set to RS232 Oooops, sorry. Missed that completely. Dumpkerfen! And I DO try to read posts completely. cheers, Aus Link to comment Share on other sites More sharing options...
Austin Nelson Posted October 11, 2019 Author Report Share Posted October 11, 2019 On 10/9/2019 at 6:45 PM, Joe Tauser said: OK. Set your com parameters 9.02 to mode 4 - 9600 8E1. For some reason Even works better than Odd if None is not available. Cut off the end of your com cable on the PLC side and put a new one on- This is in the Visilogic Help if you dig deep enough. PLC VFD 2 2 4 4 3 3 You also don't need to put the "4" at the front of the Modbus address. This is implied as it's a holding register. Confusing, yes. And Unitronics starts counting at 0, so you need to subtract 1 from the register you want, so for frequency you need address 8450. Also confusing. I've hacked the program a bit. Let us know if it works. Joe T. MODBUSTEST_JT.vlp 227.38 kB · 7 downloads Joe, the code you provided got them talking, thanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now