Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ladder Logic, never used it before. 4

Status
Not open for further replies.

cvtem

Computer
Jan 23, 2005
6
Hi,
I have a Hitachi EH-D14DR PLC here that I am supposed to be programming.
I have experience in programming PIC's and programming in linux, but absolutley none of that seems to be of any value with this weird Ladderlogic.

The program they supplied was Actwin Ladder Logic Software, which has a free driver that can program this PLC.

Below is a quickly thrown up example of (exactly) what I'm trying to do with this in picBasic, as I don;t know how else to explain, or even where to start with it in ladderlogic.

any help would be valuable!!!
This is a rush job, and I was dedicated programmer as the electricians we use, there PLC programmer isn;t able to get to it in time.



'yes, using 3 of the counters
'auger inputs are as mentioned, 12 pulses per rev, 350rpm
'emergency stop is one of the built in Normaly Open relays
'code is in BASIC so should be very simple to follow.



start:
emergencystop = 1 'emergencystop is OUTPUT RELAY, activate relay
'35pp 1/2 sec
mainloop:
count auger1, 500, result 'auger1 is INPUT PIN, count for 500ms, store result in 'result' variable
if result < 33 then emergstop
count auger2, 500, result
if result < 33 then emergstop
count auger3, 500, result
if result < 33 then emergstop
goto mainloop

emergstop:
emergencystop = 0
pause 30000 ' delay 30 seconds
goto start
 
Replies continue below

Recommended for you

Please see faq791-640. There are several tutorial websites and books available to help you get started.

xnuke
"Do you think you used enough dynamite there, Butch?"
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
One thing

Don't even think about loops when writing Ladder logic.
Understand how a PLC scans first.
And ladder is a very simple, efficient and fast language that works at the bit level, something most 'Computer trained' people have no idea of. It's not 'Weird', it is very logical and excellent for simple logic.

Francis
 
well, it is definately weird to this computer untrained person.
I can see the direct relevence with ASM (which is machine language, and I agree most computer trained people don't know of), but obviously, the scans vs jmp/jre/sub/so on, is whats obviously getting me..
I have seen a bit of IL programming, I can mostly figure that out, and how to code that, but I can't figure out how to make the 'pictures' go where I want, and why they have 'coils' in LD, there is no such thing in a microcontroller, and I don;t see it in IL examples... I really don't have the time to research and learn, but am doing my best.

thanks for the links xnuke.

I am currently comparing IL vs LD to try and figure out the picture-system and now also reading up more on scanning.

got to have this finished tommorow (14 hours)..
wish me luck :)
 
Am I on the right track with this (IF i could get the blocks, and then get them in the right spots)?

Line 1:

Counter

Line 2:

Timer, which starts and stops counter on line one

Line 3:

read value from counter, compare and send 0 or 1 result to AND block

line 4, 5, 6, 7, 8, 9, are the same

line 10:

AND of all 3 compares above, which switches the output relay?
and by an and functions, you have 3x 'contactors'??


Thanks.
 
Nope, I can't do it, I don't have the time to learn, and my method of thinking is too clouded by what I have always known and done.

Is there anyone here who's up for a job, I am willing to pay if wanted.

I am very desperate and too busy doing the wiring and setting up, and noone local can get to it.

the easiest way I can describe it is in basic, as anyone can read that and understand it.



boot:
emergencystop = 1 'relay closed so can start
bootloop:
count auger1, 1000, result
if result < 10 then bootloop 'don't monitor unless the shaft has started turning
pause 2500 'wait for it to spin up

mainloop:
count auger1, 500, result
if result < 33 then emergstop
count auger2, 500, result
if result < 33 then emergstop
count auger3, 500, result
if result < 33 then emergstop
goto mainloop

emergstop:
emergencystop = 0
pause 30000
emergencystop = 1
goto start
 
Sorry about so many replies in a row.

I beleive I may have mostly figured this out before I made the first post.. to be honest, I'm not positive eitherway.

I think the issue is in that the supplier said the demonstation software, with the included nano driver was all I needed to program the EH14, which is true, but it seems it can;t handle the high speed counters or timers.
which, in that case, is no good anyone else making the logic diagram for it if I can;t program it.

If someone can verify that would be nice, otherwise, just to get it in for now I am thinking to just make a tiny 1 line program that latches the emergency stop relay, and does nothing else.
I can then later program, or get the PLC programmed the way it should be.

Again, sorry abouyt so many replys in a row, I have never been in this kind of a pinch before, and time is quickly running away (2am and still at work).
 
cvtem
Whoever committed you to do a task without the necessary knowledge and said it could be done fast, is imho in the wrong job.

Think of Ladder as way to visualise boolean logic.

The following ladder

|---[ A ]---[ B ]---( C )---|

Is the same as
C = A AND B

And

|---[ A ]----------( C )---|
|
|---[ B ]--

Is the same as
C = A OR B

Francis
 
Yes.
The following ladder

|---[ A ]---[ B ]---( C )---|

Is the same as
C = A AND B
...
However, you might also clarify to differentiate A from NOT A, etc. regarding normally open and normally closed status.

John
 
Inverted functions are shown as...

|--[/]---[ ]---( )--|
A B C

(NOT A) AND B = C


Obviously you can apply the inverted function in any ladder construct you like (AND, OR, etc).




----------------------------------

If we learn from our mistakes,
I'm getting a great education!
 
Go here and clisk "learn PLCs" at the top of the page.

Loops are deadly. The PLC will go into a loop and never come out if you mess it up.
 
The job never got done..
Now I have net I have downloaded a few manuals and will try and figure more out in my spare time.

Thanks for the advice, I will prolly be back in contact again.

 
cvtem,
FrancisL had a very good point. The real keys to learning ladder logic is to understand how the PLC scans the rungs and to understand the data structure. Understanding the data structure will help you understand the instructions (normally open, normally closed, one shots, timers, latches, ect) and how each instruction works. I would start by writing out a detailed description of the process with all of the "real world" inputs and outputs. Once you start writing the program, create the rungs with the real world outputs you need to control first, then condition those rungs with the appropriate real world inputs. Try to break up the program into sections to make things happen and then figure out how to marry the sections together. I have found that this approach works very well most of the time. Good luck,
John Burgess
Controls Engineer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor