LabVIEW OPC UA Toolkit API Reference

Content Type
Programming Language
Current manual

Add Item VI

Add Item VI

Owning Palette: OPC UA Server VIs

Requires: OPC UA Toolkit

Adds an item as a child to a folder you specify.

After you start an OPC UA server, you cannot add items until the OPC UA server stops. Use the Stop VI to stop an OPC UA server.

Example

historical access specifies whether the item supports historical access and the size of the history data queue.
enable specifies whether the item supports historical access. The default is FALSE, which specifies that this item does not support historical access.
queue size specifies the size of the queue of history data. The default is 1000.
OPC UA server refnum in specifies the reference data value of the OPC UA server.
parent folder node ID specifies the ID of the parent folder. The format of the node ID is ns=<namespace index>;<identifier type>=<identifier>. If the parent folder does not exist, this VI creates a folder at the root level. A node ID contains the following components:
  • namespace index is a base 10 number that indicates the namespace of the node ID.
    If namespace index is 0, the format of the node ID can be <identifier type>=<identifier>. The namespace index for a node that you created with the OPC UA Toolkit is 2.
  • identifier type represents the type of the identifier and has the following values:

    ValueIdentifier Type
    iNumeric
    sString
    gGUID
    bOpaque
  • identifier is a string value that represents the name of the identifier.


The format of the node ID can also be ns=<namespace index>;<identifier type>=<identifier>@<index>:<index>. For example, ns=2;s=Folder.Array@1:2. This format only applies to the array data type and allows you to read a single element or a range of elements of an array. You cannot use @ in a node name.

For backwards compatibility, parent folder node ID also accepts node paths as input for OPC UA servers only. You can regard the node path as the string type identifier of the node ID. For example, a node path can be Device.folder.item.
item specifies the item attributes.
name specifies the name of the item. If an item or folder with the same name already exists in the parent folder, this VI returns an error.
data type specifies the data type of the item.

1 Boolean
2 SByte
3 Byte
4 Int16
5 UInt16
6 Int32
7 UInt32
8 Int64
9 UInt64
10 Float
11 Double
12 String
13 DateTime
15 ByteString
101 Array of Boolean
102 Array of SByte
103 Array of Byte
104 Array of Int16
105 Array of UInt16
106 Array of Int32
107 Array of UInt32
108 Array of Int64
109 Array of UInt64
110 Array of Float
111 Array of Double
112 Array of String
113 Array of DateTime
115 Array of ByteString
201 Matrix of Boolean
202 Matrix of SByte
203 Matrix of Byte
204 Matrix of Int16
205 Matrix of UInt16
206 Matrix of Int32
207 Matrix of UInt32
208 Matrix of Int64
209 Matrix of UInt64
210 Matrix of Float
211 Matrix of Double
212 Matrix of String
213 Matrix of DateTime
215 Matrix of ByteString
access level specifies the access method for the item.

1 read-only
2 write-only
3 read/write
description specifies a free-form text string that you enter to describe this item.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
OPC UA server refnum out returns the reference data value of the OPC UA server.
item node ID returns the ID of the item node that this VI adds.
OPC UA variable node refnum out returns the reference to the variable node.
error out contains error information. This output provides standard error out functionality.

Example

Refer to the OPC UA Demo.lvproj in the labview\examples\Data Communication\OPCUA directory for an example of using the Add Item VI.

In This Section
Was this information helpful?