Please help me to understand when should I choose a PLC and when should I use a microcontroller?
A Microcontroller (uC) is a very small integrated circuit which is SMT mounted on a PCB and consists of a processor, a memory and some IO’s for general purpose or for communication. If you want learn how to use it, you have to think about buying a development board which has a microcontroller and which permits you to program the microcontroller and has some other functionalities.You can program it using either C++ (high level), embedded C (middle level) or even ASM (low level) programming language. A controller is a low price solution, but it needs additional electronics for buffering 24V DC and for protection. It is good for you to play with.
A Programmable Logic Controller (PLC), is comprised of a controller and all the needed electronics to be used in an automated system (normally 24V DC supplied) and it has internally or on a rack snap-in modules which provides you with all the required digital and analog IOs and communications (Profinet, Profibus, RS232, etc) you need to control an industrial equipment and to integrate with other industrial machines. As it name tells us, it is logic programmable, at least at the beginning it a “smart relay” and it was designed to be easy programmed even by technicians, one language to program it is with Function Block Diagram (FBD) which is a based on logic electronic circuits called also gates. Another programming language, my favorite, is Ladder Diagram, which is basically a language for electricians, based on Normally Open (NO) / Normally Closed (NC) Contacts. There is also a language called Statement List (STL) which I do not like, but I find it similar with Assembly Language (ASM). And with the newer versions of PLCs, there is a SCL language, similar with C, and there is also an organisation.representation (meta)language called Graph. About these last 2 I will write more as soon as I will get used with them better.