Applies To
File.
Purpose
Returns number of steps in DIO file previously opened using DioFileOpen command.
Syntax
DioFileGetNumberOfSteps (hFile, pdwSteps, pnStatus)
Parameters
Name |
Type |
Comments |
hFile |
SHORT |
File board handle returned by the function DioFileOpen. |
pdwSteps |
PDWORD |
Step number can be between 1K to the maximum number of steps allowed for the specific board. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
The number of steps is equal for all the file boards in the DIO file.
Note: The board with maximum number of steps limits the maximum numbers of steps that can be added to other boards. That is, if we have a Master with width set to 16 and a Slave with width set to 32, then the maximum steps can be 32M.
The file handle (hFile) that is associated with this file is return by DioFielOpen or by calling DioFileGetHandle.
Example
The following example creates a DIO file, adds a board and sets the number of steps in the board to 100K and then returns the number of steps in the file:
SHORT nStatus, hFile, hFileBoard;
DWORD dwSteps;
DioFileOpen (szfilename, 1, &hFile, &nStatus);
if (hFile!=0 && nStatus==0)
{ DioFileInsertBoard (hFile, 1, &hFileBoard, &nStatus);
DioFileSetNumberOfSteps (hFile, 100000, &nStatus);
DioFileGetNumberOfSteps(hFile, &dwSteps, &nStatus);
if (dwSteps!=100000)
prints(“Error: mismatch number of steps in file”);
return;}
}
See Also
DioFileSetNumberOfSteps, DioFileOpen, DioFileClose, DioFileInsertBoard