Enables or disables the specified open collector.
Gx3722OpenCollectorSetEnable (nHandle, nState, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX3722 board. |
nState |
PSHORT |
Specifies a bit mask containing the state of the open collector. Each bit corresponds to the state of an Open Collector channel with bit 0 corresponding to channel 1, bit 1 is channel 2 and bit 2 is channel 3. The state of each bit is as follows:0. GX3722_OPEN_COLLECTOR_DISABLE.1. GX3722_OPEN_COLLECTOR_ENABLE. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Enabling will bias the gate of the Open Collector, creating a path from the Open Collector channel input pin to Ground via a 0.02Ω resistor. The voltage drop across this resistor is then amplified and used for overcurrent sensing.
The following example enables the open collector and retrieves the overcurrent state of Open Collector channel 1:
SHORT nOvercurrent;
Gx3722OpenCollectorSetEnable (nHandle, GX3722_OPEN_COLLECTOR_ENABLE, &nStatus);
Gx3722OpenCollectorGetOvercurrent (nHandle, &nOvercurrent, &nStatus);
Gx3722OpenCollectorGetEnable, Gx3722OpenCollectorGetOvercurrent, GxFpgaGetErrorString