DioWriteCtrlMemory

Applies To

GC5050, GX5050, GX5150, GX5295, File

Purpose

Writes a block of data to the Control memory of the specified Master board.

Syntax

DioWriteCtrlMemory (nHandle, pvVector, dwStart, dwSize, pnStatus)

Parameters

Name

Type

Comments

nHandle

SHORT

Board or File board handle.

pvVector

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 write.

dwSize

DWORD

Number of steps to write.

pnStatus

LPSHORT

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 writes 64 steps to the Master board’s Control memory beginning at step 128:

 

DWORD adwBuffer[64];

DioWriteCtrlMemory (nMasterHandle, adwBuffer, 128, 64, &nStatus);

 

See Also

DioReadCtrlMemory, DioWriteInMemory, DioWriteOutMemory, DioWriteIOMemory