User-Defined Type Functions

Important: You do not have the latest version of Historian! You are missing out on the newest capabilities and enhanced security. For information on all the latest features, see the Historian product page. For more information on upgrades, contact your GE Digital sales agent or e-mail GE Digital Sales Support. For the most up-to-date documentation, go here.

User-Defined Type Functions Overview

User-Defined Type Functions

You can use the user-defined type functions to create, modify, delete, and browse user-defined data types that contain multiple fields. You must add user-defined data types to the Data Archiver before you can use them in tags.

ihuUserDefinedTypeAdd

Prototype

Use the ihuUserDefineTypeAdd function to create or add MultiField type tags. The user-defined type you pass to this function can have multiple fields defined, or you can add fields later by using ihUserDefinedTypeSetProperties().

You can also use this function to modify user-defined data types. To modify an existing type, add a user-defined data type with the same name.

ihuUserDefinedTypeAdd
(
long serverhandle, // [in] connected server handle
ihuUserDefinedTypeProperties *InUserDefinedType //[in] UserDefined type that needs to be added / modified
)

Remarks

Existing types are overwritten by new types with the same names. You must be a member of the ihTag Admin group to add or modify a type.

Returns

  • ihuSTATUS_OK: on success
  • ihuSTATUS_INVALID_PARAMETER: NULL value or invalid server handle
  • ihuSTATUS_FAILED: on any error

ihuUserDefinedTypeDelete

Prototype

Use the ihuUserDefinedTypeDelete function to delete a user-defined type that you no longer use.

ihuUserDefinedTypeDelete
(
long serverhandle, // [in] connected server handle
MSO_Char * UserDefinedTypeName //[in] UserDefined type name to be deleted
)

Remarks

You must be a member of the ihTag Admin group to delete a type.

Returns

  • ihuSTATUS_OK: on success
  • ihuSTATUS_INVALID_PARAMETER: NULL value or invalid server handle
  • ihuSTATUS_FAILED: on any error

ihuUserDefinedTypeRename

Prototype

Use the ihuUserDefinedTypeRename function to rename a user-defined type.

ihuUserDefinedTypeRename
(
long serverhandle, // [in] connected server handle
MSO_Char * UserDefinedTypeName, //[in] UserDefined type name which needs to be renamed
MSO_Char *NewUserDefinedTypeName //[in] new UserDefined type name
)

Remarks

You must be a member of the ihTag Admin group to rename a type.

Returns

  • ihuSTATUS_OK: on success
  • ihuSTATUS_INVALID_PARAMETER: NULL value or invalid server handle
  • ihuSTATUS_FAILED: on any error

ihuUserDefinedTypeExists

Prototype

Use the ihuUserDefinedTypeExists function to check whether a specific user-defined type exists.

ihuUserDefinedTypeExists
(
long serverhandle, // [in] connected server handle
MSO_Char * UserDefinedTypeName // [in] UserDefined type name
)

Returns

  • ihuSTATUS_OK: if the type exists
  • ihuSTATUS_INVALID_PARAMETER: NULL value or invalid server handle
  • ihuSTATUS_FAILED: if the type does not exist or the server cannot be reached

ihuGetUserDefinedTypes

Prototype

Use the ihuGetUserDefinedTypes function to return a list of user-defined types and their values. After you call this function, you must call ihuUserDefinedTypeFreeProperties() to release memory allocations.

ihuGetUserDefinedTypes
(
long serverhandle, // [in] connected server handle
MSO_Char *StructSetMask, //[in] Pass * to get the all the Structure or pass the name of the structure you want
long *numberofrecords, //[out] Number of records
ihuUserDefinedTypeRecordSet *RecordSet //[out] returns the records for the UserDefined defined types
)

Remarks

You must be a member of the ihReader group to get a list of user-defined types. The list is returned in the RecordSet parameter.

Returns

  • ihuSTATUS_OK: on success
  • ihuSTATUS_INVALID_PARAMETER: NULL value passed for StructSetMask or RecordSet or numberofrecords
  • ihuSTATUS_FAILED: on any error

ihuUserDefinedTypeSetProperties

Prototype

Use the ihuUserDefinedTypeSetProperties function to set user-defined type properties after you add types by using ihuUserDefinedTypeAdd().

ihuUserDefinedTypeSetProperties
(
long serverhandle, // [in] connected server handle
ihuUserDefinedTypeProperties *UserDefinedType //[in] UserDefined type that needs to be added / created
)

Remarks

You must be a member of the ihTag Admin group to set type properties.

Returns

  • ihuSTATUS_OK: on success
  • ihuSTATUS_INVALID_PARAMETER: invalid server handle or NULL property pointer value passed
  • ihuSTATUS_FAILED: on any error

ihuUserDefinedTypeFreeProperties

Prototype

Use the ihuUserDefinedTypeFreeProperties function to free the memory allocated by the ihuGetUserDefinedTypes() function.

ihuUserDefinedTypeFreeProperties
(
ihuUserDefinedTypeRecordSet *UserDefinedTypeRecordSet //[in] UserDefinedTypeRecordSet that needs to be fr
)

Remarks

Call the ihuUserDefinedTypeFreeProperties function once to release all memory in the recordset returned by ihuGetUserDefinedTypes(). Do not free the memory in your program.

Returns

Void