Split hairs, talk about compiling, split hairs, it's time for a beer
All code run on a microprocessor (including a PLC) is compiled(it has to be turned into something the CPU understands).
The differences in types code is this,
assembly code is machine (CPU) specific code using mnemonics that translates exactly to the exact bits, byte, or word (whatever the instruction size is)of the instruction/data code for the processor and can be done without a compiler using hardware and switches to load a ram or prom, though usually is done with a compiler.
such as:
Mov A,E
(move the 8 bits in the E register to the A register), which for a 8080 processor would compile to 7B hex
A High level language (compiled code also) is a a human readable (in most cases) program that is turned into specific compiled code for each "instruction" in the source code. such as
Copy a to b
which depending on your choice of compiler, may be either turned into machine code that directly does almost what the assembly code did (although with some added overhead), basically it adds a pre-compiled generic routine maybe named copy (or calls it from a pre-compiled set of routines called say a DLL) that uses a pointer(either a CPU register, a place on the stack, a direct memory address, an index into a memory address, etc for either a and/or b) to the variable called a and stores it into the variable called b
All things equal, it is all compiled code, just the way it is compiled and run is different.
The fastest most compact code is assembly code (usually), but it is extremely hard to write complex algorithms in assembly and takes an intimate knowledge of the specific processors instruction set, registers and timing, so compilers were designed that made the code easier for people to read and understand. the trade off is larger slower running programs (look up hello world in assembly them c then visual basic)
Interpreted programs on the other hand are programs that run programs
whistle
whether they scan the text file, or tokenized version of the text file) but again there is a compiled program running in the background that you may call a "runtime" using Microsoft's name for it. Tokenized interpreted programs are faster than raw text interpreted files because the interpreter does not have to "Read" as much of the file to make a decision on what to do next, but both are much slower than the "compiled
" code of the previous two examples
so yes your plc has to compile the code to run it(unless it is using a runtime), but the more instructions and data types your PLC has the larger the code base gets and the larger the program gets due to code overhead. and in some cases the slower code execution becomes. that is why even with your faster PC today running in the ghz, it is still not 1000 times faster than the old 8086 originally was (8 mhz)
The closest to Assembly is Siemens Statement logic, It closely matches assembly statements for the processor, the furthest from it is structured text which has to be compiled just like statement logic has to be compiled.
Yes there are optimizing compilers, but as long as it is human readable form, with direct, indirect, and indexed variables of different bit/bite/word widths and types then the compiler has to add overhead to handle each situation without crashing........
I have not talked to the person(s) who have written the compiler for RSLogix 5000, or Step7, but I would bet there is a runtime (exe and dll's for a simile)using a tokenized code the displayed source code you see on the screen. that would logically be the fastest way to handle complex algorithms with the lowest overhead and highest speed.
Anyone out there who helped develop say RSlogix 5000 step in and tell me different.