When creating a folder, you must pass in a reference to a UCHAR to get the folder
number back from the function. The following example shows how to create and delete a
folder:
UCHAR temp;
if(IMU_MCS_SUCCESS != BMCSCreateFolder((CP_CHAR *)"test", &temp))
{
// error handling…
}
if(IMU_MCS_SUCCESS != BMCSDeleteFolder((CP_CHAR*)"test"))
{
// error handling…
}
Changing a Variable’s Name and Attributes
The MCS BIOS provides several functions to control different aspects of a variable. This
includes renaming a variable, copying and moving a variable, setting variable attributes
and searching for variables.
To rename a variable the following function is used:
int BMCSRenameVariable(CP_CHAR *pcpcFolderName,
CP_CHAR *pcpcOldValName, CP_CHAR *pcpcNewValName)
Variables also support being locked, meaning that their value cannot be altered. To lock
or unlock a variable you can use the following functions:
int BMCSVariableLockOn(CP_CHAR *pcpcFolderName, CP_CHAR *pcpcValName)
int BMCSVariableLockOff(CP_CHAR *pcpcFolderName, CP_CHAR *pcpcValName)
There are also functions to check the attributes of a variable. A variable can have the
following possible attributes:
IMU_MCS_FlagLock Folder/Variable Lock Flag
IMU_MCS_FlagUsing Folder/Variable In Use Flag
IMU_MCS_FlagUsed Folder/Variable Used Flag
IMU_MCS_FlagCursor Cursor on
IMU_MCS_FlagSelect Select on
To get or set a variable’s attributes, use the following functions:
int BMCSSetVariableAttribute (CP_CHAR *pcpcFolderName,
CP_CHAR *pcpcValName, UCHAR ucAttributeData)
int BMCSGetVariableAttribute (CP_CHAR *pcpcFolderName,
CP_CHAR *pcpcValName, UCHAR *pucAttributeData)
Here is an example that uses some of these functions:
113