Applies To
File.
Purpose
Deletes existing board entry from a DIO file previously opened using DioFileOpen command.
Syntax
DioFileDeleteBoard (hFile, nBoard, pnStatus)
Parameters
Name |
Type |
Comments |
hFile |
SHORT |
File board handle returned by the function DioFileOpen. |
nBoard |
SHORT |
The board number to delete. Board number can be 1 to 15, while 0 is for the Master. Only the last board in the file can be deleted at a time. The Master board cannot be deleted. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
As an example, if we have three boards, 0 is the Master, 1 and 2 are Slaves. If we delete board number 2, the file will have only two boards 0 (Master) and one Slave.
Example
The following example creates a DIO file, adds two boards to the file, sets the number of steps in the boards to 100,000 and then deletes board number two:
SHORT nStatus, hFile, hFileBoard1, hFileBoard2;
DioFileOpen (“newfile.dio”, 1, &hFile, &nStatus);
if (hFile!=0 && nStatus==0)
{ DioFileInsertBoard (hFile, 1, &hFileBoard1, &nStatus);
DioFileInsertBoard (hFile, 2, &hFileBoard2, &nStatus);
DioFileSetNumberOfSteps (hFile, 100000, &nStatus);
DioFileDeleteBoard(hFile, 2, &nStatus);
}
See Also
DioFileOpen, DioFileSetNumberOfSteps, DioFileClose, DioFileGetHandle, DioGetErrorString