﻿Communicating with the LS Electric L7C Servo via Modbus RTU is easy because the protocol
is fixed at 8 bits, no parity and one stop bit. So, all you have to do is select the baud rate,
set the node address and wire it up! One caution. The manual tells you not to
use the optional terminal block to connect your communications and that you should connect your
serial network directly to the I/O connector on the drive. I’m going to qualify that and
tell you it’s ok to use this terminal block if you use one of the slower baud rates.
And that’s exactly what we are going to do in this video. We will use the optional terminal
block because it makes wiring so easy, but even though the drive can handle up to 57k baud,
we’ll use 9600 baud to ensure reliable communications and because nothing we
do in this video will require fast coms. If you want to connect directly to the I/O
connector, you can use either the handy solder connector
or the flying lead cable. I love that the flying lead cable comes with each wire prelabeled with a
heat shrink tubing which you can shrink onto the wire or remove if you aren’t going to use it.
And we’ll need to set the PLC to use the same protocol and baud rate.
The node ID just has to be unique on your serial network. It can be any number between 1 and 99 on
this drive. Let’s use a node ID of 2. The PLC doesn’t have a node address
because it is the master and you can only have one master on a Modbus RTU network.
Finally, we need to wire up our serial connection. The LS Electric L7C drive has an RS-422 port which
is great because it can transmit and receive at the same time giving us full duplex operation.
But, the BRX PLC I’m using has an RS-485 port which can only transmit or receive – it can’t do
both at the same time. So how do we wire this up? Easy, just connect it like this.
So, messages sent from the PLC go this way and responses go this way. Of course, you want to use
a good cable with twisted pairs, and a shield. The terminal block’s cable is shielded but there's no
shield connection on the terminal block, so make sure you connect the cable’s shield to the PLC’s
chassis ground only. Don’t force a connection here – that will create a path for current to flow
which can actually create electrical interference inside the cable.
It’s also important to get a common communications ground between the devices – especially over long
runs. But this is differential pair so in theory I shouldn’t need a ground, right?
Yeah, in theory. But in the real world where you could have one system operating relative
to one ground potential and another system - possibly in another building - operating
relative to a different ground potential, while the differential voltages are the same,
the absolute incoming voltages appear way above what the electronics can handle,
so they burn up. Attaching a common ground strap between the systems ensures they are
both operating relative to the same ground and you don’t burn up your electronics.
Adding a common communications ground is a really good design practice and inexpensive insurance.
I’m using this cable from AutomationDirect which has a single twisted pair, plus a ground, plus a
shield. Exactly what we want. And remember – you can order cable from AutomationDirect in exactly
the length you need so you don’t waste money on excess cable and there are never any cut charges,
so it costs you nothing to do it! And since shipping is free on any order over 49 bucks,
if you need cable, be sure to head over to AutomationDirect.com.
In the drive CM software, you’ll find the baud rate under the index tab. We’ll set that to zero which
is 9600 baud – and under the basic tab, you’ll find the node ID. We’ll change that to a 2.
Remember: The parameters don’t actually get sent to the drive until you hit enter and you see the
color change – it’s easy to forget to do that. And don’t forget to power cycle the
drive – or reset the controller – after changing the node ID. That’s really important.
OK, the servo drive is ready to go and I’ve already done the wiring.
There are other videos showing you how to configure the BRX PLC for Modbus RTU,
but in a nutshell, you just go to the system configuration,
you want the Modbus RTU client or master and you want to configure the port for RS485.
You will normally want to use a termination resistor, though in this demo with short cables
and low baud rates that really isn’t necessary. Click this guy to set the baud rate
and protocol to match the drive which you can see I’ve already done.
That’s it, the BRX PLC is now Modbus RTU ready. Let’s do a simple example.
I’ve set this up so that when we toggle this C bit, the PLC will use the serial Modbus
port to read a holding register, at this Modbus address, of a L7C drive at this node address and
it will put the result in memory location D110. What drive parameter is that? Here’s the trick.
If you go to Chapter 15.4 of the user manual, you’ll find tables of all the drive parameters
and associated Modbus addresses. Be careful – it’s tempting to look at this and say “Cool! The Modbus
address is the parameter number.” That’s only true for the first few entries of each table.
If you scroll the table down, you will see they diverge. Why? Because some parameters use
more than one 16-bit address. Parameter 2002 for example needs 32 bits so it uses two
Modbus addresses, so the next parameter starts at the next available address.
So that’s Tip No. 1. Find your parameter number here, then look up the associated Modbus address
over here in either hex or decimal. Don’t assume the Modbus address is the same as the parameter
number, even though sometimes it will be. Some PLCs require that you add one to the address
and that is the case with this BRX PLC. So the L7C Modbus address is really 9792. If I scroll down to
find that Modbus address, I see that is parameter 262A which is the actual position of the servo
motor. And I can see here or here that it requires two 16-bit registers, so over here I need a 2.
So Tip No. 2 is some PLCs will require you to add 1 to the Modbus address,
and Tip No. 3 is you need to look at the parameter and see how many 16-bit words it will need.
I’ve already sent this program to the PLC and the PLC is running. So, if I manually
toggle the C bit, sure enough the Modbus read returns the actual position of the motor.
If I rotate the motor roughly one full revolution and toggle the C bit again, yep roughly
100,000 pulses – exactly what we expect. One thing you need to be aware of when you
do Modbus writes. By default, Modbus writes go to volatile memory – so anything written
via Modbus RTU will not be permanent – that is, it won’t be there if you power cycle the drive.
If you want the written values to be permanent, then write a one to Parameter 240E,
but be careful – non-volatile memory has a limited number of writes – maybe in the
hundreds of thousands. It’s almost impossible to use that up when entering parameters by hand. But
if you put a Modbus write in a loop, you could burn up all those available writes really fast when
sending parameter changes. So make sure you only enable permanent writes when actually need it.
Given all of that you can now issue Modbus reads and writes till your hearts content.
Now that you know the basics, go to the drive’s page at AutomationDirect.com and scroll down to
find examples for AutomationDirect’s PLCs. They show you how to do all of the different
kinds of Modbus commands and even show you how to set up a simple polling loop.
Meanwhile, click here to learn more about the L7C Servo Systems.
Click here to learn about AutomationDirect’s free award-winning support options
and click here to subscribe to this YouTube channel and hit the little bell icon so
you will be notified when we publish new videos like this one.