Applies To
GC5050, GX5050, GX5055, GX5150, File
Purpose
Reads a block of control memory.
Syntax
DioReadCtrlMemory (nHandle, pvMemory, dwStart, dwSize, pnStatus)
Parameters
Name |
Type |
Comments |
nHandle |
SHORT |
DIO or File board handle. |
pvMemory |
PVOID |
Pointer to an array of type void. The array type depends on the board type as follows: GX5055: Array data type is Double Word and maximum array size is 512K of double words. GC5050, GX5050: Array data type is Double Word and maximum array size is 1M of double words. GX5150: Array type must be BYTE. |
dwStart |
DWORD |
Starting address to read. |
dwSize |
DWORD |
Number of steps to read. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
GC5050/GX5050/GX5055: Each step is controlled by one control (DWORD).
GX5150: Each control byte controls eight data bytes in the I/O memory as follows:
I/O memory width was set to 32-bit - each control byte controls two steps.
I/O memory width was set to 16-bit - each control byte controls four steps.
I/O memory width was set to 8-bit - each control byte controls eight steps.
See Appendix B for control memory content.
Note: The board must be in HALT state before calling this function.
The program counter will is set to zero upon return.
Example
The following example reads 64 steps from the Master board input memory beginning at step 128:
DWORD adwControl[64];
DioReadCtrlMemory (nMasterHandle, adwControl, 128, 64, &nStatus);
See Also
DioWriteCtrlMemory, DioGetErrorString