GxAoDioWriteChannelMemory

Purpose

Writes DIO direction, input or output memory per DIO channel

Applies

GX1649, GX1649-1

Syntax

GxAoDioWriteChannelMemory (nHandle, nChannel, nMemoryType, pucVector, dwSize, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX1649 board.
nChannel
SHORT
DIO Channel (0-7).
nMemoryType
SHORT
Type of Memory to write to:
0.   GX1649_DIO_MEMORY_INPUT_TYPE: Write to DIO Input Memory.
1.   GX1649_DIO_MEMORY_OUTPUT_TYPE: Write to DIO Output Memory.
2.   GX1649_DIO_MEMORY_DIRECTION_TYPE: Write DIO Direction Memory.
pucVector
PBYTE
Buffer to hold an array of bytes that represent the memory states. Buffer size used is specified using the dwSize parameter.
dwSize
DWORD
The number of vectors to write to memory.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each element in the byte array represents the direction, input or output state of one DIO channel. A value of 0 or 1 is returned for each element as specified by nMemoryType:

Example

The following example writes 1000 vectors to the output DIO memory of channel 5:

 

SHORT nStatus;

BYTE  aucVector[1000];

 

GxAoDioSetVectorCount(nHandle, 1000, &nStatus);

GxAoDioWriteChannelMemory (nHandle, 5, GX1649_DIO_MEMORY_OUTPUT_TYPE, aucVector, 1000, &nStatus);

 

See Also

GxAoDioReadChannelMemory, GxAoDioSetVectorCount, GxAoDioWriteMemory, GxAoGetErrorString