View Single Post
  #35   Report Post  
Posted to rec.crafts.metalworking
RogerN RogerN is offline
external usenet poster
 
Posts: 1,475
Default From flowchart to ladder


\"Lloyd E. Sponenburgh" wrote in message
.70...

"RogerN" fired this volley in
om:

his will allow the
Arduino to control several things at once instead of doing one thing
at a time. I think the correct name for it is non-preemptive
multitasking.


Most PLCs that have an event-triggered extension language would have to be
qualified as doing "preemptive multi-tasking". Once off in a module, you
can't service the ladder until the routine returns. Some don't even permit
servicing I/Os _during_ the routines, only setting internal registers that
will be transferred to the hardware once the ladder loop resumes.

Lloyd


Right off the bat I can't think of a single PLC instruction that I can't
duplicate in an Arduino. The key to the whole idea is that you NEVER go
"off in a module" where you can't service the ladder. I linked a program I
wrote for a bulb machine I wrote using a Mitsubishi PLC that operates 16
stations. There isn't any part of the program I wrote that needs any kind
of multi-tasking, even though all 16 stations do their thing at the same
time. It's just a matter do doing one thing at a time, but doing it so fast
that it appears to be done all at once. You simply don't program to make
the processor wait for something to happen.

Here's an example from radio control, if you've ever messed with a somewhat
modern radio control system, with an 8 channel R/C system, you can have 8
servo's connected to the receiver and they will all do what you command them
to do simultaneously. In actuality, the transmitter sends a 4.5 millisecond
sync pulse then a series of 8 pulses (for 8 channels) ranging from 1 to 2
milliseconds. A 1.5 millisecond pulse sends the servo to mid position, a
1ms pulse sends the servo all the way one way, a 2ms pulse sends the servo
all the way the other direction. So in millisecond time, one servo is
controlled at a time, but in human time all servos are controlled at once.
Same thing with the PLC program I wrote for the bulb assembly machine, it
has over 5000 instructions, only 1 instruction is executed at a time but
since all instructions are executed dozens of times per second, it appears
everything is happening at once.

I guess the point I'm trying to get at is that in machine control you can
write a bad programs that use multi-tasking, that has a thousand threads
each holding up execution until the programmed event. Or you can have a
single loop that is written to detect the conditions you are looking for to
process the program. The only time I need interrupts is to do something
like serial communication or track an encoder position. Seems like the more
modern technology I see, the more I'm amazed with the Commodore 64.

RogerN