These functions can be used to create user-defined Server Items (also referred to as Custom Items). These Custom Items can be organized in a user-defined hierarchy that is integrated into the Server Item Tree. Using custom items provides the most flexible way to add control functionality – they can be used the same way as real Server Items. The only difference is that they are only available in the server's virtual data model – there is no physical datapoint that is connected to it. Therefore, Custom Items can be seen as virtual datapoints.
Note that Custom Items can only be create and deleted during server start up (e.g.within the "OnInitEvent" callback).
Description
Signature
string nxa.AddCustomItem (string, string, nxa.access, nxa.type, string, string, string, ..., string)
This function adds a new Custom Item during the initialization phase of the server and returns its ID. In general, this function shall be used within the "OnInitEvent" callback only.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | name of the Custom Item | |
string | M | description of the Custom Item | |
nxa.access | M | access rights of the Custom Item | |
nxa.type | M | the data type of the Custom Item | |
string | O | delimiter that is used to build the item ID (optional) | |
string | O | path1 (optional) | |
string | O | path2 (optional) | |
... | |||
string | O | pathN (optional) |
Return
Type | Description |
---|---|
string | itemID of the new Custom Item |
Example: nxa.AddCustomItem( "TestItem", "my test item description", nxa.access.All, nxa.type.Real, "/", "MySubDir", "MySubDir2") This will create a Custom Item called "TestItem" within the Server Item Tree under the sub tree "Custom/MySubDir/MySubDir2". Thus, the itemID of the new Custom Item is "Custom/MySubDir/MySubdir2/TestItem".
Description
Signature
string nxa.AddExtCustomItem (string, string, nxa.access, nxa.type, bool, bool, bool, string, string, string, ..., string)
This function adds a new Custom Item during the initialization phase of the server and returns its ID. In general, this function shall be used within the "OnInitEvent" callback only. Compared to the function "nxa.AddCustomI the flags for "Persistent", "Historical", and "Synchronziation" can also be set.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | name of the Custom Item | |
string | M | description of the Custom Item | |
nxa.access | M | access rights of the Custom Item | |
nxa.type | M | the data type of the Custom Item | |
bool | M | sets the persistent flag of the Custom Item | |
bool | M | sets the historical flag of the Custom Item | |
bool | M | sets the synchronization flag of the Custom Item | |
string | O | delimiter that is used to build the item ID (optional) | |
string | O | path1 (optional) | |
string | O | path2 (optional) | |
... | |||
string | O | pathN (optional) |
Return
Type | Description |
---|---|
string | itemID of the new Custom Item |
Description
Signature
string nxa.AddSysCustomItem (string, string, nxa.access, nxa.type, string, number, number, string, string, string, ..., string)
This function adds a new System Custom Item during the initialization phase of the server and returns its ID. Compared to a normal custom item, a system custom item can be placed anywhere in the item tree. In general, this function shall be used within the "OnInitEvent" callback only.
Parameters
Name | Type | Mandatory/Optional | Description | ||||
---|---|---|---|---|---|---|---|
string | M | name of the custom item | |||||
string | M | description of the custom item | |||||
nxa.access | M | access rights of the custom item | |||||
nxa.type | M | the data type of the custom item | |||||
string | O | engineering units of the custom item (optional) | number | O | minimum value that is allowed for the custom item (optional) | ||
number | O | maximum value that is allowed for the custom item (optional) | |||||
string | O | delimiter that is used to build the item ID (optional) | |||||
string | O | path1 (optional) | |||||
string | O | path2 (optional) | |||||
... | |||||||
string | O | pathN (optional) |
Return
Type | Description |
---|---|
string | itemID of the new Custom Item |
Description
Signature
string nxa.AddExtSysCustomItem (string, string, nxa.access, nxa.type, bool, bool, bool, string, number, number, string, string, string, ..., string)
This function adds a new System Custom Item during the initialization phase of the server and returns its ID. Compared to a normal custom item, a system custom item can be placed anywhere in the item tree. In general, this function shall be used within the "OnInitEvent" callback only. Compared to the function "nxa.AddSysCustomItem", the flags for "Persistent", "Historical", and "Synchronziation" can also be set.
Parameters
Name | Type | Mandatory/Optional | Description | ||||
---|---|---|---|---|---|---|---|
string | M | name of the custom item | |||||
string | M | description of the custom item | |||||
nxa.access | M | access rights of the custom item | |||||
nxa.type | M | the data type of the custom item | |||||
bool | O | sets the persistent flag (optional) | |||||
bool | O | sets the historical flag (optional) | |||||
bool | O | sets the synchronize flag (optional) | |||||
string | O | engineering units of the custom item (optional) | number | O | minimum value that is allowed for the custom item (optional) | ||
number | O | maximum value that is allowed for the custom item (optional) | |||||
string | O | delimiter that is used to build the item ID (optional) | |||||
string | O | path1 (optional) | |||||
string | O | path2 (optional) | |||||
... | |||||||
string | O | pathN (optional) |
Return
Type | Description |
---|---|
string | itemID of the new Custom Item |
Description
Signature
nxa.AddItemLink (string, string, number)
This function links a source item to a destination item. This means that the value of the source item will be forwarded to the destination item.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the source item | |
string | M | itemID of the destination item | |
number | M | delay in milliseconds |
Return
None.
Description
Signature
nxa.AddDirectLink (string, string)
This function directly links a source item to a destination item. This means that the value of the source item will be forwarded to the destination item. Compared to "'nxa.AddItemLink"', loops are detected.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the source item | |
string | M | itemID of the destination item |
Return
None.
Description
Signature
nxa.RemoveDirectLink (string, string)
This function removes a direct link again.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the source item | |
string | M | itemID of the destination item |
Return
None.
Description
Signature
nxa.AddDirectBiLink (string, string)
This function bi-directly links a source item to a destination item. This means that the value of the source item will be forwarded to the destination item and vice versa. Compared to "'nxa.AddItemLink"', loops are detected.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the source item | |
string | M | itemID of the destination item |
Return
None.
Description
Signature
nxa.RemoveDirectBiLink (string, string)
This function removes a bi-directional link again.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the source item | |
string | M | itemID of the destination item |
Return
None.
Description
Signature
nxa.AddItemEvent (string, bool, bool, bool, number, string)
This function adds a new event that is triggered whenever the given item changes.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the source Server Item that triggers the event | |
bool | M | similar to the "OnReceive" parameter of the task definition (cf. Section 4.5.2), this parameter indicates that the event is triggered if a read request is received on the given item | |
bool | M | similar to the "OnSent" parameter of the task definition (cf. Section 4.5.2), this parameter indicates that the event is triggered if a new value is sent to the given item | |
bool | M | similar to the "OnSet" parameter of the task definition (cf. Section 4.5.2), this parameter indicates that the event is triggered if a new value is set | |
number | M | delay in milliseconds | |
string | M | script that is executed when the event is triggered |
Return
None.
Description
Signature
number nxa.AddItemTemplate ()
This function creates a new template for Custom Items and adds it to the template list inside the server.
Parameters
None.
Return
Type | Description |
---|---|
number | ID that uniquely identifies the template |
Description
Signature
nxa.AddPropertyTemplate (number, number, string, nxa.type, variant)
This function can be used to add a property to an item template. The template has to be created with "nxa.AddItemTemplate" before.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
number | M | ID that identifies the template to which the property has to be added | |
number | M | ID that uniquely identifies the property within the template. The number room for the ID is 7000-7999. | |
string | M | name of the property | |
nxa.type | M | the data type of the property | |
variant | M | default value of the property |
Return
None.
Description
Signature
nxa.AttachTemplate (string, number)
This function assigns a template to a Custom Item.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the item to which the template has to be attached | |
number | M | ID that identifies the template that has to be attached to the specified item |
Return
None.
Description
Signature
nxa.DetachTemplate (string)
This function detaches a template again.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the item to which the template has to be attached |
Return
None.