CONTREX CX-1200 User Manual

Page 174

Advertising
background image

5 - 81

PLC

The PLC adds functionality to the CX-1200. There are default settings for the PLC, which are generally
sufficient for most applications, and whose operations are transparent to the user. There are also PLC screens
which allow the user additional access to the PLC in order to expand on the CX-1200's functionality. The
PLC has a “scan time” of 2 milliseconds. The scan is divided into two parts:

• The state of the status indicators is determined (this includes the alarms and the results of the Custom

alarms) and the PLC-dedicated digital inputs are captured.

• The PLC program is executed and the digital outputs are updated with the results.

Since there is only one copy of the PLC bit map in memory when the PLC program executes, it uses the most
current state of the PLC bits. Therefore, if a rung changes the state of a PLC bit value, the new value is then
used in subsequent rungs. Though this rule is not violated in the case of the latches, the state of the latches is
not determined until after the PLC program has completed. This means that the set and reset PLC bits can
change, but only their state at the end of the PLC program will determine the state of the Latch throughout the
entire next scan. Likewise, the event counters are not incremented/decremented until after the PLC porgram is
completed, and their associated outputs will not change state during the execution of the program.

The PLC program performs the logic on the PLC bits as dictated by the user-entered program. The state of
these PLC bits is determined before hand via internal calculations. These bits are PLC bit 2 through PLC bit
99. These bits are consider status information that are set or reset based on their function, current data and
the state (or change thereof) of other PLC bits. These bits should never be operands of an OUT command,
and therefore the state of these ‘status’ bits should remain constant throughout the execution of the PLC
program.

The scan is summarized as follows:

1. The digital output (from last scan) are output to the actual outputs, the digital inputs are captured as a

group and saved for later use.

2. Status bits are setup - state, block select, RUN mode, loop type, event counter maintenance, alarms,

compares, set/reset latches.

The Timers are maintained (status bits set/reset if necessary). This ends the first 1 millisecond part of
the scan.

3. The digital inputs (stamped at top of 2 millisecond boundary) are copied to PLC bits (while OR’ing in

the DI Set (CP-403), and performing One-shot operation on the DI 1 Shot bits, (CP-402), set PLC Bit
Set (CP-407) bit, reset PLC Bit Clear (CP-408) bit.

4. Execute the PLC program. This performs only the logic as given by the program. No functions called

out by setting a bit to “1” in the execution of the program will get executed at this time. Counters are
not incremented at this time, and therefore, the counter outputs remain unchanged during the execution.
The state of the latches are not determined at this time.

5. The digital out PLC bits are saved, but not sent to the actual outputs at this time. The saved digital

output data is output at the top of the next 2 millisecond boundary. This maintains a fixed time
interval between the reading of the digital inputs and the writing of the digital outputs.

Advertising