Applies To
GX5150, GX5280, File
Purpose
Writes a block of data to the specified board (Master or Slave).
Syntax
DioWriteIOMemory (nHandle, pvMemory, dwStart, dwSize, pnStatus)
Parameters
Name |
Type |
Comments |
nHandle |
SHORT |
Master or File board handle. |
pvMemory |
PVOID |
Pointer to an array, array data data type needs to comply with the I/O width settings and board type, see comments for details. |
dwStart |
DWORD |
Starting step to write from. |
dwSize |
DWORD |
Number of steps to write. |
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. |
When configuring the Number of channels to be less than 8 bits (4, 2 or 1) the data needs to be packed to 32-bit wide using DioDataPack function.
Note: The board must be in HALT state before calling this function.Example
The following example reads a block of 64 DWORDs stating at step 128 (width is set to 32-bit):
SHORT nStatus;
DWORD dwSteps[64];
DioWriteIOMemory(nHandle, dwSteps, 128, 64, &nStatus);
See Also
DioReadIOMemory, DioSetupIOConfiguration, DioGetIOConfiguration, DioGetErrorString