• Not Answered

Inputs and outputs read from another module not in sync

I have a landing module that reads a word from a PLC and breaks it out by means of a boolean fan into individual boolean parameters representing alarm conditions.  As any of these conditions cause the process to trip, I wanted to set up a trap of the first out.  In another module (I didn't want to disturb the process with a download), I read the input parameter to the boolean fan, looking for it to be greater than 0.  If so, a positive edge trigger would set off other logic to read the individual boolean output parameters to trap the first out.  It didn't work.  It turned out that the output parameters read from the other module were a scan late compared to the input parameter.

This makes me wonder how control modules are executed.  I know that for a given module, the inputs are read first, then the function blocks execute, then outputs are written.  I have thought that all three tasks happen for a given module before moving on to the next module, but given what I have described above, this does not appear to be the case.  In my example, it seems that the reading task happened first, the landing module first and the first-out module later, then both executed function blocks, then both wrote outputs.  Or maybe before the landing module could execute function blocks or write outputs, it was interrupted and the first-out module read inputs.  For all I know, a module might be interrupted in the middle of executing function blocks to  start a task in another module.

Can anyone shed light on this?