FREE REPAIR MANUALS & LABOR GUIDES 1982-2013 Vehicles
Courtesy of Operation CHARM: Car repair manuals for everyone.

Part 1




GF54.21-D-3008H Functional Scope Of Logic Functions (PLC), PSM, Function

- with CODE (ED5) Parameterizable special module (PSM)


- with CODE (ED8) Preinstallation for parameterizable special module (PSM)

It is assumed that you are familiar with the programmable logic controller (PLC) described below. The PLC is an electronic assembly which is used for control and regulation tasks.
Basically, a PLC is a device with specialized input and output interfaces. It uses these sensors and actuators to control, monitor and influence function processes.

PLC functions are available in the PSM control unit. These functions are used to implement logic operations between signals in the signal pool of the PSM control unit.

The PLC functions can be parameterized, i.e. the origin of their input signals can be freely selected.
With some blocks, it is also possible to set parameters such as thresholds and times.
The following functions are available:
Block name Quantity
Logic block 32
Timer 8
Counter 8
Flip-flop 16
Threshold switch 8
Hysteresis block 8

Activation of PLC groups
Processing of each of the 8 groups can be activated or deactivated via "Activate/deactivate PLC groups" independently of the other groups. For this purpose, the parameters "Activation of PLC group 1-8" must be set accordingly.

Parameterizable options of PLC inputs
Parameterization options similar to those for the discrete outputs also exist for the PLC inputs:
- Dependence on vehicle status (as for the discrete outputs, e.g. circuit 15, undervoltage, vehicle locked, etc.)
- Inverted evaluation of input signal

In the case of inputs which are deactivated on the basis of dependence on vehicle status, it should be noted that the input is assigned the value 0. Inputs which can process a byte or word signal then also receive the value 0.

With the option "Evaluate signal inverted", it should be noted that byte and work signals are also "inverted". With these signals, the value 0 becomes 1 and a value not equal to 0 becomes 0 before they are passed on to the subsequent evaluation stage. Great care must therefore be taken when using this option for byte and word signals. The inputs for threshold switches and hysteresis blocks do not have the parameterization option "Evaluate signal inverted" as here it would make no sense to "invert" the input value in the described manner.

Logic block
A logic block has 4 digital inputs and 2 digital outputs, the 2nd output always being the inversion of the 1st.
In these blocks 3 2-fold combinations are combined into a system (see figure) . These 2-fold combinations can perform various logic functions independent of one another.







Logic block from 3 2-fold combinations
221 Input 1
222 Input 2
223 Input 3
224 Input 4
A Output 1
AND AND combination
B Output 2
NAND Not AND combination
NOR Not OR combination
OR OR combination
X Sub-block 1
XOR Exclusive OR combination
XNOR Not exclusive OR combination
Y Sub-block 2
Z Sub-block 3







Truth tables of various 2 fold combinations
A Output 1
AND AND combination
E_1 Input 1
E_2 Input 2
NAND Not AND combination
NOR Not OR combination
OR OR combination
XOR Exclusive OR combination
XNOR Not exclusive OR combination

Parameterization
Each input is assigned a signal number of a signal from the signal pool. In addition, dependencies on the vehicle status can also be set for the inputs.

For each logic block corresponding codings which have to be adjusted are planned for the determination of the logical function in the logical combinations 1, 2 and 3.

The output of the logic block is written to the signal pool. At the same time, the inversion of the output is calculated and also placed in the signal pool.

Details can be found in the document "Signal lists, PSM, function".

Timer
The timer has a digital trigger input and 2 digital outputs, the 2nd output always being the inversion of the 1st. When triggered, the timer becomes active for a user-definable period of time.
It is possible to set whether the timer is retriggerable and whether evaluation of the input signal is edge-operated or level-operated. The reset input can be used to reset the timer at any time.







221 Input 1
222 Input 2
A Output 1
B Output 2
red Reset
H Set
t Parameter "Time"

Parameterization
The input is assigned a signal number of a signal from the signal pool. In addition, dependencies on the vehicle status can also be set for the input.
Furthermore, you can parameterize the time in the range from 0 to 255, the time base in the range from 100 ms to 10 min, edge-operated or level-operated, positive or negative edge and restart.

A timer has 5 parameters which need to be set:
- Time
- Time base
- Type of evaluation
- Signal edge evaluation
- Restart possible with timer running

The output of the timer is written to the signal pool. At the same time, the inversion of the output is calculated and also placed in the signal pool.

Details can be found in the document "Signal lists, PSM, function".

Counter
The counter is an element that counts edge changes. It has a reset input, an enable input, a direction input and a counter input at which the signal to be monitored can be applied. The internal counter register has a value range from 0 to 65 535 (16 bit). If the reset input is active, the content of this register is reset to the set reset value (e.g. 0). If the counter reading increases to 65 636, the counter reading returns to 0 when the next edge is detected at the clock input. The enable input enables or disables evaluation of the counter input. The direction input determines the count direction. If a "0" is set at this input, the counter counts up; if a "1" is set, the counter counts down. Only positive edges are evaluated.







