GtDio6xFileClose

Applies To

GX5296, GX5961, GX5964, File

Purpose

Closes file access and commits the file settings from memory, to a file on disk.

Syntax

GtDio6xFileClose (hFile, pnStatus)

Parameters

Name
Type
Comments
hFile
PSHORT
Session identifier:

     File handle is used when communicating with a file. The File handle session identifier is  returned by calling GtDio6xFileOpen.

pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

This function writes a file to disk as specified by a previous call to GtDio6xFileOpen. After this call, the handle hFile will no longer be valid.

Example

The following example opens an existing file, sets the Channel 5 output voltage settings to Voh=10V and Vol=4V. The file is then closed.

 

SHORT nStatus;

LONG   alChannelList[1];

 

alChannelList[0]=5;

 

GtDio6xFileOpen(“C:\\MyFile.dio6x”, GTDIO6X_FILE_READ_WRITE, GTDIO6X_FILE_BOARD_TYPE_GX5960, &hFile, &nStatus);

GtDio6xChannelSetSourceLevels (hFile, 1, alChannelList, 10.0, 4.0, &nStatus);

GtDio6xFileClose(hFile, &nStatus);

 

See Also

GtDio6xFileOpen, GtDio6xFileSetChannelCount, GtDio6xFileSetTimingBoardCount, GtDio6xFileLoad GtDio6xFileSave, GtDio6xGetErrorString