Functional Scope Of Logic Functions (Plc), PSM, Function - GF54.21-D-3008P
MODEL 906 with CODE ED5 (Parameterizable special module (PSM)) with CODE XM0 (Facelift)
MODEL 906 with CODE ED8 (Preinstallation for parameterizable special module (PSM)) with CODE XM0 (Facelift)
It is assumed that you are familiar with the programmable logic control (PLC) described below. A PLC is an electronic assembly which is used for control tasks and regulating 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 cab be used to implement logical 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.
| Block name | Quantity |
|---|---|
| Logic block | 32 |
| Timer | 8 |
| Counter | 8 |
| Flip-flop | 16 |
| Threshold switch | 8 |
| Threshold switch with hysteresis | 8 |
With some blocks, it is also possible to set parameters such as thresholds and times.
The following functions are available:
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. tml. 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 "Inversion of signal", it should be noted that byte and word signals are also "inverted". With these signals, the value 0 becomes 1 and a value Not Equal 0 becomes 0 before being 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 "Inversion of signal" 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 Fig). These 2-fold combinations can perform various logic functions independent of one another.
Logic block from 3 2-fold combinations
Truth tables of various 2 fold combinations
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.
In each logic block, the logic function of sub-blocks 1, 2 and 3 must be set. This is possible via the "Module" button.
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-controlled or state-controlled. The reset input can be used to reset the timer at any time.
Parameterization
The input is assigned a signal number of a signal from the signal pool via the corresponding "Input" button. In addition, dependencies on the vehicle status can also be set for the input.
Furthermore, using the "Module" button 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-controlled or state-controlled, positive or negative edge and restart.
A timer has 5 parameters which need to be set:
- Time value
- 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.
Parameterization
The inputs are assigned signals from the signal pool via the respective "Input button". In addition, dependencies on the vehicle status can also be set for the input. The reset value of the counter is parameterized using the "Module" button.
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.
Parameterization
The inputs are assigned signals from the signal pool via the respective "Input button". In addition, dependencies on the vehicle status can also be set for the input.
Using the "Module" button, the type of evaluation must be also determined in addition to configuration as an RS or D flip-flop:
- RS flip-flops:
- State-controlled or edge-controlled 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.
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 operating mode
| Sequential point mode Input 1 | Output 1 with parameter "Threshold value" | Output 2 with parameter "Threshold value" | Output 3 with parameter "Threshold value" | Output 4 with parameter "Threshold" |
|---|---|---|---|---|
| Input < Threshold A | 0 | 0 | 0 | 0 |
| Threshold A < Input < Threshold B | 1 | 0 | 0 | 0 |
| Threshold B < Input < Threshold C | 0 | 1 | 0 | 0 |
| Threshold C < Input < Threshold D | 0 | 0 | 1 | 0 |
| Threshold D < Input | 0 | 0 | 0 | 1 |
| Bar chart operating mode Input | Output 1 with parameter "Threshold value" | Output 2 with parameter "Threshold value" | Output 3 with parameter "Threshold value" | Output 4 with parameter "Threshold" |
|---|---|---|---|---|
| Input < Threshold A | 0 | 0 | 0 | 0 |
| Threshold A < Input < Threshold B | 1 | 0 | 0 | 0 |
| Threshold B < Input < Threshold C | 1 | 1 | 0 | 0 |
| Threshold C < Input < Threshold D | 1 | 1 | 1 | 0 |
| Threshold D < Input | 1 | 1 | 1 | 1 |
Parameterization
The input is assigned a signal from the signal pool via the "Input" button. In addition, dependencies on the vehicle status can also be set for the input.
The operating mode can be set using the "Module" button.
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 also be set using the "Module" button.
Details can be found in the document "Signal lists, PSM, function".
Threshold switch with hysteresis
Using the threshold switch with hysteresis, it is possible to convert an analog signal into a digital signal using a threshold switch. 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 the "Module" button.
Parameterization
The input is assigned a signal from the signal pool via the "Input" button. 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 threshold switch with hysteresis has 2 such parameters. If one or both thresholds are set to 65 535 then the affected threshold switch with hysteresis is considered as inactive and the relevant output is never set. The threshold switch with hysteresis is also regarded as inactive if the upper threshold is parameterized lower than the lower threshold.
The upper and lower threshold can be set using the "Module" button. The output of the threshold switch with hysteresis 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 8 groups. Each of these groups comprises 4 logic blocks, a timer, a counter, 2 flip-flops, a threshold switch and a threshold switch with hysteresis.
The resulting overall layout is shown in the diagram below.
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 this processing no signals in the signal pool can be changed by external sources (interior CAN (CAN-B), discrete inputs etc.). This guarantees 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 threshold switch with hysteresis).
- 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 4 PLC cycles before a current signal becomes available at the output of the final logic block.
If the same function is formed using one logic block from another group, 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.
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 CAN bus (CAN signal) "Engine speed in rpm" are used as 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 threshold switch with hysteresis of group 1 evaluates the signal "Engine speed in rpm". If the rpm is exceeds 2500 rpm, the output is set. If the rpm then drops back below 2000 rpm, the output is reset (threshold switch).
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
Example 2
The following task is to be performed in example 2. The value for motor speed is to be stored at a frequency of 1 Hz and forwarded to a threshold switch for evaluation.
To achieve this, it is first necessary to generate the measuring pulse of 1 Hz. A timer configured in the following way can be used for this purpose:
- Time 0.5 s, state-controlled
- Restart not possible with timer running
If the inverted output of the timer is now fed back to its input, the timer will be restarted again immediately after the set time has expired. The AND combination inserted in the feedback in the example makes possible the switching on and switching off of the "clock-pulse generator". In this way, clock pulses with a frequency of up to 25 Hz can be generated.
However, the frequency of the clock pulse generated in this way is still too high (2 Hz) and the duty factor does not yet correspond to 50 % (see the clock pulse characteristics in the top block diagram of the example).
This cycle alone would be completely adequate to operate an edge-controlled PLC block as a 50% duty cycle is not needed for this. However, if this signal is also to be used to, for example, make a lamp connected to a discrete output flash at a certain frequency (like in the example), it is essential to change the duty factor. An edge-controlled D flip-flop which feeds its inverted output back to its data input can be used for this purpose. The output is "toggled" every time a signal edge arrives which, in the case of 2 signal edges arriving per second, has the effect of generating a cycle with a frequency of 1 Hz and 50-% duty cycle.
This clock pulse is placed on a D flip-flop (also edge-controlled), at whose data input the engine speed is applied. As the flip-flops of the PLC can also process 16-bit values, the applied engine speed is read in every second, stored and placed on the output of the D flip-flop. The downstream threshold switch is set to the thresholds 1000 rpm, 2000 rpm and 3000 rpm, which are placed in turn on discrete outputs, and then activates the respective output depending on the rpm applied.
Example 2, assignment of discrete inputs and outputs
| Parameterizable special module (PSM) control unit component description | GF54.21-D-5005P |