beckhoff TF4100 — 4.2.1.1.3 FB_CTRL_LOOP_SCHEDULER

PLC API fbCTRL_PT1 : FB_CTRL_PT1; stCTRL_PT1_Params :

ST_CTRL_PT1_PARAMS; END_VAR fbCTRL_GET_TASK_CYCLETIME( eMode := eCTRL_MODE_ACTIVE, tTaskCycleTime => tTaskCycleTime, bCycleTimeValid => bCycleTimeValid, eState => eCTRL_MODE_ACTIVE, eErrorId => eErrorId, bError => bError ); IF fbCTRL_GET_TASK_CYCLETIME.bCycleTimeValid THEN IF bInit THEN stCTRL_PT1_Params.tTaskCycleTime := fbCTRL_GET_TASK_CYCLETIME.tTaskCycleTime; stCTRL_PT1_Params.tCtrlCycleTime := T#100ms; stCTRL_PT1_Params.fKp := 1.0; stCTRL_PT1_Params.tT1 := T#10s; stCTRL_PI_Params.tTaskCycleTime := fbCTRL_GET_TASK_CYCLETIME.tTaskCycleTime; stCTRL_PI_Params.tCtrlCycleTime := T#100ms; stCTRL_PI_Params.fKp := 0.5; stCTRL_PI_Params.tTn := T#5s; stCTRL_PI_Params.fOutMaxLimit := 100.0; stCTRL_PI_Params.fOutMinLimit := 0.0; bInit := FALSE; END_IF fbCTRL_PI( fActualValue := fbCTRL_PT1.fOut, fSetpointValue := fSetpointValue, eMode := eCTRL_MODE_ACTIVE, stParams := stCTRL_PI_Params ); fbCTRL_PT1( fIn := fbCTRL_PI.fOut, eMode := eCTRL_MODE_ACTIVE, stParams := stCTRL_PT1_Params, fOut => fActualValue ); END_IF 4.2.1.1.3 FB_CTRL_LOOP_SCHEDULER This function block allows the system load to be distributed over a number of control loops that are parameterized using the same tCtrlCycleTime and for which the condition "tCtrlCycleTime > tTaskCycleTime" is true.

The output vector calculated by this function block is used to start the individual control loops at different times, so that the system loading is distributed. TF4100 23 Version: 2.2.4