Data remote operations

This category contains all operations related to remote data exchange APIs that can be used in a bot.

Read variable value

Reads the value of a variable. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Key String Unique reference to the value in memory. This property supports usage of internal bot variables.
Scope Enum

Accessibility scope of value in memory. The following values are available.

  • Private – value is available only for the current bot.

  • Internal – value is available for the current thread, i.e. for parent bots, for the current bot and for all children executed bots.

  • Shared – value is available for all bots.

Variable name String The full variable name, including branch. The variable name is prefixed with the current bot's branch unless the @ symbol is used. This property supports usage of internal bot variables

Send recipe

Sends a recipe to write one or several variables. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Variables list Set

List of variables and corresponding values to command. Note that all variable values within a recipe will be modified with the same timestamp. Both variable name and value properties support usage of internal bot variables. In the Name column, use the full variable name, including branch. The variable name is prefixed with the current bot's branch unless the @ symbol is used. The list can have a maximum of 100 variables.

Historical data request

Sends a request to the archived data base of a variable. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Key String Unique reference to the value in memory. This property supports usage of internal bot variables.
Scope Enum

Accessibility scope of value in memory. The following values are available.

  • Private – value is available only for the current bot.

  • Internal – value is available for the current thread, i.e. for parent bots, for the current bot and for all children executed bots.

  • Shared – value is available for all bots.

Variable name String The full variable name, including branch. The variable name is prefixed with the current bot's branch unless the @ symbol is used. This property supports usage of internal bot variables
Unit name String Name of the archive Unit to be searched for the variable information. Smart bots access historical data using a unified API, so they can receive data from any supported archive Unit type.
Specify interval for the latest data Boolean Tick to specify the requested date range as the given time from now, e.g. latest 15 minutes, last 1 day, etc. False to specify the start and end dates explicitly.
Start date String A string representation of a date and time value for the start of the requested data period.
End date String A string representation of a date and time value for the end of the requested data period.
Padding interval String Human readable time interval. Text near the value is reformatted automatically after validating the input. Specify the padding interval to get a collection of the variable data points at the specified time range from the given archive unit using the given padding: i.e. data is spread over the specified time range with one data point every padding interval (e.g. one value every minute).
Exclude NS data Boolean Tick to return a collection of the variable data points only with good quality.
Filtering bit name String The full variable name, including branch. The variable name is prefixed with the current bot’s branch unless the @ symbol is used. This property supports use of internal bot variables. Specify the variable name to get a collection of the variable data points at the specified time range from the given archive unit using the given padding, where the specified filter bit was ON (like a machine status signal). Values at the time when the filtering bit was OFF are ignored. Property is available only when padding interval is specified.
Custom filtering expression C# lambda expression C# lambda expression – function taking the resulting collection as an input and returning the filtered collection. This property supports usage of internal bot variables. As an example, the following string can be used to filter only the values are lower than 30.
x.Where(d => d.Value < 30)
Aggregate function Function

A function that will be applied to the resulting list of data points to aggregate them in a single value. The following functions are available.

  • Maximum – returns the maximum variable value with good quality.

  • Minimum – returns the minimum variable value with good quality.

  • First – returns the first variable value.

  • Last – returns the last variable value.

  • Average – returns the simple average of variable values with the good quality.

  • Sum – calculates the sum of all variable values with the good quality.

  • Standard deviation – calculates the standard deviation of variable values with the good quality.

  • Standard deviation in an entire population.

  • Excel STDEV.P function, calculates the standard deviation of variable values with the Good quality for an entire population.

  • Variance – calculates the variance of a sample with the good quality.

  • Variance in an entire population - Excel VAR.P function, returns the variance in an entire population.

  • Custom – uses the custom aggregate function.

Custom aggregate function C# lambda expression C# lambda expression – function taking the resulting collection as an input and returning the value to store in memory. This property supports usage of internal bot variables. As an example, the following string can be used to calculate the 80th percentile for a set of data, inclusive (Excel PERCENTILE.INC function).
x => x.PercentileInc(q => q.Value, 0.8)

Create database from historical data

Sends a request to the archived database of a variable. Result table is then saved to a database. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Variable name String

The full variable name, including branch. The variable name is prefixed with the current bot’s branch unless the “@” symbol is used. This property supports usage of internal bot variables.

From version 16.2 onwards the Variable Name property is superseded by the Variables List property.
For backwards compatibility Variable Name is still supported at run-time but can no longer be configured.
Variables list  

An array of the variable names in the request comprising the following fields.

  • Archive unit name. Type string. The name of the archive unit where the variable information will be searched. Smart bots can receive data from any supported archive unit type.

  • Variable name. Type string. The full variable name, including branch. The variable name is prefixed with the current bot’s branch unless the @ symbol is used. This property supports usage of internal bot variables.

  • Column name. Type string. The name of the database column to be inserted for storing the corresponding variable property. This property supports usage of internal bot variables.

  • Property. Type enum. The property to retrieve from the variable object. The following values are available.

    • Value – Value of the variable

    • Quality – Quality of the variable.

    • Is good quality – Boolean value indicating if the quality is good.

    • Timestamp – Timestamp of the variable change.

    • Timestamp – Timestamp of the variable change in the local time zone.

    • Timestamp – Timestamp of the variable change in ticks format.

Archive unit name String Name of the archive Unit where the variable information will be searched. Smart bots access Historical data using a unified API, so they can receive data from any supported archive Unit type.
Specify interval for the latest data Boolean True to specify the requested date range as the given time from now, e.g. latest 15 minutes, last 1 day, etc. False to specify the start and end dates explicitly.
Interval String Human readable time interval. Text near the value is reformatted automatically after validating the input.
Start date String A string representation of a date and time value for the start of the requested data period.
End date String A string representation of a date and time value for the end of the requested data period.
Sampling rate String Human readable time interval. Text near the value is reformatted automatically after validating the input. Specify the padding interval to get a collection of the variable data points at the specified time range from the given archive unit using the given padding: i.e. data is spread over the specified time range with one data point every padding interval. For example one value every minute.
Exclude NS data Boolean True to return a collection of the variable data points only with the good quality.
Custom filtering expression C# lambda expression

C# lambda expression – function taking the resulting collection as an input and returning the filtered collection. This property supports usage of internal bot variables. As an example, the following string can be used to filter only the values are lower than 30.

x.Where(d => d.Value < 30)

Database name String Name of the database. This property supports usage of internal bot variables.
Drop existing database Boolean True to drop the specified database if exists before refilling it with the variable values. False to append the variable values to an existing database.
Column name for Timestamp (DateTime object) String Name of the column for storing the timestamps of variable changes as objects. If value is empty, the corresponding column is not created. Storing timestamps as DataTime objects can be useful for further date and time related calculations. This property supports usage of internal bot variables.
Column name for Timestamp (Amount of Ticks) String Name of the column for storing the timestamps of variable changes as ticks (the number of ticks that represent the corresponding date and time). If value is empty, the corresponding column is not created. Storing timestamps as numbers (ticks) can be useful for training AI models. This property supports usage of internal bot variables.
Column name for Value String

Name of the column for storing the variable values. If value is empty, the corresponding column is not created. This property supports usage of internal bot variables.

Column name for Quality String Name of the column for storing the variable values quality. If value is empty, the corresponding column is not created. This property supports usage of internal bot variables.
Column name for Quality goodness String Name of the column for storing the variable values quality as Boolean. True is stored for Good quality values, False is stored for Bad quality values (NS, NS COM, etc). If value is empty, the corresponding column is not created. This property supports usage of internal bot variables.