Configuring the OPC UA Client Source block
Properties
-
Double click the OPC UA client source block to configure the block properties. Below the properties window, an explanation of each property can be found.
Data Source:
-
The name of an OPC UA Server to which a connection must be established. Open the OPC UA Connection Dialogue by clicking the Data Connection Selection button denoted by the ellipses adjacent to the “Data Source” text box.
-
Data will be received and sent to the specified OPC UA server.
-
For connection configuration, see OPC UA client to server connection.
Verify fields during runnability:
-
Set to "Yes" if fields should be verified during a runnability check, or
-
"No" to consider the fields valid.
NOTE: Selecting “No” may lead to runtime errors if configured tags cannot be found on the OPC UA Server.
Execution Mode
Select the execution mode:
-
Historical- Execute the block in historical mode. All data will be read from the OPC UA Server using the time window provided on the property sheet configured by the Import options, Windows start, Window end, and Duration properties.
-
Real-time- Execute the block in real-time mode.
Sampling period:
-
The interval in seconds at which data is sampled during Real-time execution or aggregated over during Historical execution.
-
Minimum valid value = 0.01
NOTE: During Real-time execution, when the sampling rate is too small for the processor to handle, a “scheduler overload” error will be reported in the message window of the blueprint. If this error is consistently reported it may indicate that the sampling rate is too high for the system to support. Increase the sampling period to decrease the sampling rate.
Data Retrieval Method:
Specifies how the data is retrieved from the OPC UA server during real-time execution.
-
Synchronous: Uses synchronous read operations. In this mode the OPC UA Server is polled for data according to the value configured under the Sampling period property.
-
Asynchronous: Uses asynchronous reads through a callback interface. The data is retrieved slightly before the execution time to enable the block to prepare and execute the data in real-time. In this mode the OPC UA Server will notify CSense when new data is available. Notifications should happen according to the value configured under the Sampling period property.
Use Aggregate / Aggregate:
-
Only applicable when retrieving historical data from an OPC UA server. The list of available functions are server dependent. Refer to your OPC UA server documentation for more information on Aggregate functions.
-
The aggregate functions are different mathematical ways of manipulating and presenting the data. Aggregate functions will be calculated using an aggregation period according to the value configured under the Sampling period property if applicable.
-
If Use Aggregate is set to "No", the raw data at the actual sample rate will be returned.
Field Timestamping:
Specifies how the timestamp of each field is determined.
-
Set to execute time – timestamps are generated according to the sampling rate regardless of whether the timestamp has changed or not.
-
Set to execute time on change – a new timestamp is only generated when the value or quality on a field changes.
-
Unchanged – the timestamp of the value as returned by the OPC UA Server will be used in this case.
Import Options:
Select which data to retrieve.
-
Use the latest data available – will use the data in the server at the time of query.
-
Use and hold last available value – new tag values are only retrieved on the first execute of the block and held constant for the remainder of the blueprint execution.
Window Start/End:
The starting/ending timestamp of the data import window.
Duration:
The duration of the data import window. This is the time difference between the starting and ending times of the data import window.
NOTE: Because of the real-time nature of the OPC UA Client Source block, the block must be run in playback mode to avoid unexpected errors.
Configuring Blueprint Execution Schedules:
Blueprint execution rates are determined by the individual source blocks contained in a blueprint and their respective configuration options.
You can use the First execute configuration options available on most source blocks to configure the timestamp for the first execution of the blueprint. For more information, see Configuring Blueprint Execution Schedules.
Select TAB
Select the fields you wish to import from the specified data source, and set the data types. Three data types are supported:
-
Integer (I)
-
Double (D)
-
String (S)
Convert between these data types by selecting the required fields from the list and clicking on the conversion buttons provided. Only valid conversions are supported.
OPC UA Source Field Configuration
All the fields in the output port of the block are listed in the Selected Fields List.
-
Field Name lists the field name in the output port.
-
Data Type lists the data type of the field.
-
Media Source is the associated node in the OPC UA Server. This might be different to the field name.
The controls at the top of the dialogue allow manual editing of the items in the table.
The [Validate] button will refresh and validate the data in the input ports of the OPC UA Client Source block. If the field is not valid it will be dropped, an error will be reported to the user and the execution will continue. No notification occurs if all fields are valid.
Warning: There are no warnings in the case of incorrectly formatted import files. Therefore when reconfiguring an OPC UA server connection or importing a file, it is essential that the validation of the fields are checked via the validate button.
The [Import] button will import the same 3 column type text file that was exported. The following restrictions on the text file format are applicable:
-
The first line must contain the headings
-
The entries under the Field Data Type column must be one of
-
-
Integer
-
Double
-
String
-
The [Export] button exports the field configuration to a text file. The output file has 3 columns:
-
Field Name
-
Field Data Type
-
Media Source
The [Customize] button is used to manually add, edit and remove fields.
Customize: To make a manual field entry:
-
Open the Customize Fields dialogue by clicking the [Customize] button.
-
Enter the field name in the Field Name edit box at the bottom of the window.
-
Enter the OPC UA node in the Media Source edit box. This value must correspond to the Extended Node Id format, as defined in the OPC UA specification. The Extended Node Id format is needed since it will be persisted.
-
Select the field's data type from the Data Type drop-down list.
-
Clicking the [Add] button will add the field to the list, and will populate the main Fields window.
To change a field entry
-
Open the Customize Fields dialogue by clicking the [Customize] button.
-
Select the field from the list. The attributes of the fields in the list can be edited directly.
-
When focus is lost on the specified item, the value will be updated.
To remove the OPC UA item association
-
Open the Customize Fields dialogue by clicking the [Customize] button.
-
Select the field from the list.
-
Click the remove button.
Preview TAB
Provides a sample preview of the data set as read using the currently specified properties, of the specified time window.
Related topics: