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: aPwmInput : ARRAY[1..nNumPwmOut] OF FLOAT; aStWaitTimesConfig : ARRAY[1..nNumPwmOut] OF ST_CTRL_MULTIPLE_PWM_OUT_TIMES; aStPwmOutputs : ARRAY[1.. nNumPwmOut] OF ST_CTRL_MULTIPLE_PWM_OUT_OUTPUTS; aStPwmDataVars : ARRAY[1.. nNumPwmOut] 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 should the structures contained in the array ar_stPwmDataVars be changed within the PLC program. This procedure is also illustrated in the sample program listed below. Inputs VAR_INPUT eMode : E_CTRL_MODE; END_VAR VAR_OUTPUT eState : E_CTRL_STATE; bError : BOOL; eErrorId : E_CTRL_ERRORCODES; END_VAR Outputs TF4100 137 Version: 2.2.4 Name Type Description eMode E CTRL MODE _ _ Input that specifies the operation mode of the function block.