Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

NameTypeMandatory/OptionalDescription
 stringMname of the Custom Item
 stringMdescription of the Custom Item
 nxa.accessMaccess rights of the Custom Item
 nxa.typeMthe data type of the Custom Item
 stringOdelimiter that is used to build the item ID (optional)

...

 stringOpath1 (optional)
 stringOpath2 (optional)
 ...
 stringOpathN (optional)

Return

TypeDescription
stringitemID 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

NameTypeMandatory/OptionalDescription
 stringMname of the Custom Item
 stringMdescription of the Custom Item
 nxa.accessMaccess rights of the Custom Item
 nxa.typeMthe data type of the Custom Item
 boolMsets the persistent flag of the Custom Item
 boolMsets the historical flag of the Custom Item
 boolMsets the synchronization flag of the Custom Item
 stringOdelimiter that is used to build the item ID (optional)

...

 stringOpath1 (optional)
 stringOpath2 (optional)
 ...
 stringOpathN (optional)

Return

TypeDescription
stringitemID 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

NameTypeMandatory/OptionalDescription
 stringMname of the custom item
 stringMdescription of the custom item
 nxa.accessMaccess rights of the custom item
 nxa.typeMthe data type of the custom item
 stringOengineering units of the custom item (optional)

...

 numberOminimum value that is allowed for the custom item (optional)

...

 numberOmaximum value that is allowed for the custom item (optional)

...

 stringOdelimiter that is used to build the item ID (optional)

...

 stringOpath1 (optional)
 stringOpath2 (optional)
 ...
 stringOpathN (optional)

Return

TypeDescription
stringitemID 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

NameTypeMandatory/OptionalDescription
 stringMname of the custom item
 stringMdescription of the custom item
 nxa.accessMaccess rights of the custom item
 nxa.typeMthe data type of the custom item
 boolOsets the persistent flag (optional)
 boolOsets the historical flag (optional)
 boolOsets the synchronize flag (optional)
 stringOengineering units of the custom item (optional)

...

 numberOminimum value that is allowed for the custom item (optional)

...

 numberOmaximum value that is allowed for the custom item (optional)

...

 stringOdelimiter that is used to build the item ID (optional)

...

 stringOpath1 (optional)
 stringOpath2 (optional)
 ...
 stringOpathN (optional)

Return

TypeDescription
stringitemID 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the source item
 stringMitemID of the destination item
 numberMdelay 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the source item
 stringMitemID 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the source item
 stringMitemID 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the source item
 stringMitemID 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the source item
 stringMitemID 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the source Server Item that triggers the

...

event
 boolMsimilar 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
 boolMsimilar 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
 boolMsimilar 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
 numberMdelay in milliseconds
 stringMscript 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

...

TypeDescription
numberID 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

NameTypeMandatory/OptionalDescription
 numberMID that identifies the template to which the property has to be

...

added
 numberMID that uniquely identifies the property within the template. The number room for the ID is 7000-7999.

...

 stringMname of the property
 nxa.typeMthe data type of the property
 variantMdefault 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the item to which the template has to be

...

attached
 numberMID 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

NameTypeMandatory/OptionalDescription
 stringMitemID of the item to which the template has to be

...

attached

Return

None.