Gx5731ModuleSetPort

Applies To

GX5702, GX5704

Purpose

Sets the Module’s Port Data.

Syntax

Gx5731ModuleSetPort  (nHandle, nPort, dwData, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5731 board.
nPort
SHORT
Specified Module's port number:
0. GX5731_PORT0: Module port 0
1. GX5731_PORT1: Module port 1
2. GX5731_PORT2: Module port 2.  
dwData
DWORD
Sets the port word value: 0-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.

Comments

This function allows the module to be used as a port out. Prior to calling this function the module’s operating mode needs to be set to Port I/O (GX5731_MODULE_OPERATION_PORT_IO). Use the Gx5731ModuleSetOperationMode to set the module’s operating mode.

Note: Calling this function will clear the Module’s buffer.

Example

The following example sets the module port 0 data:

 

SHORT nStatus;

Gx5731ModuleSetPort (nHandle, GX5731_PORT0, 0xAAAA5555, &nStatus);

 

See Also

Gx5731ModuleSetOperationMode, Gx5731ModuleGetOperationMode, Gx5731ModuleGetPort