Applies To
GC5050, GX5050, GX5055, GX5150, GX5280, GX5290, GX5290e, GX5295, File
Purpose
Fills the board memory or file data with pre-defined patterns.
Syntax
DioMemoryFill (nHandle, nPatern, nMemory, dwStart, dwSize, pnStatus)
Parameters
Name |
Type |
Comments |
nHandle |
SHORT |
DIO or File board handle. |
nPatern |
SHORT |
Set the memory patterns as follow: 0 DIO_MEMFILL_ZERO: Fill with Zeros. 1 DIO_MEMFILL_RAMP: Fill with Ramp. 2 DIO_MEMFILL_CONTINUES_RAMP: Fill with continuous Ramp. 3 DIO_MEMFILL_RANDOM: Fill with Random. 4 DIO_MEMFILL_CHECKER_BOARD: Checker board. 5 DIO_MEMFILL_ONE: Fill with Ones |
nMemory |
SHORT |
Select the memory to fill: GC5050, GX5050 and File: 0 IN_ARRAY: In memory 1 OUT_ARRAY: Out memory 3 CTRL_ARRAY: Control memory GX5280 and GX5280 File: 2 DATA_ARRAY: I/O data memory GX5290/GX5290e/GX5295 and GX5290/GX5290e/GX5295 File: 0 IN_ARRAY: In memory 1 OUT_ARRAY: Out memory 4 DIRECTION_ARRAY: Direction memory GX5055 and File: 0 IN_ARRAY: In memory 1 OUT_ARRAY: Out memory 3 CTRL_ARRAY: Control memory 4 DIRECTION_ARRAY: Direction memory 5 VALID_DATA_ARRAY: Valid data array memory |
dwStart |
DWORD |
Starting step number. |
dwSize |
PDWORD |
Number of steps to fill. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
This function fills steps starting at dwStart to the specified board or file starting at dwStart up to dwSize. The patterns are filled as follows:
0 Fill with Zeros - reset those steps to zero.
1 Fill with Ramp - positive ramp starts from zero, the last step or the current width setting (GX5150) limits the last value. If the width setting limits the ramp, then the last value will be filled for the remaining steps. For example, if the width was set to 8-bits and number of steps to 512, then the steps from 255 up to 512 will have the value of 255 (0xFF).
2 Fill with continues Ramp - a positive ramp start from zero. If the ramp reaches its max value due to the width, then the next step will start another ramp. For example, if the width was set to 8-bits and number of steps to 512, then at step 256 new ramp will start.
3 Fill with Random - random values with a random seed value.
4 Checker board - First step value is 0x55555555, next is 0xAAAAAAA.
5 Fill with Ones - set those steps to ones.
After the function is called, the program counter is set to zero.
Example
The following example initializes a Master board and fills the first 16K steps with a ramp:
DWORD dwSize=0;
DioInitialize (0, &nMasterHandle, &nStatus);
DioMemoryFill (nMasterHandle, 1, 0, 0, 16384, &nStatus);
See Also
DioWriteInMemory, DioWriteOutMemory, DioWriteIOMemory, DioReadInMemory, DioReadOutMemory, DioReadIOMemory, DioGetErrorString