221 Input 1
222 Input 2
223 Input 3
224 Input 4
A Output 1
B Output 2
C Counter in
E Enable
RT Reset
UD Up or down

Parameterization
The inputs are assigned signals from the signal pool. In addition, dependencies on the vehicle status can also be set for the input. The reset value of the counter is parameterized under "Setting of properties".
The output of the counter is written to the signal pool as a 16-bit value.

Details can be found in the document "Signal lists, PSM, function".

Flip-flop
The flip-flop has a digital input (RC), an analog input (SD), an analog output 1 (A) and a digital output 2 (B), whereby the digital output is always the logical inversion of the analog output.
The flip-flop can be configured either as a D flip-flop with data input and clock input or as an RS flip-flop with "Set/Data" and "Reset/ Clock" input. If configured as a D flip-flop, the analog input "Set/Data" can also be used to store and output analog signals in the value range from 0 to 65 535 (16 bit) in the flip-flop block. The RS flip-flop, however, is a purely digital flip-flop.







221 Input 1
222 Input 2
A Output 1
B Output 2
RC Reset/Clock
SD Set/Data

Parameterization
The inputs are assigned signals from the signal pool. In addition, dependencies on the vehicle status can also be set for the input. Under "Property parameterization", the type of evaluation must be determined in addition to configuration as an RS or D flip-flop:
- RS flip-flops:
- Level-operated or edge-operated evaluation

- D flip-flops:
- Whether storage of the signal applied at the analog input is to be triggered by a positive or negative edge at the digital input.
The output of the D flip-flop is written to the signal pool. At the same time, the inversion of the output is calculated and also placed in the signal pool.

Details can be found in the document "Signal lists, PSM, function".

Threshold switch
The threshold switch has one analog input, which can process a signal with a value range of 0 to 65 535, and 4 digital outputs. The input value is compared with up to 4 threshold values and the appropriate output is then set.
To ensure that this block functions correctly, it is important to make sure that the parameterized values for the thresholds satisfy the following condition:
- Threshold A < Threshold B < Threshold C < Threshold D

Failure to observe this when parameterizing the thresholds will result in non-defined behavior of the threshold switch.







221 Input 1
AP Output 1 with parameter "Threshold value"
BP Output 2 with parameter "Threshold value"
CP Output 3 with parameter "Threshold value"
DP Output 4 with parameter "Threshold"
V Values

Operating modes
The parameter "Mode" under "Property parameterization" determines the operating mode of the threshold switch (sequential point or bar chart).
The following tables show the differences between the two operating modes:
- Sequential point mode
- Bar chart mode












Parameterization
The input is assigned a signal from the signal pool. In addition, dependencies on the vehicle status can also be set for the input. The operating mode is determined using the parameter "Mode" under "Property parameterization".
The thresholds are parameterized in the range from 0 to 65 535. Each block has 4 such parameters.
If a threshold is set to 65 535, then this threshold is considered as inactive and the relevant output is never set.
These thresholds can be set under "Property parameterization".

Details can be found in the document "Signal lists, PSM, function".

Hysteresis block
Using the hysteresis block, it is possible to convert an analog signal into a digital signal using a Schmitt trigger. This means that the output supplies a logical "1" when the input signal exceeds the upper threshold. A logical "0" is only output when the lower threshold is dropped below. The effect of this is that functions are not continuously switched on and off by a fluctuating input signal. The switching thresholds for the hysteresis can be set by means of parameterization.







221 Input 1
APS Output 1 with parameter "Threshold bottom/top"
BPS Output 2 with parameter "Threshold bottom/top"
V Values

Parameterization
The input is assigned a signal from the signal pool. In addition, dependencies on the vehicle status can also be set for the input. The threshold is parameterized as a value from 0 to 65 535. Each hysteresis block has 2 such parameters. If one or both thresholds are set to 65 535 then the affected hysteresis block is considered as inactive and the relevant output is never set. The hysteresis block is also regarded as inactive if the upper threshold is parameterized lower than the lower threshold.
The lower and upper threshold can be set under "Property parameterization".
The output of the hysteresis block is written to the signal pool. At the same time, the inversion of the output is calculated and also placed in the signal pool.

Details can be found in the document "Signal lists, PSM, function".

Internal processing and throughput time
To simplify internal processing of the PLC blocks and to reduce the throughput time of the system, the PLC blocks are divided into 4 groups. Each of these groups comprises 4 logic blocks, a timer, a counter, 2 flip-flops, threshold switch and a hysteresis block.
The resulting overall layout is shown in the diagram below.







