--- [EMAIL PROTECTED] wrote:

"I think the advantage is it is visual, you can see the changes right away and 
see quite a big picture at one time.  I don't think it's that hard to pick up. 
I've tried to document things along the way- Classicladder docs were pretty 
scarce when I started."

The visual nature of ladder programming is certainly an advantage to those of 
us who are a bit familiar with it.  There are other advantages to programmable 
logic controllers as well.  The big one for me is the fact that they exhibit a 
special kind of deterministic approach to logic.  They read all inputs as state 
then compute all of the logic based on that state, then they write all of the 
output based on the logical analysis.  Changing a value in one rung does not 
have any effect on the outcome of the analysis of the next rung -- until the 
next loop through the read, compute, write loop.  Any input change gets read 
the next loop and it's effect is then computed during that loop. 

On the other hand, sending a HAL input through an or module effects the state 
of the machine immediately.  It's much easier to create race conditions using a 
set of HAL modules than it is using a single Ladder program.  Oh sure it can be 
done and usually is when we start ladder programming.  

Just a couple of notes of history here.  ClassicLadder had a working real-time 
module a while before it was first ported to EMC2 by PeteV.  Long before that a 
couple of us experimented with classic ladder and the EMC in the BDI days.    
For a while I used a hack of it's real-time here as a replacement for the 
standard EMC IO module.  It was really pretty primitive.  

The subject of IO, Logic programming, and EMC was a big topic at the NIST 
hosted Fest.  One reason is that a lot of machine logic is hard coded into EMC. 
 An example is what to do when an "abort" message is issued.  Do I want the 
machine to reset itself to the top of the program?  What should the control do 
about coordinate systems and tool offsets?  These are hard coded into user 
space executables.  In a ladder sequence like a modern machine tool there will 
often be a thousand rungs of logic that handle things like the operator door 
latch and what to do if the door opens during a program run.  We had only begun 
to ferret out these kinds of machine logic issues and we saw them scattered 
throughout the code.  We did not come to a conclusion about machine logic 
during that meeting.  It was all we could do then to agree that we needed to 
move to John's HAL.

When we began to get serious about machine logic, JohnK and a couple of us had 
a long drawn out discussion with several of the folk who were writing an open 
source software PLC named MatPLC.  (Don't refer to this as softplc because that 
is trademarked)  The conclusion of our interaction with those folk was that 
their project and ours had quite different goals.  In essence we wanted motion 
control with IO and they wanted IO with a bit of motion control.  It was at 
that point that we settled on the fork of the ClassicLadder project.

Yes it is possible to configure HAL to do most of what our version of CL can 
do.  I wouldn't but then I know a bit about ladder and find it relatively easy 
to work with.  It would be possible to configure HAL for all of the functions 
used in the Mazak.  That is one of the most fascinating things about the EMC2 
project and code.  I'm constantly learning new ways to do things.  Hell I even 
created my own HAL module using comp.  Thanks Jeff.  It worked!  Then I 
discovered I didn't need it. 

About this time last year I found that the INI variable that says, "ignore 
limits during homing" only worked for the axis that was homing.  If I connected 
all of the home/limit switches to a single parport pin, those axes not homing 
would fault when the homing axis reached home.  Ladder handled this for me 
easily.  I started the logical rung with the home/limit parport pin.  Then 
connected each of the "is homing" signals from halui to a normally closed (NC) 
switch in ladder and "anded" them in that rung.  That rung's coil was connected 
to the limit reached signal.  If any axis is homing, no signal is sent to 
limit.  

HTH

Rayh

BTW I searched our wiki for ladder and found 25 references.  My early examples 
are still there.  
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Sample_HAL_And_ClassicLadder



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to