timing (was: Editorial help)


Thread Starter

Jiri Baum

Jocelyn Boily:
> There is many different way to approach the problem, and commercial PLC
> usually have option.

I just wanted to write out how I see this in the linuxPLC... Comments?

> Usually, ALL the Inputs are scanned first. Then the logic is Executed
> using and Image Register in memory (not going directly to the I/O, but
> merely looking at what the were the last time they have been updated).
> And then the Outputs are written to the Hardwire I/O, strictly copying
> the Output registers to the Output Drivers. Some PLC would also handle
> the communication in a synchronously to the scan.

As long as there's only one logic engine, that's what's going to happen from its point of view. It gets a copy from the Shared Memory into its
private Image Register, executes all the logic, and then copies all the outputs from the Image Register into the Shared Memory.

> Some function Are allowing a Immediate Access to some of the I/O (Only
> the one that the processor has a fast access to), to allow a controlled
> sequence or more then one I/O scan per logic scan.

The logic engine can get a fresh copy of an input from the Shared Memory at any time, or write an output to it.

> Most of the time the application do not require a predictable sequence of
> the inputs.
> Actually, creating a logic that requires a certain timing is bad design,
> after all you interface with mechanical hardware that work within second
> timeframe while the logic can act in uSeconds. There is usually a way to
> make the logic work perfectly without to worry about timing.

Good. Let's leave it out for now -

> However, It is sometime not possible and we then have to be careful how
> the various rungs are entered and executed.

Let's leave it out for now, but keep it in our minds as something to be eventually provided. We definitely won't be able to get away with ignoring
timing forever.

Jiri Baum <[email protected]>
Windows is not popular. Windows is *widespread*. Linux is popular.

LinuxPLC mailing list
[email protected]