UCHAR attr;
OBCD dat;
Cal_setn_OBC(5,&dat);
// Create x=5
BMCSCreateVariable((CP_CHAR*)"main", (CP_CHAR*)"x", IMU_MCS_TypeReal,
sizeof(OBCD), (UCHAR*)&dat);
// Rename x to y
BMCSRenameVariable((CP_CHAR*)"main", (CP_CHAR*)"x", (CP_CHAR*)"y");
// Lock y
BMCSVariableLockOn((CP_CHAR*)"main",(CP_CHAR*)"y");
// Get the attributes of y
BMCSGetVariableAttribute((CP_CHAR*)"main",(CP_CHAR*)"y", &attr);
// Check to see if the lock is set on y
if ((attr & IMU_MCS_FlagLock) != 0)
{
// The lock is on, so we will turn it off
BMCSVariableLockOff((CP_CHAR*)"main",(CP_CHAR*)"y");
}
else
{
// The lock is off, so we will turn it on
BMCSVariableLockOn((CP_CHAR*)"main",(CP_CHAR*)"y");
}
Moving/Copying and Finding a Variable
To copy or move an MCS variable, the following functions are provided:
int BMCSCopyVariable (CP_CHAR *pcpcSourceFolderName,
CP_CHAR *pcpcSourceValName, CP_CHAR *pcpcDestFolderName,
CP_CHAR *pcpcDestValName)
int BMCSMoveVariable (CP_CHAR *pcpcSourceFolderName,
CP_CHAR *pcpcSourceValName, CP_CHAR *pcpcDestFolderName,
CP_CHAR *pcpcDestValName)
If after moving a variable, you need to find it, there are three functions that allow you to
search for a variable:
int BMCSSearchVariable (CP_CHAR *pcpcFolderName, CP_CHAR *pcpcValName,
UCHAR *pucValType, UCHAR **ppucManTopAdr,
UCHAR **ppucDataTopAdr, DWORD *pdwDataSize)
int BMCSSearchVal2 (CP_CHAR *pcpcFolderName, CP_CHAR *pcpcValName,
CP_CHAR *pcpcValName2, UCHAR ucLength)
int BMCSSearchVal3 (CP_CHAR *pcpcFolderName, CP_CHAR *pcpcValName,
VALMANSTRUCT **ppValMan, UCHAR ucLength)
114