GtDio6xFileSave

Applies To

GX5296, GX5961, GX5964

Purpose

Saves domain settings and data to a file on disk.

Syntax

GtDio6xFileSave (nHandle, pszFileName, dwStartStepOrVector,, dwNumOfStepsOrVectors,, dwFlags, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Session identifier:

     Board handle is used when communicating with the hardware. The Board handle session identifier is returned by calling GtDio6xInitialize or GtDio6xSetupInitialization.

pszFileName
PSTR
Specifies the file to load.  Use "\\" for paths.
dwStartStepOrVector
DWORD
Domain starting step or vector. This parameter depends on the dwFlags settings. If dwFlags is set to 0x10000 (GTDIO6X_FILE_SAVE_RANGE_OF_VECTORS), then it represents the starting vector memory offset. Otherwise, it represents the starting step to be saved.  
dwNumOfStepsOrVectors
DWORD
Number of steps or vectors to save. This parameter depends on the dwFlags settings. If dwFlags is set to 0x10000 (GTDIO6X_FILE_SAVE_RANGE_OF_VECTORS), then it represents the number of vectors to be saved. Otherwise, it represents number of steps to save.
Setting dwNumOfStepsOrVectors to 0 will use the actual maximum defined vector size or maximum number of steps.
dwFlags
DWORD
The dwFlags allows the user to control which sections in the file will be saved to the boards in order to speed up the save process. Each bit in the represent a section in the file as follows:
0x00000: GTDIO6X_FILE_SAVE_ALL - Save all the DIO boards data and settings to the DIO file.
0x00001: GTDIO6X_FILE_SAVE_VECTORS - Save all the DIO boards vector data to the DIO file.
0x00002: GTDIO6X_FILE_SAVE_RECORD - Save all the DIO boards record data to the DIO file.
0x00004: GTDIO6X_FILE_SAVE_CH_SETTINGS - Save all the DIO boards channels setting to the DIO file.
0x00008: GTDIO6X_FILE_SAVE_STEP_SETTINGS - Save all the DIO boards steps setting to the DIO file.
0x00010: GTDIO6X_FILE_SAVE_TIMING_SETTINGS - Save all the DIO timing setting to the DIO file.
0x00020: GTDIO6X_FILE_SAVE_GENERAL_SETTINGS - Save all the DIO boards general settings (e.g. sequencer settings, trigger settings) to the DIO file.
0x10000: GTDIO6X_FILE_SAVE_RANGE_OF_VECTORS - Save only the vector memory to the DIO file, the dwStartStepOrVector parameter specifies the boards starting vector location, dwNumOfStepsOrVectors specifies number of vectors to write cannot be combined with any other flag).
0x00110: GTDIO6X_FILE_SAVE_AUX_CH_SETTINGS - Save Aux channels setting to the DIO file.
pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

The function loads a configuration file that was saved using GtDio6xFileSave. The default file extension used for the file is dio6x. The file contains the domain settings, channel settings, vector memory, record memory, and Step memory. This function loads steps starting at dwStartStepOrVector in vector memory, until dwNumOfStepsOrVectors are loaded. This function will attempt to load as many channels and data vectors it can from the file for a given domain configuration. The configuration file supports two file formats:

     HDF file format: (*.dio6x as its extension default extension) uses the Hierarchical Data Format file format. This extension most suitable to handle fast load and save data.

     XML file format: (*.dio6xml as its extension) uses an XML schema, the data vector section of the file is compressed when stored in the XML file.

Example

The following example saves 100 vectors to MyFile.dio6x to a domain starting at vector address 0:

 

SHORT nStatus;

 

GtDio6xFileSave(nHandle, “C:\\MyFile.dio6x”, 0, 100, GTDIO6X_FILE_SAVE_ALL, &nStatus);

 

See Also

GtDio6xFileOpen, GtDio6xFileClose, GtDio6xFileSetChannelCount, GtDio6xFileSetTimingBoardCount, GtDio6xFileLoad, GtDio6xFileSave, GtDio6xGetErrorString