Applies To
File.
Purpose
Returns the specified boards handle from a DIO file previously opened using DioFileOpen command.
Syntax
DioFileGetBoardHandle (hFile, nBoard, phFileBoard, pnStatus)
Parameters
Name |
Type |
Comments |
hFile |
SHORT |
File board handle returned by the function DioFileOpen. |
nBoard |
SHORT |
The board numbers can be: 0: Master 1 to 15: Slaves. |
phFileBoard |
PSHORT |
The specified boards handle. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
Using the file board handle while calling different functions will store/retrieve that setting to/from the specific file board. Any function that the Applies To applies also to File can be accessed using the file handle.
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 gets both file boards handles. It is then sets trigger mode T and sets the D and P event values.
File number 1 will have trigger settings.
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);
DioSetupTriggerMode(hFile, 2, &nStatus);
DioSetupTriggerDEvent(hFile, 0x1234, 0xAA55, &nStatus);
DioSetupTriggerPEvent(hFile, 0, 0xFFFF, &nStatus);
}
See Also
DioFileGetNumberOfSteps, DioFileOpen, DioFileClose, DioFileGetHandle, DioGetErrorString