Maria Javaid
Member
Can we programme a PLC in C or assembly? if not then what is the reason.
I think some PLCs have that option (Siemens?) but I can't tell you any more since I never had a need to use it...Maria Javaid said:Can we programme a PLC in C or assembly? if not then what is the reason.
ogimoj said:.... Siemens "STL" language is essentially assembly......
Take just an IO address for example. A common mistake is to confuse the IO address as referenced in a PLC program for the exact physical hardware address of the IO point. It is not. It is an abstraction of a memory location where the IO status was last saved by a part of the program that you didn't even have to write - it was all done for you by the compiler. It doesn't even resemble the actual memory address as it would be rendered in machine code, rather it is abstracted to something that is easier for us carbon based life forms to remember and work with. To top it off, you are probably working with a bit address more often than not. But your processor does not work with bits. It works with words (probably 32 bit.) That means that to determine the state of that single bit the compiler must generate code for the processor to exectue which includes a mask, an AND operation, and a comparrison, and two possible jumps based on the comparrison result. All of that is represented by a single abstraction, a simple mnemonic, that is incorrectly confused for the level of the language.In computer science, a low-level programming language is a language that provides little or no abstraction from a computer's microprocessor. The word "low" does not imply that the language is inferior to high-level programming languages but rather refers to the small or nonexistent amount of abstraction between the language and machine language; because of this, low-level languages are sometimes described as being "close to the hardware."