you don't, the PLc starts at rung 0, through to the end, then loops back, you don'y have to do anything the actual process (generally) is before the scan of the main program the PLC does a bit of houskeeping, i.e. scans real inputs 7 transfers them to the input image, runs the program you have written then at the end updates the real outputs from the internal output image then perhaps does other things like communications etc.
OK, I thought PLC systems run almost exactly like microcontrollers. Even the microcontrollers code has an OS, it's dependent. Some times there might be an OS and some times there isn't.
But from your explanation, I think PLCs have a different system than embedded systems. And every PLC program must run on an OS even if there's no code.
The PLC will run the same OS every time from scanning to processing the main program.
Some Modern PLC's now have the ability to update the I/O imidiately rather than wait til the start of scan
What is the difference between "the new ability to update the I/O" and "the ordinary system scan" ?
Is that called initial state of inputs/outputs that the programmer has set to be processed before anything ?
you can also write subroutines that when called in your program jump to that subroutine, process it then jumps back to where it left off.
Yeah, I know this is called system interrupts.
But I have no much experience about the processors used in PLC, are they single core, dual cores or maybe more.
But if it's a single core, then yes the system will stop, run that interrupt sub-routine, then come back to main program. If it's more than a single core, then that means the system will continue to run and the other core should take care of that interrupt sub-routine.
You can also loop back to a rung of logic a few times (care is needed becouse for safety, PLC's have a watchdog timer so if it exceeds the scan time (usually in milliseconds) then it put the PLC into stop & turns outputs off.
Why the looping back is time sensitive since it's part of the main program ? I mean if I want to jump to a specific part of the program. Or you still mean the interrupt sub-routine ?
Either if it's an interrupt sub-routine or normal main program jump, if anyone of these actions is time sensitive, then it's not about the ladder programming. I think PLC standards are critical because it's meant for industrial and commercial purposes. That's my guess.
There are many processes going off in the background besides your code, timed interrupts for high speed processing, input interrupts, special I/O cards that need processing may be by an interrupt or outside the scan of your program, I suggest you scan the internet & watch some of the many PLC videos out there.
I absolutely will. Actually the reason I got back to PLCs is the use of this clone. It's beautiful how something can force me to learn about a complete different area than what I'm used to.
I know you mean here the OS of a standard professional PLC.
Thank you so much for your time parky