Create a Modbus RTU network with AllenBradley PLC and Schneider VFD

thedolanduck

Member
Join Date
Mar 2022
Location
Santa Fe
Posts
10
Hello everyone! Posting from Argentina as I don't know what else to do.


For a bit of context, I am using an Allen-Bradley Micro850 PLC and five Schneider Altivar 312 VFD for a client at my current job. My client wants me to communicate these devices over Modbus RTU.

To connect them all, I am using this Modbus splitter from Schneider, as I have used it in the past. All ATV312 use an RJ45 connection, so that was easy. The tricky part is the PLC, which uses a Mini DIN connection. So, I looked up its pin-out in the PLC's manual (see page 56) and the corresponding Modbus pin-out for the RJ45 connector in the VFD's Modbus manual, and then manufactured a cable: standard RJ45 T568B in one end, and Mini DIN on the other, with the appropriate pins attached respectively.

Then, I set up the PLC as master using 19.2kbps, 8E1 and RS-485. Set up one of the VFDs the same way, and made a quick program in Connected Components Workbench using the MSG_MODBUS function to read the first VFD's Status Word:

Code:
Modbus Local Parameters:
 Channel = 2      // Embedded Serial Port
 TriggerType = 1  // So it keeps sending messages while IN = TRUE
 Cmd = 3          // Read N registers
 ElementNo = 1    // Just 1 register

Modbus Target Parameters:
 Address = 3201   // Parameter address of the VFD's Status Word
  Node = 1         // Modbus address of one VFD
Long story short: it doesn't work :( It keeps throwing error 55 which, according to CCW's help, means:
The message timed out in the local processor. A link layer timeout.
My main concern is the cable. I triple checked, pin-out is alright, but maybe polarization? I know the correct thing to do would be to purchase an original cable, but we don't have time. Importing products here is a tedious process, we've been waiting for this PLC 3 months more than we were promised, so we are already late with our client.


Thank you very much for your time, and I really hope someone is able to help me, as I don't know what else to do.


P.S: Yes, I tried point to point connection with just the one VFD, same results.


P.S.S: I also was able to connect the ATV312 through Modbus to my laptop, using an USB-to-RS485 converter, and using the software SoMove. This means the Modbus connection of the VFD is working.
I could not, however, connect the PLC through Modbus (I programmed it through USB) with the CCW software.
 
For a point-to-point connection (master to one slave only), try swapping pin 1, B(+), and pin 8, A(-).

The definition of the the (+) driver line and the (-) driver line are not consistent throughout the industry and some vendors do it the opposite of others.

Having the driver lines connected backwards will not damage the RS-485 drivers, but comm will never work if the lines are reversed.
 
Are you using standard RS-485 cables. For example, Profibus is an RS-485 based network, so your setup shou8ld work with Profibus cable that you can buy from Siemens or Be3lden distributor. Also, is your RS-485 bus properly terminated? The RS-485 mandates termination on both sides of the RS-485 bus.
 
Try hexadecimal format: Modbus addresses can be DEC or HEX at one end.


Modbus Target Parameters: Address = 0C81 // Parameter address of the VFD's Status Word Node = 1 // Modbus address of one VFD
 
Last edited:
Okay, let's see...



For a point-to-point connection (master to one slave only), try swapping pin 1, B(+), and pin 8, A(-).

The definition of the the (+) driver line and the (-) driver line are not consistent throughout the industry and some vendors do it the opposite of others.

Having the driver lines connected backwards will not damage the RS-485 drivers, but comm will never work if the lines are reversed.


