DioFileInsertBoard

Applies To

File.

Purpose

Inserts a File Board to a DIO file previously opened using DioFileOpen command.

Syntax

DioFileInsertBoard (hFile, nBoard, phFileBoard, pnStatus)

Parameters

Name

Type

Comments

hFile

SHORT

File handle associated with this File.

nBoard

SHORT

The board number to insert.

Board number can be between 1 and 8. 0 is for the Master. The inserted board will become the last board.

phFileBoard

PSHORT

Returns a handle for later reference with this File Board (0 for error).

pnStatus

PSHORT

Returned status: 0 on success, negative number on failure.

Comments

The file handle (hFile) that is associated with this file is return by DioFileOpen or by calling DioFileGetHandle.

The inserted board will have the same number of steps and channels as the Master. For example, if the Master was set to 16-bit wide and 32K steps, then the added Slave board will have the same parameters.

Example

The following example creates a DIO file, adds a board and sets the number of steps in the board to 100K:

 

SHORT nStatus, hFile, hFileBoard;

DioFileOpen (szfilename, 1, &hFile, &nStatus);

if (hFile!=0 && nStatus==0)

{ DioFileInsertBoard (hFile, 1, &hFileBoard, &nStatus);

  DioFileSetNumberOfSteps (hFile, 100000, &nStatus);

}

 

See Also

DioFileSetNumberOfSteps, DioFileGetNumberOfSteps, DioFileOpen, DioFileClose, DioFileGetBoardHandle, DioGetErrorString