User Defined Type Functions

User defined data types should be added to the Data Archiver before they can be used in tags. The User defined type functions are as follows:

ihUserDefinedTypeAdd

This function is used to add a user defined type.

Prototype

ihUserDefinedTypeAdd(

ihServerHandle hServer, // server handle returned from previous call to ihServerConnect 

ihUserDefinedTypeProperties *UserDefinedType, // structure containing the user defined type

ihString *ErrorMsg // output parameter to contain any error string if there is error. The memory, if there is an error,
will be allocated in the System API and should be freed using ihUserDefinedTypeFreeError
);

Remarks

If the set already exists, it is overwritten by this new set. You need to be an ihTagAdmin to add or modify a set. The memory, if there is an error, will be allocated in the System API and should be freed using ihUserDefinedTypeFreeErrorMessage.

Returns

Returns StatusMessage
ihSTATUS_OK On success.
ihSTATUS_API_TIMEOUTIf the server name or IP address provided cannot be located.
ihSTATUS_NOT_CONNECTED If you are not currently connected.
ihSTATUS_ACCESS_DENIEDIf you are not allowed to add or modify the user defined types, perhaps you are not a member of the ihTagAdmins group.
ihSTATUS_FAILEDFor any other type of error.

ihUserDefineTypeDelete

This function is used to delete a user defined type.

Prototype

ihUserDefinedTypeDelete(

ihServerHandle hServer, // server handle returned from previous call to ihServerConnect

ihString UserDefinedTypeName, // the name of the user defined type. Any characters can be used other than * or ?

ihString *ErrorMsg // output parameter to contain any error string if there is error. The memory, if there is an error,
will be allocated in the System API and should be freed using ihUserDefinedTypeFreeError
);

Remarks

You need to be an ihTagAdmin to be able to delete a User Defined type. The memory, if there is an error, will be allocated in the System API and should be freed using ihUserDefinedTypeFreeErrorMessage.

Returns StatusMessage
ihSTATUS_OK On success.
ihSTATUS_API_TIMEOUTIf the server name or IP address provided cannot be located.
ihSTATUS_NOT_CONNECTED If you are not currently connected.
ihSTATUS_ACCESS_DENIEDIf you are not allowed to add or modify the user defined types, perhaps you are not a member of the ihTagAdmins group.
ihSTATUS_FAILEDFor any other type of error.

ihUserDefinedTypeRename

This function is used to rename the existing user defined type name.

Prototype

ihUserDefinedTypeRename(

ihServerHandle hServer, // server handle returned from previous call to ihServerConnect 

ihString UserDefinedTypeName, // the current name of the user defined type

ihString NewUserDefinedTypeName // the new name
);
Remarks

After you rename, the old name is available for reuse.

Returns

Returns StatusMessage
ihSTATUS_OK On success.
ihSTATUS_API_TIMEOUTIf the server name or IP address provided cannot be located.
ihSTATUS_NOT_CONNECTED If you are not currently connected.
ihSTATUS_ACCESS_DENIEDIf you are not allowed to add or modify the user defined types, perhaps you are not a member of the ihTagAdmins group.
ihSTATUS_FAILEDFor any other type of error.

ihUserDefinedTypeExists

Use this function to check whether the user defined type exists or not.

Prototype

ihUserDefinedTypeExists(

ihServerHandle hServer, // server handle returned from previous call to ihServerConnect 

ihString UserDefinedTypeName // the name to check
);
Returns StatusMessage
ihSTATUS_OK On success.
ihSTATUS_API_TIMEOUTIf the server name or IP address provided cannot be located.
ihSTATUS_NOT_CONNECTED If you are not currently connected.
ihSTATUS_ACCESS_DENIEDIf you are not allowed to add or modify the user defined types, perhaps you are not a member of the ihTagAdmins group.
ihSTATUS_FAILEDFor any other type of error.

ihUserDefinedTypeSetProperties

This function is used to set the user defined type properties.

Prototype

