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). <file name="nxa.AddCustomItem">
<h1>Description</h1>
<h1>Signature</h1>
Description
Signature
string nxa.AddCustomItem (string, string, nxa.access, nxa.type, string, string, string, ..., string) <p>This
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.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>name of the Custom Item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>description of the Custom Item</td></tr>
<tr><td></td><td>nxa.access</td><td>M</td><td>access rights of the Custom Item</td></tr>
<tr><td></td><td>nxa.type</td><td>M</td><td>the data type of the Custom Item</td></tr>
<tr><td></td><td>string</td><td>O</td><td>delimiter
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". <file name="nxa.AddExtCustomItem">
<h1>Description</h1>
<h1>Signature</h1>
Description
Signature
string nxa.AddExtCustomItem (string, string, nxa.access, nxa.type, bool, bool, bool, string, string, string, ..., string) <p>This
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.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>name of the Custom Item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>description of the Custom Item</td></tr>
<tr><td></td><td>nxa.access</td><td>M</td><td>access rights of the Custom Item</td></tr>
<tr><td></td><td>nxa.type</td><td>M</td><td>the data type of the Custom Item</td></tr>
<tr><td></td><td>bool</td><td>M</td><td>sets the persistent flag of the Custom Item</td></tr>
<tr><td></td><td>bool</td><td>M</td><td>sets the historical flag of the Custom Item</td></tr>
<tr><td></td><td>bool</td><td>M</td><td>sets the synchronization flag of the Custom Item</td></tr>
<tr><td></td><td>string</td><td>O</td><td>delimiter
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) <p>This
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.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>name of the custom item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>description of the custom item</td></tr>
<tr><td></td><td>nxa.access</td><td>M</td><td>access rights of the custom item</td></tr>
<tr><td></td><td>nxa.type</td><td>M</td><td>the data type of the custom item</td></tr>
<tr><td></td><td>string</td><td>O</td><td>engineering
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) <p>This
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.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>name of the custom item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>description of the custom item</td></tr>
<tr><td></td><td>nxa.access</td><td>M</td><td>access rights of the custom item</td></tr>
<tr><td></td><td>nxa.type</td><td>M</td><td>the data type of the custom item</td></tr>
<tr><td></td><td>bool</td><td>O</td><td>sets the persistent flag (optional)</td></tr>
<tr><td></td><td>bool</td><td>O</td><td>sets the historical flag (optional)</td></tr>
<tr><td></td><td>bool</td><td>O</td><td>sets the synchronize flag (optional)</td></tr>
<tr><td></td><td>string</td><td>O</td><td>engineering
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) <p>
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.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the source item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the destination item</td></tr>
<tr><td></td><td>number</td><td>M</td><td>delay in milliseconds</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="nxa.AddDirectLink">
<h1>Description</h1>
<h1>Signature</h1>
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) <p>
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.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the source item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the destination item</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="nxa.RemoveDirectLink">
<h1>Description</h1>
<h1>Signature</h1>
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) <p>
This function removes a direct link again.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the source item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the destination item</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="nxa.AddDirectBiLink">
<h1>Description</h1>
<h1>Signature</h1>
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) <p>
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.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the source item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the destination item</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="nxa.RemoveDirectBiLink">
<h1>Description</h1>
<h1>Signature</h1>
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) <p>
This function removes a bi-directional link again.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the source item</td></tr>
<tr><td></td><td>string</td><td>M</td><td>itemID of the destination item</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="nxa.AddItemEvent">
<h1>Description</h1>
<h1>Signature</h1>
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) <p>This
This function adds a new event that is triggered whenever the given item changes.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID
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. </file>
<file name="nxa.AddItemTemplate">
<h1>Description</h1>
<h1>Signature</h1>
Description
Signature
number nxa.AddItemTemplate () <p>This
This function creates a new template for Custom Items and adds it to the template list inside the server.</p>
<h1>Parameters</h1>
Parameters
None. <h1>Return</h1>
Return
...
Type | Description |
---|---|
number | ID that uniquely identifies the |
...
template |
Description
Signature
nxa.AddPropertyTemplate (number, number, string, nxa.type, variant) <p>
This function can be used to add a property to an item template. The template has to be created with "nxa.AddItemTemplate" before. </p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>number</td><td>M</td><td>ID
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) <p>
This function assigns a template to a Custom Item. </p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID
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. </file>
<file name="nxa.DetachTemplate">
<h1>Description</h1>
<h1>Signature</h1>
Description
Signature
nxa.DetachTemplate (string) <p>
This function detaches a template again. </p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>string</td><td>M</td><td>itemID
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | itemID of the item to which the template has to be |
...
attached |
Return
None.