Name: sysAOasOC_extended

Type: Function

Return value: USINT

Language type:

Description:

Act AO4 or/and AO5 as open collector outputs. Provide the possibility to obtain a 1ms resolution PWM. Max period is 131072 ms, min period 2ms. When the function is called its parametres are sent to BIOS handling. Close command or 3-state command act immediately, refresh in PWM mode acts at the end of the running period. If the function is continuously called its return is the state of the open collector output sampled when the function is called (if not in error). The function return an USINT which could have the following meanings: 0 = Open Collector AOx Closed 1 = Open Collector AOx 3-state 2 = Error, open collector not driven. An error accour if AOx is not configured as Current ON/OFF and if sysLocalAnalogOutput[x-1] isn't 0 and if time_3state or time_close are zero in PWM mode.

Input:

Name Type Description
index USINT Analog Output to drive as Open Collector [4,5]
time_3state UINT Time with Open Collector in 3-state, must be greater than 0 in PWM [ms]
time_close UINT Time with Open Collector close, must be greater than 0 in PWM [ms]
cmd USINT Command: [0=Close,1=3-state,2=PWM]