PLC-API Description of the output behavior (2): The programmer must create the following arrays in the PLC if this function block is to be used: ar_fPwmInput : ARRAY[1..nNumberOfPwmOutputs] OF FLOAT; ar_stWaitTimesConfig : ARRAY[1..nNumberOfPwmOutputs] OF ST_CTRL_MULTIPLE_PWM_OUT_TIMES; ar_stPwmOutputs : ARRAY[1..nNumberOfPwmOutputs] OF ST_CTRL_MULTIPLE_PWM_OUT_OUTPUTS; ar_stPwmDataVars : ARRAY[1..nNumberOfPwmOutputs] OF ST_CTRL_MULTIPLE_PWM_OUT_DATA; The input values for the individual channels of the PWM function block are written into the ar_fPwmInput array. The programmer can specify the parameterizable times for the individual channels in the ar_stWaitTimesConfig array.
The function block writes the output bits into the ar_stPwmOutputs array. The internal data required by the function block is stored in the ar_stPwmDataVars array. Under no circumstances the structures contained in the last-named array may not be changed in the PLC program. This procedure is also illustrated in the sample program listed below. VAR_INPUT VAR_INPUT eMode : E_CTRL_MODE; END_VAR eMode : Input that specifies the block's operating mode. VAR_OUTPUT VAR_OUTPUT eState : E_CTRL_STATE; bError : BOOL; eErrorId : E_CTRL_ERRORCODES; END_VAR eState : State of the function block. eErrorId : Supplies the error number [ } 16] when the bError output is set. bError :
Becomes TRUE, as soon as an error occurs. TS4100 124 Version: 1.1