FB_CXReadKBusCycleUpdateTime

The function block can be used for all CXs that are operated directly with K-bus terminals. The function block determines the update time of the K-bus (K-bus runtime) with min. and max. values. The min. and max. values can be reset.
The K-bus runs task-synchronously with the PLC program. When the PLC program is completed, the K-bus is started, the outputs are written and the inputs are read. This means that a complete cycle always consists of the PLC runtime plus the K-bus update time.
- If the sum of both values is smaller than the set task cycle time, your system runs synchronously and thus optimally.
- If the sum is greater than your task cycle time, your system is no longer running in real time. It is recommended to avoid this state. 
 You fix it by adjusting the task time, revising your PLC program or reducing the size of the K-bus.
 Inputs
 Inputs
FUNCTION_BLOCK FB_CXReadKBusCycleUpdateTime
VAR_INPUT
    bExecute            : BOOL;        // rising edge triggers read process
    bReset              : BOOL;        // set TRUE to reset the min. and max. values
END_VAR
| Name | Type | Description | 
|---|---|---|
| bExecute | BOOL | A positive edge starts the function block. | 
| bReset | BOOL | Reset of min. and max. values | 
 Outputs
 Outputs
VAR_OUTPUT
    bBusy               : BOOL;     // FB is in process
    bError              : BOOL;     // FB has an error
    nErrorID            : UDINT;    // ADS Error Code
    nKBusMinUpdateTime  : UINT;     // min. cycle update time in [µs]
    nKBusMaxUpdateTime  : UINT;     // max. cycle update time in [µs]
    nKBusLastUpdateTime : UINT;     // last cycle update time in [µs]
END_VAR| Name | Type | Description | 
|---|---|---|
| bBusy | BOOL | The function block is active and working. | 
| bError | BOOL | The function block has an error. | 
| nErrorID | UDINT | ADS error code | 
| nKBusMinUpdateTime | UINT | Minimum update time in [µs] of the K-bus | 
| nKBusMaxUpdateTime | UINT | Maximum update time in [µs] of the K-bus | 
| nKBusLastUpdateTime | UINT | Last update time in [µs] of the K-bus | 
| Development environment | Target platform | PLC libraries to include | 
|---|---|---|
| TwinCAT v3.1.4024.22 | CX (x86, x64, Arm®) | Tc2_SystemCX (System) >= 3.4.7.0 |