So how does it work????

cdngunner

Senior Member
OK so ,with the PLC's I am used to working with, the processor will read inputs, process code, lastly sets outputs. ( not including the immediate statements).

Is this the same for the pics??????
 

BeanieBots

Moderator
Can't comment on PICs but PICAXE processes interpreted BASIC in the 'normal' serial manner with the exception of the 18M2 which has four time-sliced tasks.

It does NOT process inputs then outputs.
It processes lines of code in the same order they are written. (top to bottom) except when there are Goto's, Gosub's or other commands which cause a 'jump' to different code place.

Hope that helps.
 

premelec

Senior Member
PLC = ? Could be Programmed Logic Controller with ladder logic - or something else? What's the problem?
 

graynomad

Senior Member
Any micro controller will "process" inputs or outputs in whatever order the program is written to do. It's totally up to the programmer.
 

westaust55

Moderator
PLC = ? Could be Programmed Logic Controller with ladder logic - or something else? What's the problem?
I believe you have the right item - ie Programmed Logic Controller.
With some you can even force more frequent IO updates and running of "subroutines"/blocks.

Don't believe cdngunner was suggesting there was a problem. I see it more as a question out of curiosity as to how the PICAXE functions internally.

As BeanieBoits indicates, they do all actions in the sequence of the program
You would not want

HIGH 5
PAUSE 5000
LOW 5​

and have the 5 second delay and then a brief blink (if any illumination) of say an LED on the output 5 which would happen if setting of outputs was left until an entire program scan/cycle was completed.

Different "machines" and different methods/concepts of operation.
 

premelec

Senior Member
OK - I just think of a PLC as a subset of what a PICAXE can do with beefy external hardware like relays, timers and isolators etc attached... and a funny language to control it... :)
 

BeanieBots

Moderator
I think the confusion comes from the mindset involved with PLCs (programmable logic controllers). It's more like event driven such as programming in VB6.

In general, a PLC is what its name implies, a big fancy logic chip with configurable internal logic. Hence, the outputs follow a determined 'pattern' based on the inputs just like a logic gate. Hence, all inputs are processed first, then the outputs are set.
(some have fancy timers and subroutines etc but they are the exception in my experience)

PICAXE can do all of that (if you write the code), but it can also do a whole lot more too.
 

cdngunner

Senior Member
Sorry for the confusion. No wonder i always got in trouble in school for being to vague.

Yes programmable logic controllers. it helps with programming if you actually know how the device your programming works ;)

I assumed it was "per line" but you know what happens when you assume

Thanks for the answer
 

westaust55

Moderator
PLC's . . .

some have fancy timers and subroutines etc but they are the exception in my experience)
The types (Allen Bradley (Control Logix), GE Faunuc, Schenider, Modicon, ABB, etc.) we use for industrial purposes have those capabilities and more as standard. Things like the "fancy" timers have been there at least since 1980.
 

BeanieBots

Moderator
Giving my age away again!
I pretty much stopped using PLCs around 1985 and the one's I was using were probably >10 years old then.
 

premelec

Senior Member
Mfr's PLC definition...

From a Google supplied website:

"What is a PLC?
PLCs are ruggedized microcomputers with hardware and software specifically designed to perform industrial control operations. A PLC consists of two basic sections:

* The CPU (central processing unit) controls all PLC activity and can further be broken down into processor and memory system components

* The input/output interface system is physically connected to field devices such as switches, sensors, lights, and motors, and provides the interface between the CPU and the field devices (inputs and outputs)

PLCs are used to control machines or processes that are sequential in nature. PLCs can also control continuous processes that use analog I/O. "

I guess the CPU unit could be a PICAXE :)
 

hippy

Ex-Staff (retired)
Perhaps the difference between PLC and traditional microcontroller is really in how it's viewed. A PLC will often give the impression of running multiple independent tasks simultaneously, executing a whole set of separate sequences of programs ( each rung of ladder logic etc ), while a microcontroller is seen as a single program controller.

A PLC is more likely than not a standard microcontroller running pre-written software which allows it look like what would be called a PLC and a different programming language for the user to use.

It would be entirely possible to implement a PLC using a PICAXE.
 

premelec

Senior Member
System or Chip?

I'm getting the feeling that there may be some confusion on the use of the PLC term - I've known it as basically an industrial sequencer type device which is an integrated system rather than single component... it seems to be used to refer to some component as well in this thread - possibly related to PALs and FPGAs - I've not seen PALs referred to recently though FPGAs are rampant... [then there's the SoC which will take everything over :) ]
 

techElder

Well-known member
A PLC is a computer system.

The programming is basically a forced loop where you specify certain macros be performed when certain input combinations are present.
 
Top