Thank you for the tip, danw! However, I tried and it did not work :(


Are you using standard RS-485 cables. For example, Profibus is an RS-485 based network, so your setup shou8ld work with Profibus cable that you can buy from Siemens or Be3lden distributor. Also, is your RS-485 bus properly terminated? The RS-485 mandates termination on both sides of the RS-485 bus.


Definitely not, Alfredo. It's something I brought up to my boss, but unfortunately we don't have any standard RS-485 cables that fit this PLC's embedded serial port (Mini-Din, 8 pins) and, as I mentioned in my original post, we simply don't have the time to purchase a new one and wait for it to arrive.



I like to use the SERIALISOL module for the Micro800s for that instead


Thanks Esnow, I'll have that on mind next time. Anyway, embedded serial port should work alike, shouldn't it? As I said to Alfredo, we don't have time to purchase new parts and wait for them to arrive.


Try hexadecimal format: Modbus addresses can be DEC or HEX at one end.

Modbus Target Parameters: Address = 0C81 // Parameter address of the VFD's Status Word Node = 1 // Modbus address of one VFD


Hi, tarik. Connected Components Workbench doesn't allow any format other than decimal when writing Initial Values, for some reason. I did try using the MOV function instead of writing Initial Values, and while it let me use the hexadecimal format this way, it did not change anything.


Now, I did some more testing:


I installed pyModSlave and, using a USB to RS485 converter, connected my laptop as a slave to the Modbus network. Then, I set everything up and started spying on the communication with the Bus Monitor integrated in pyModSlave.

Now, when I try to read the status word of my first VFD, the package (ADU) sent through the bus should look something like:

Code:
01 03 0C81 000A <CRC>

But instead is:

Code:
7F 7E 9EFC D6A6 <CRC>

Which makes no sense at all. This implies that I am trying to communicate with the slave no. 127 (16#7F), and perform function 126 (16#7E) (which doesn't even exist) to 54,950 (16#D6A6) addresses, starting at address 40,700 (16#9EFC).

I used qModMaster to convert my laptop as master of the Modbus network, and this way it all worked fine. I could read, I could write, and everything went fine!
 
I havent seen anything mentioned about the settings on the ATV.
Are you sure you have setup all correctly?
 
I havent seen anything mentioned about the settings on the ATV.
Are you sure you have setup all correctly?

That's fair. Here you go:
Code:
Add = 1 (default)
tbr = 19.2 (default)
tFO = 8E1 (default)
ttO = 1.0
SLL = No (*)
Fr1 = Mdb

(*) We don't want communication errors to stop the machine, it isn't that crucial.
 
Besides this you need to set FR1 in the CTL menu to modbus.
Also your cmd needs to be pointed to the modbus
Otherwise the drive will not start or change speed

Edit: I see you did point fr1 to modbus.
Also do cmd

If your chfc is set to SIM ignore my post. If set to seperate then make sure cmd1 is set to modbus
 
Last edited:
Now, when I try to read the status word of my first VFD, the package (ADU) sent through the bus should look something like:

Code:
01 03 0C81 000A <CRC>
But instead is:

Code:
7F 7E 9EFC D6A6 <CRC>
Which makes no sense at all.

This looks like a problem at the Physical Layer i.e. inverted voltages, as suggested by @danw; the UART or whatever is in the receiver will take the 0s and 1s instead of 1s and 0s and try to make sense of it. I would expect parity errors though.

You have a working setup (laptop master to device slave), so putting a scope on that would provide a valid baseline that could be compared to what a scope sees from the PLC master, but that gets down into the weeds. My experience with RS-485 is that it is pretty robust, and inverting pinout voltages from one RS-485 device to another will never destroy either device. And it is usually faster to try all of the few combinations of pinouts than to deduce the correct pinouts from two different manufacturers' documentation, which documentation is rarely unambiguous.
 
Baby steps

Well, I feel dumb... As I said in a previous reply to danw, I had already tried inverting the pinout of the cable, but it didn't work. Then, since drbitbow mentioned it again I thought: "Hey, maybe I did it wrong?"


So I went ahead and bought one of these so I could quickly swap cables, thinking that maybe I screwed up when making the inverted RJ45 terminal. And I was right! And so were danw and drbitbow, of course.


This is not a happy reply though. I can see now while spying the bus with my laptop that all the PDUs are correct, and I can write values from the PLC to the VFD just fine, but I can't read. You see, the MSG_MODBUS instruction block throws keeps throwing the timeout error (Error 55), just as I mentioned in my original post.


My suspicion is that there is no timeout (I've been testing with a lot of variations of timeout values and delays and response timer values, from the PLC as well as from the VFD: nothing worked), but another random error that the PLCs integrated diagnostic cannot detect. As I said, it lets me write, and I think this is because the PDU is sent and wrote in the VFD whether it answers it or not, but it doesn't let me read, since this depends on the slave response, which is not getting through. The VFD responds, though, I checked using my laptop as master and everything works fine.


I'm out of ideas to try. I already tried using my laptop as slave and writing to it with the PLC, and it works but again it throws a timeout. And it doesn't read either.


One thing that I tried and didn't work is using the PLC as a slave and my laptop as master. I couldn't neither read nor write to it. So maybe there's the problem, but I don't know what that means.
 
Reading this on my phone so didnt dbl check if you mentioned this. But do you have a end of line resistor installed?
 

Similar Topics

Hello, I've been trying to learn this a while now and still have not found out how this works. I have an Omron CJ2M PLC and an ABB ACS 355 VFD...
Replies
1
Views
191
Hello, I have to deal with iFix again and am looking at the most efficient way to create alarms to display in iFix, i.e. not creating an...
Replies
0
Views
138
Good morning to all, I have the following issue, I installed everything of intouch including the patch, it is the 2023 version. The...
Replies
0
Views
284
So, I finally got versioin 27 installed on my Windows 10 VM. However, now I can't upload a project from my lab controller. I have the above error...
Replies
0
Views
1,117
Hi all, I have few GB of logged data created by RS View 32 Works, it is all in .DBF format. At the moment, my company wants to shift all data to...
Replies
14
Views
1,395
Back
Top Bottom