Sets the eight digital output lines output enables and values.
Gx3348SetDigitalOutputs (nHandle, dwOutputsEnabled, dwData, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a GX3348 board. |
dwOutputsEnabled |
DWORD |
Bits 0-7 represent the 8 digital outputs lines inputs. Bit zero corresponds to digital I/O line 0.Bit high will enable the specified digital output.Bit low will disable the specified digital output (default after reset). |
dwData |
DWORD |
Bits 0-7 represent the 8 digital inputs. Bit zero corresponds to digital I/O line 0.Bit high will output logic high.Bit low will output a logic low (default after reset). |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Each of the 8 Output digital lines is also connected to an input line. If the output line is not enabled, then an external digital input can be monitored using this function. Otherwise if the line output is enabled, the function returns the output line logical state.
The following example sets the lower 4 digital outputs lines to hi and the upper 4 lines to low, all odd lines (1, 3, etc) outputs are then enabled. The digital lines actual states are then read back.
SHORT nStatus;
DWORD dwOutputsEnabled, dwData;
DWORD dwDigitalInputs.
Gx3348SetDigitalOutputs (nHandle, 0x55, 0x0F, &nStatus);
Gx3348GetDigitalOutputs (nHandle, &dwOutputsEnabled, &dwData, &nStatus);
Gx3348GetDigitalInputs (nHandle, &dwDigitalInputs, &nStatus);
Gx3348GetDigitalOutputs, Gx3348GetDigitalInputs, GxPdoGetErrorString