Applies To
File.
Purpose
Sets the number of steps for all boards in a file previously opened using DioFileOpen command.
Syntax
DioFileSetNumberOfSteps (hFile, dwSteps, pnStatus)
Parameters
Name |
Type |
Comments |
hFile |
SHORT |
File board handle returned by the function DioFileOpen. |
dwSteps |
DWORD |
Number of steps. Can have the following values: Min. number: 1024 (all boards) Max. number GC5050/GX5050: 1M Max. number GX5055: 512K Max. number GX5150: 32M width set to 32, 64M width set to 16, 128M width set to 8 Max. number GX5280:32M (GX5281), 64M (GX5282), 128M (GX5283) Max. number GX5290: 64M (GX5292/GX5293) |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
If the new number of steps is less than the previous value, the extra steps will be truncated. If the new number of step is bigger than the previous value then the extra steps will be added at the end of the file, not changing the previous step’s data.
Note: The board with maximum number of steps limits the maximum numbers of steps that can be added. That is, if we have a Master with width set to 16 and a Slave with width set to 32, then the maximum number of steps can be 32M.
Example
The following example creates a DIO file, adds two boards to the file, sets the number of steps in the boards to 100K and then gets both file boards handles:
SHORT nStatus, hFile, hFileBoard1, hFileBoard2;
DioFileOpen (szfilename, 1, &hFile, &nStatus);
if (hFile!=0 && nStatus==0)
{ DioFileInsertBoard (hFile, 1, &hFileBoard1, &nStatus);
DioFileInsertBoard (hFile, 2, &hFileBoard2, &nStatus);
DioFileSetNumberOfSteps (hFile, 100000, &nStatus);
DioFileGetBoardHandle(hFile, 1, &hFileBoard1, &nStatus);
DioFileGetBoardHandle(hFile, 2, &hFileBoard2, &nStatus);
}
See Also
DioFileGetNumberOfSteps, DioGetErrorString