To program the drive’s built-in PLC, you will need the drive’s programming software
GSLOGIC
which you can download for FREE from the AutomationDirect website.
Search for GSLogic and download the file.
Go ahead and install it, but before you run it, make sure the drive configuration software
- GSoft2 - isn’t connected to the drive.
They both talk to the drive as ModBus masters, so they can’t co-exist on the same RS485
network.
Plug one end of a USB cable into the PC and the other end into the USB configuration port
on the GS20 drive.
Go ahead and apply power to the drive if you haven’t done so already.
I’m going to reset the drive and PLC to factory default, so you know exactly where
I am starting from.
You do that by setting parameter 00.02 to a 10 to reset the drive, and then setting
it to a 6 to reset the PLC.
I’ll do the drive first by entering a 10.
Uh-oh.
Got an error.
What happened?
Well, look here – the PLC is currently enabled.
You can’t reset the PLC or the drive while the PLC is enabled, so I'll go to the main
menu, scroll to PLC menu and make sure the PLC is disabled by selecting PLC0.
Great.
We see the PLC indicator is off which tells us the PLC is NOT enabled.
Now if we go to parameter 00.02 … and enter a 10 to reset the drive, we get an END confirming
it and we don’t get an error.
Now go back to parameter 00.02 … and enter a 6 to reset the PLC.
Again – no error.
Perfect.
It’s always a good idea to power cycle the drive after doing a factory reset just to
make sure everything gets cleared out.
Launch the GSLogic software and set up the communications parameters.
Look for this USB serial device - which we see on my computer is com 11 - yours will
probably be different – and select that.
We’ll use the drive defaults of 8 bits, odd parity, 1 stop bit and 9600 baud.
You can use whatever you want here, just make sure the drive is set up to match using these
parameters.
And the PLC’s default Modbus address is always a 2 so this is fine.
Finally, we want to talk via Modbus RTU so make sure that is selected and hit OK.
Start a new program and enter a program name.
Don’t forget to select the GS20 drive family.
Make sure this is the correct com port and give it a file name.
And there’s our ladder editor.
This video assumes you know how to program PLCs, so you will find that this works the
way you would expect any generic ladder editor to work.
Let’s add a contact and use an M bit to control it.
M bits are just general-purpose bits in the PLC.
Let’s have that drive an output coil for output Y3 which is digital output 1 on the
drive.
Notice that the PLC terminal names don’t align with the drive names.
Keep an eye on that – it’s easy to mess it up.
You’ll find this button is handy – it shows you at a glance the drive and PLC I/O
mappings.
Again, we’re using output Y3 which corresponds to digital output 1 on the drive.
Finally, we need an END instruction.
This guy brings up the instruction toolbox.
I’ll expand program control and select the END.
You can also search for it by name using this drop down.
Great, this program doesn’t really do anything useful but it’s enough for us to see the
workflow.
I’ll hit the compile button to check for errors.
Looks good.
Hit the write button and select Write to PLC.
Again, we see that reminder that the PLC has to be enabled in Run or Stop mode for us to
talk to it.
So I’ll reach over and enable the PLC in stop mode which is PLC2.
The PLC indicator tells us the PLC is enabled in stop mode.
If it was blinking it would be run mode.
Hit OK and it looks like it was successful.
We see our program is using 3 of the 2000 available steps.
Let’s go online with the PLC so we can see what’s going on.
When we are on-line, we can see our scan time, this blinky guy which reminds us we are communicating
with the PLC and we see we’re currently in stop mode.
We also see we are using a GS20 drive at address 2.
Let’s hit the run button.
This dialog is reminding us this is just temporary.
If we want the PLC to start running on power up, we need to do that from the keypad or
digital inputs.
This is fine for our little test so hit ok and we see we are now in run mode.
But wait a minute … the PLC indicator on the keypad is still solid which says the PLC
is in stop mode.
But we just put it in run mode from GSLOGIC.
Shouldn’t this be blinking to indicate RUN mode?
What’s going on?
Again, GSLOGIC’s run/stop is strictly a temporary thing and is not indicated by this
LED.
This indicator really tells us what state the PLC will be in when we first apply power
to the drive.
And that can only be changed from the keypad or the digital I/O.
So, when using GSLOGIC don’t worry about this LED indicator.
Click on this guy to enable ladder monitoring – notice it tells us this window is in monitoring
mode now.
And click on this guy to bring up a data view.
We want to monitor register M0, so I’ll double click on this guy and enter M0.
This is the number of sequential registers we want to view.
If we put a 10 here, then the data view would be populated with registers M0 through M9.
We just want this one register for now, so this is fine.
This tells me M0 is currently off.
To change it, just right click and set it to on.
And sure enough, we see Y3 go active.
We can also see the output is active in Parameter 251 - the digital output status word.
If we right click and toggle the M bit off and go away and come back to refresh the display,
sure enough the status word reflects that.
Perfect.
That’ actually easier to see on the optional GS4 keypad because it shows you bit by bit
and it updates it without having to refresh the screen.
If I toggle M0 again, yep we see the digital output change.
Perfect.
And don’t forget, because we used Y3 in the PLC ladder code the corresponding drive
output is no longer active as long as the PLC is enabled.
Remember, an enabled PLC always wins control over any I/O it is using.
We can see that in Parameter 253.
This says the PLC owns that I/O.
If I disable the PLC, then the I/O returns to drive control.
If I re-enable the PLC, the PLC regains ownership of the I/O.
Of course, when I disabled the PLC, I lost communication with it because it no longer
exists.
So, I need to re-connect and then hit run to get things back.
Notice that while you are on-line a lot of things are dimmed out.
You can’t edit the ladder code, for example.
To do that, we need to go back off-line.
That ought to be enough to get you going.
Now it’s just a matter of entering your PLC ladder code.
The help file will explain all of the instructions but check this out.
There’s tons of examples the installer puts in Documents, AutomationDirect, Examples.
But, beware that all of these examples are written for the GS4 drive – you can’t use
them on a GS20 because the memory sizes are different.
The good news is, you can easily change it by going to options, change PLC type.
Give it a new program title if you want to, select the GS20 drive, and give it a new file
name so you don’t overwrite the original.
We now have a GS20 compatible version of the sample code!
Make sure this view comments button is on, so you can see all the comments.
Speaking of comments, one of the things I really like about this editor is I can enter
comments for each register or instruction, each row and if I insert a blank row, I can
even add a segment comment to help document chunks of code.
That’s really handy and makes the code so much easier to read.
Join me in the next video where we will learn how to control the drive from the PLC.
Click here to see all of the GS20 variable frequency drive video tutorials.
Click here to subscribe to this channel so you will be notified when we publish new videos
like this and click here to learn about AutomationDirect’s Free award-winning support options.