GX5701
Returns the Module’s Port Data.
Gx5733ModuleGetPort (nHandle, nPort, pdwData, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a GX5733 board. |
nPort |
SHORT |
Module port 0 (GX5733_PORT0) only. |
pdwData |
PDWORD |
Returned port double word value: 0 to -0xFFFFFFFF. Where bit 0 corresponds to channel 0 and bit 31 to channel 31. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
This function allows the module to be used as a port in. Prior to calling this function the module’s operating mode needs to be set to Port I/O (GX5733_MODULE_OPERATION_PORT_IO). Use the Gx5733ModuleSetOperationMode to set the module’s operating mode.
If no Module is installed in the specified Module’s port, the port is functioning as Digital Port Input only. Calling this function will return the Port input data
Note: Calling this function will clear the Module’s buffer.
The following example reads the module port 0 data:
SHORT nStatus;
DWORD dwData;
Gx5733ModuleGetPort (nHandle, GX5733_PORT0, &dwData, &nStatus);
Gx5733ModuleSetOperationMode, Gx5733ModuleGetOperationMode, Gx5733ModuleSetPort