ihUserDefinedTypeSetProperties(

ihServerHandle hServer, // server handle returned from previous call to ihServerConnect 

ihUserDefinedTypeProperties *UserDefinedType, // the name and properties to set

ihString *ErrorMsg // output parameter to contain any error string if there is error. The memory, if there is a
an error, will be allocated in the System API and should be freed using ihUserDefinedTypeFreeError
);

Remarks

You need to be an ihTagAdmin to set the properties. The memory, if there is an error, will be allocated in the System API and should be freed using ihUserDefinedTypeFreeErrorMessage.

Returns

Returns StatusMessage
ihSTATUS_OK On success.
ihSTATUS_API_TIMEOUTIf the server name or IP address provided cannot be located.
ihSTATUS_NOT_CONNECTED If you are not currently connected.
ihSTATUS_ACCESS_DENIEDIf you are not allowed to add or modify the user defined types, perhaps you are not a member of the ihTagAdmins group.
ihSTATUS_FAILEDFor any other type of error.

ihUserDefinedTypeGetProperties

This function returns the user defined type properties.

Prototype

ihUserDefinedTypeGetProperties(

ihServerHandle hServer, // server handle returned from previous call to ihServerConnect 

ihString UserDefinedTypeName , // the name of the custom data type

ihUserDefinedTypeProperties *UserDefinedType // output parameter containing the returned properties. The return
);

Remarks

You need to be an ihTagAdmin to get the properties.

Returns

Returns StatusMessage
ihSTATUS_OK On success.
ihSTATUS_API_TIMEOUTIf the server name or IP address provided cannot be located.
ihSTATUS_NOT_CONNECTED If you are not currently connected.
ihSTATUS_ACCESS_DENIEDIf you are not allowed to add or modify the user defined types, perhaps you are not a member of the ihTagAdmins group.
ihSTATUS_FAILEDFor any other type of error.

ihUserDefinedTypeFreeProperties

This function is used to free the memory allocated by the ihUserDefinedTypeGetProperties() call.

Prototype

void ihUserDefinedTypeFreeProperties(

ihUserDefinedTypeProperties *UserDefinedTypeProps // properties as returned from an 
ihUserDefinedTypeGetProperties call
);

Remarks

You need to call this once to free all memory in the recordset. Do not free the memory in your program.

Returns

Returns StatusMessage
VoidVoid.

ihUserDefinedTypeOpenRecordset

This function is used to return the list of user defined types.

Prototype

ihUserDefinedTypeOpenRecordset(

ihServerHandle hServer, // server handle returned from previous call to ihServerConnect 

ihString Mask, // * or specific set name or some other mask to specify the list

ihUserDefinedTypeRecordset *RecordSet // output parameter to contain the returned list. The list should be
freed with ihUserDefinedTypeFreed when done using the ihUserDefinedTypeCloseRecordset()
);

Remarks

You need to specify the user defined type set name to open the recordset. This function call should be freed after the retrieval using ihUserDefinedTypeCloseRecordset.

Returns

Returns StatusMessage
ihSTATUS_OK On success.
ihSTATUS_API_TIMEOUTIf the server name or IP address provided cannot be located.
ihSTATUS_NOT_CONNECTED If you are not currently connected.
ihSTATUS_ACCESS_DENIEDIf you are not allowed to add or modify the user defined types, perhaps you are not a member of the ihTagAdmins group.
ihSTATUS_FAILEDFor any other type of error.

ihUserDefinedTypeCloseRecordset

This function used to free the user defined type recordset that was allocated inside the System API in a previous read call.

Prototype

void ihUserDefinedTypeCloseRecordset(

ihUserDefinedTypeRecordset *Recordset // recordset to be freed
);

Returns

Returns StatusMessage
VoidVoid.

ihUserDefinedTypeFreeErrorMessage

This function is used to free the memory from the previous error message call.

Prototype

ihUserDefinedTypeFreeErrorMessage(

ihString ErrorMsg // string to be freed as returned from a previous call
);

Returns

Returns StatusMessage
VoidVoid.