DioReadIOMemory

Applies To

GX5150, GX5280, File

Purpose

Reads a block of data from the specified board (Master or Slave).

Syntax

DioReadIOMemory (nHandle, pvMemory, dwStart, dwSize, pnStatus)

Parameters

Name

Type

Comments

nHandle

SHORT

DIO or File board handle.

pvMemory

PVOID

Pointer to an array, array data type needs to comply with the I/O width settings and board type, see comments for details.

dwStart

DWORD

Starting step to read from.

dwSize

DWORD

Number of steps to store in array.

pnStatus

PSHORT

Returned status: 0 on success, negative number on failure.

Comments

The program counter will be set to zero upon return.

GX5150:

Number of channels

Array type

32

Array data type is Double Word (DWORD) when I/O configuration is set to 32-bits width (default). Maximum array size is 32M of double words.

16

Array data type is Word (WORD) when I/O configuration is set to 16-bits width (channels 0-15). Maximum array size is 64M words.

8

Array data type is Byte (BYTE) when I/O configuration is set to 8-bits width (channels 0-7). Maximum array size is 128MB.

 

GX5280:

Number of channels

Array type

32

Array data type is Double Word (DWORD) when I/O configuration is set to 32-bits width (default).

GX5281: Maximum array size is 32M of double words.

GX5282: Maximum array size is 64M of double words.

GX5283: Maximum array size is 128M of double words.

16

Array data type is Word (WORD) when I/O configuration is set to 16-bits width (channels 0-15).

GX5281: Maximum array size is 64M words.

GX5282: Maximum array size is 128M words.

GX5283: Maximum array size is 256M words.

8

Array data type is Byte (BYTE) when I/O configuration is set to 8-bits width (channels 0-7).

GX5281: Maximum array size is 128MB.

GX5282: Maximum array size is 256MB.

GX5283: Maximum array size is 512MB.

4,2,1

When configuring the Number of channels to be less than 8 bits (4, 2 or 1) the data can be unpacked after reading it using a Double Word array by using DioDataUnpack function.

Array data type is Double Word (DWORD) when I/O configuration is set to 32-bits width (default).

GX5281: Maximum array size is 32M of double words.

GX5282: Maximum array size is 64M of double words.

GX5283: Maximum array size is 128M of double words.

Note: The board must be in HALT state before calling this function.

Example

The following example reads a block of 64 DWORDs starting at step 128 (width is set to 32-bit):

 

SHORT nStatus, nTermination;

DWORD dwSteps[64];

DioReadIOMemory(nHandle, dwSteps, 128, 64, &nStatus);

 

See Also

DioWriteIOMemory, DioSetupIOConfiguration, DioGetIOConfiguration, DioGetErrorString