Very Basic Program - Control a Light with a Button

sjwrait

Member
Join Date
Feb 2016
Location
Auckland
Posts
11
Hey,

I've just started working with a PLC (got it second-hand) and I'm just trying to make a very simple program to use a push button to turn on a light.

I've written the program in DirectSoft5, as follows:

7260233.png


I have a DirectLogic 205 Koyo with a DL240 CPU, with input and output modules as shown below:

47e68b7.jpg


I've connected up my light and button to the terminal blocks like this:

9bf3c6a.jpg

949b3ae.jpg


The part I'm most stuck about is how to assign each input and output. For example each input module has inputs 0-7. What do I do on DirectSoft to assign my contact to one of these inputs?
 
I seem to remember that PLC uses X for inputs and Y for outputs. Lookup on the AutomationDirect.com web site for manuals that explain how addressing your modules. They have a ton of info on their site.
 
I haven't used one of those exact PLC's, but I use the Click Koyo regularly and I assume it will be the same. Inputs are X, outputs are Y. The CPU's onboard I/O (if there is any - on yours there is not) will be X1/Y1 through to X/Y whatever. The first expansion card will start at 100, the second and 200, and so on. So the third input on card 4 would be X403, and the second output on card 1 would be Y102.

You'll need to check your documentation as to whether the CPU counts as a slot (I would imagine it does) which would mean your first input would be X101, and your first output, Y301.

Brute force way to test if you're not sure is just to short out an input, and then go looking for which one is on in the PLC!

[edit] on the Click Koyo, it doesn't have input 0 - for whatever reason it starts at 1 and goes 1-8 instead of 0-7. But I just noticed your inputs/outputs are labelled 0-7 not 1-8, so it's likely that you're looking for X100-X107 and Y300-Y307.
 
Last edited:
And, for what it's worth, the "C" addresses are soft internal addresses. They do not operate an external output.
 
I haven't used one of those exact PLC's, but I use the Click Koyo regularly and I assume it will be the same. Inputs are X, outputs are Y. The CPU's onboard I/O (if there is any - on yours there is not) will be X1/Y1 through to X/Y whatever. The first expansion card will start at 100, the second and 200, and so on. So the third input on card 4 would be X403, and the second output on card 1 would be Y102.

You'll need to check your documentation as to whether the CPU counts as a slot (I would imagine it does) which would mean your first input would be X101, and your first output, Y301.

Brute force way to test if you're not sure is just to short out an input, and then go looking for which one is on in the PLC!

[edit] on the Click Koyo, it doesn't have input 0 - for whatever reason it starts at 1 and goes 1-8 instead of 0-7. But I just noticed your inputs/outputs are labelled 0-7 not 1-8, so it's likely that you're looking for X100-X107 and Y300-Y307.

Thanks for your help. According to the manual I found on line, the input modules should be X0 - X7 and X10-17.

However I still can't get anything to work at all... Even when I just shorted on of the terminals connected to an input, I still couldn't get the light to turn on.

I wonder if it is because I'm not supplying power correctly to the terminal block? Attached is a picture of the terminal block for the input:

43c572e.png


The black wire on the right is ground and the red is power. By connecting them as I have, does that mean every other terminal on the same rows as them is connected to power/ground?

I've tried shorting it, by connecting a wire from a block on row 1 to a block on row 2 (same column). I thought this should turn on the indicator light for that input on the module, but nothing happens?

What is the correct way 'short out an input, and then go looking for which one is on in the PLC?'
 
What is the correct way 'short out an input, and then go looking for which one is on in the PLC?'

To me... there is no correct way to 'short' anything but just checking your voltage with a meter should do the trick, you need to look in the manual that gclshortt posted the link to and see if they are sinking or sourcing then you can figure out how it should be wired up
 
What is the correct way 'short out an input, and then go looking for which one is on in the PLC?'

What is meant by this is to connect an input terminal directly to its input level with no intervening switching elements. So, if it's a 24VDC input card, X0 say, would be wired direct to +24V. This technique gets you a pretty much guaranteed steady input to do testing/troubleshooting.
 
Basically, if your input is a "24V = input on" type input (which I think it is, although not 100% sure), then you connect 24V directly to the first input. The only other thing is that your input card needs a reference, so that it knows what that 24V is relative to. So there will be some sort of common terminal, to which you will need to connect a zero volt.

If I were you, I'd just bypass the terminal strip for now to save confusion. Wire directly to the card and work out how to get your input light to come on, and then add things back in from there.
 
Basically, if your input is a "24V = input on" type input (which I think it is, although not 100% sure), then you connect 24V directly to the first input. The only other thing is that your input card needs a reference, so that it knows what that 24V is relative to. So there will be some sort of common terminal, to which you will need to connect a zero volt.

If I were you, I'd just bypass the terminal strip for now to save confusion. Wire directly to the card and work out how to get your input light to come on, and then add things back in from there.

I dare to say the same, look for reference or common terminal, if your signal is PNP/Sourcing or Positive the common MUST be negative

the other way is signal NPN/Sinking or 0volts, common must be positive
 

Similar Topics

HELP, and hello! First of all I want to say that i'm new to all this plc stuff. I have a s7-300 cpu on my desk right now. It was kind of a...
Replies
17
Views
9,519
Im looking to hook up a 3 wire PNP photocell to an Allen Bradley 1746IV 16 module. Ive watched videos about hooking up DC sensors, but they show...
Replies
3
Views
2,982
I finally have my test/learning bed set up at home. I understand logic and programming, there are some holes in my basic electronics knowledge...
Replies
6
Views
3,424
Hello, I have an application where I will need to use the Serial port in a L55 CPU, and I can go about it in two ways, but both require me to...
Replies
2
Views
1,486
Hello, Forgive the basic question, but I've been having a hard time finding a clear answer to this online or otherwise. I'd really appreciate any...
Replies
10
Views
2,262
Back
Top Bottom