CNT_1 Counter 1
FF_1 Flip-flop 1
FF_2 Flip-flop 2
G_1-8 Group 1-8
HB_1 Hysteresis block 1
LB_1 Logic block 1
LB_2 Logic block 2
LB_3 Logic block 3
LB_4 Logic block 4
SS_1 Threshold switch 1
TB_1 Timer 1

The system processes the groups in the following sequence:
- Group 1
- Group 2
- Group 3
- Group 4
- Group 5
- Group 6
- Group 7
- Group 8

During processing, none of the signals in the signal pool can be changed by external sources (Controller Area Network bus class B (interior) (CAN-B), discrete inputs, etc.). This ensures that all PLC groups have the same input information. After processing of a PLC group has been completed, the outputs of the individual blocks of the group are placed in the signal pool.

This is important as it ensures that these results are available during the processing of subsequent groups and that throughput times are minimized.

Processing of the PLC groups is slower during active diagnosis and especially during parameterization.

Processing within a PLC group is performed in the following fixed sequence:
- The blocks with analog inputs are processed first (threshold switch and hysteresis block).
- This is followed by processing of the flip-flops, the timer and the counter.
- Finally, the 4 logic blocks are processed. Here, the 16 input signals of the logic blocks are read in and evaluated all at the same time. The advantage of this is that these 4 logic blocks then remain consistent and synchronous for each PLC cycle.

If a function created using the blocks consists of, for example, 4 logic blocks connected in series (whereby all logic blocks belong to the same group), the throughput time of the input signal for this function will be up to 8 PLC cycles before a current signal becomes available at the output of the final logic block.







G_1 Group 1
LB_1 Logic block 1
LB_2 Logic block 2
LB_3 Logic block 3
LB_4 Logic block 4

If the same function is formed using one logic block from each of the 4 groups, the throughput time can be reduced to one PLC cycle. It is therefore important to synchronize the processing sequence of the blocks, the signal paths and their dependencies as far as possible in the switch group.

This enables PLC functions with the shortest possible throughput times to be implemented. The blocks are then interconnected in the way shown in the diagram below.







G_1-8 Group 1-8
LB_1 Logic block 1

Parameterization examples
The two following examples are intended to demonstrate the function of the individual blocks and the gating possibilities:
- Example 1
- Example 2

Example 1
In this example, the discrete inputs and the Controller Area Network (data bus/CAN bus) (CAN) signal "Engine speed in rpm" are used as the input information for the blocks. The results of the gating are made available at discrete outputs. The example comprises the logic block 1, group 1, which has already preadjusted the logic functions AND combination and exclusive OR combination.
The timer block of group 1 has an input which can be activated by positive edges and which triggers the timer time of 2 s.

The hysteresis block of group 1 evaluates the signal "Engine speed in rpm". If the engine speed exceeds 2500 rpm, the output is set. If the engine speed then drops below 2000 rpm again, the output is reset again (Schmitt trigger).
Flip-flop 1, group 1, is configured as an RS flip-flop, i.e. an active analog "Set/Data" input sets the flip-flop and an active "Reset/Clock" input keeps the flip-flop in its reset state.
Its non-inverting output is placed on the input of the block "Counter 1, group 1". The counter reading increases each time the flip-flop is set again. To illustrate the counter reading, threshold switch 1, group 2 is connected downstream of the counter block. It is parameterized to the thresholds 10, 20 and 30, and its outputs are placed on discrete outputs.







Example 1, connection of function blocks
231 Signal "Input 01 (high-active)"
232 Signal "Input 02 (high-active)"
233 Signal "Input 03 (high-active)"
234 Signal "Input 04 (low-active)"
235 Signal "Input 08 (analog)"
236 Signal "Permanent LOW" at input "RESET/Clock"
237 Signal "Engine speed in rpm"
238 Signal "Input 05 (low-active)" at input "Set/Data"
239 Signal "Input 06 (low-active)" at input "RESET/Clock"
240 Signal "Input 09 (analog)" at input "RESET/Clock"
241 Signal "Input 10 (analog)" at input "ENABLE"
242 Signal "PLC output: group 1, flip-flop 1" at input "Counter in"
243 Signal "Output 13"
244 Signal "Output 14"
245 Signal "Output 20"
246 Signal "Output 9"
247 Signal "Output 10"
248 Signal "Output 11"
249 Signal "Output 15"
250 Signal "Output 16"
251 Signal "PLC output: group 1, counter (counter reading)"
252 Signal "Output 5"
253 Signal "Output 6"
254 Signal "Output 7"
AND AND combination
CNT_1 Counter 1
FF_1 Flip-flop 1
G_1 Group 1
G_2 Group 2
HB_1 Hysteresis block 1
LB_1 Logic block 1
SS_1 Threshold switch 1
TB_1 Timer 1
X Sub-block 1
XOR Exclusive OR combination
Y Sub-block, combination 2
Z Sub-block, combination 3