Saving and Loading via SDK

Saving the Applet Configuration to File

For saving applet configuration files, the following function is available in the Silicon Software SDK (library fglib5.lib, header file fgrab_prototyp.h):

int Fg_saveConfig (Fg_Struct *Fg, const char *Filename)

Parameters:

Fg: Frame grabber (board index) in your system. Specify here the frame grabber from which you want to save the active configuration (active applet and its parametrization).

Filename: Specify here the name of and the path to the configuration file. File extension is always *.mcf.

If the applet configuration contains field values, an additional *.mfs file is created that contains all field parameter values of the applet configuration. The MFS file is created automatically if the applet contains field parameters.

Loading the Applet Configuration from File

For loading an applet configuration from file, various functions are available (library fglib5.lib, header file fgrab_prototyp.h):

Frame Grabber Initialization

You can initialize a board directly via an *.mcf file. As the MCF file contains the applet name, the frame grabber board is initialized with the applet specified in the MCF file, and the applet configuration (parametrization) stored in the *.mcf file is already set on the frame grabber.

If your applet configuration contains field parameters and an according *.mfs file is stored in the same directory as the *.mcf file, the field parameters are loaded automatically when you call this function.

Fg_Struct* Fg_InitConfig (const char * Config_Name, unsigned int BoardIndex)

Parameters:

Config_Name: Specify here the name of and the path to the configuration file. File extension is always *.mcf.

BoardIndex: Specify here (via its board index) the frame grabber which you want to initialize with the *.mcf file. After calling Fg_InitConfig, the frame grabber is initialized with the applet named in the *.mcf file and the applet configuration specified in the same file.

Loading Applet Configuration

You can also load the configuration of an applet after you have already initialized a frame grabber with the applet.

Prerequisites for using this function:

If your applet configuration contains field parameters, and an according *.mfs file is stored in the same directory as the *.mcf file, the field parameters are loaded automatically when you call this function.

Function for loading the applet configuration after frame grabber initialization:

int Fg_loadConfig (Fg_Struct *Fg, const char *Filename)

Parameters:

Fg: Specify here the frame grabber (via board index) which you want to parametrize with the applet configuration contained in the *.mcf file.

Filename: Specify here the name of and the path to the configuration file. File extension is always *.mcf.

Releasing Frame Grabber Resources

 

Don't forget to release frame grabber resources after using the frame grabber via function

int Fg_FreeGrabber (Fg_Struct *Fg)

This function also frees frame buffer that has been allocated for this frame grabber board earlier via Fg_AllocMem().