18 Excel Configuration

Protocol HUB uses the configuration in excel file format. Each sheet represents a specific part of the configuration: Devices contain device lists and protocol-related configurations. Signals contain a list of signals and their options. First-line on each sheet is a header row that contains the parameter name for each column. Header order determines parameter names for each following row. Every line after the header is a new entry. An empty row is interpreted as the end of the sheet. Any rows after empty row are discarded.

18.1 Devices sheet

Devices sheet contains all devices to be configured on the gateway. Each row represents one device and its settings. Following options are required for each device:

An alias can only contain alphanumeric characters and dashes ( - and _ ). The alias must be unique for each device.

IEC 61850 MMS:

  – IEC 61850 Client (since FW 1.5.0)

  – IEC 61850 Server (since FW 1.5.0)

IEC 60870-5:

  – IEC 60870-5-101 master

  – IEC 60870-5-101 slave

  – IEC 60870-5-103 master

  – IEC 60870-5-104 master

  - IEC 60870-5-104 slave

DNP 3.0 Serial/LAN/WAN:

  - DNP3 Master

  – DNP3 Slave

Modbus Serial/TCP:

  - Modbus RTU/ASCII

  – Modbus TCP

Metering protocols:

  - DLMS/COSEM (since FW 1.3.0)

  – IEC 62056-21 (since FW 1.2.13)

  – MBus Serial

  – MBus TCP

  – Elgama (Meters based on IEC 62056-21 / 31 protocols)

Industrial IOT protocols:

- MQTT

- RESTful API

Specific protocols: 

– Aurora (ABB PV inverters protocol)

– PowerOne (ABB PV inverters protocol)

– SMA Net (SMA PV inverters protocol)

– Kaco (Kaco PV inverters protocol)

– Ginlong (Ginlong PV inverters protocol)

– Solplus (Solutronic AG PV inverters protocol)

– ComLynx (Danfoss PV inverters protocol)

– Delta (Delta PV inverters protocol)

– Windlog (Wind sensors from RainWise Inc.)

– Vestas ( Wind turbines protocol)

– Internal data

– VBus.

Although device name rules aren’t strictly enforced, it is highly advised to give a unique name to every new device. Identical device names might introduce confusion while searching for signals in the Imported Signals tab.

Optional settings

Serial port settings

Required for any protocol that uses serial line communication.

TCP/IP settings

Settings for any protocol that uses communication over TCP/IP. Note that all TLS certificates and keys are stored in a single folder therefore only the name and not the path should be filled in respective fields.

TLS fields are only supported for IEC 61850 Client and Server, IEC-60870-5-104 Slave, and DNP3 Master and Slave.

18.2 Optional parameters for signals

The signals sheet contains all signals linked to devices. Each signal is defined in a single row. The Signal list can be split into multiple sheets. Each sheet name may start as Signals.

Required attributes

These attributes are mandatory for every configured signal. Every Excel configuration should have specified them in the first row of the Signals sheet:

  • signal_name - Name of the signal. Used for representation only.

  • device_alias - Alias of a device defined in the Devices sheet. A signal is linked to a matching device.

  • signal_alias - A unique short name for the signal. It is used for linking signals to other signals. The alias can only contain alphanumeric characters and dashes ( - and _ ). The device and signal alias combination must be unique.

Optional attributes

Optional attributes are required depending on the protocol in use and they can be used to extend protocol functionality:

Picture. Result of using an absolute threshold:

image-1601977355078.png

Picture. Result of using an integral threshold:

image-1601977339925.png

Signal recalculation operation priority

A value generated by some protocol usually has to be recalculated in one way or another. This might mean changing the value of an argument as well as adding flags needed for other protocols to correctly interpret results. As recalculation is a sequential process, some actions are done before others. The sequence of operations done to a value is as follows:

  • Edition of attributes. Attributes for further interpretation are added. This might, for example, include a flag to show that a signal resembles an answer to a command;

  • Mathematical calculations. multiply, add, bit_select, and math_expression columns are evaluated here;

  • Usage of last value. The decision if last value for a signal should be used if a new value of a signal is not a number (NaN) or contains a non-topical (NT) flag;

  • Limiting of values. If a value exceeds a lower or higher configured limit, the value is approximated not be lower (or higher) than the limit. An additional overflow (OV) flag is added as frequently used in IEC-60870-5 protocols;

  • Suppression of values. As electrical circuits can be noisy, protocols may generate multiple values in a short amount of time. What is more, some values are considered as intermediaries and ideally should not be sent to SCADA unless they stay in the same state for some amount of time. suppression_values and suppression_time_ms are used to configure this functionality;

  • Threshold checking. If a new signal doesn’t cross a threshold target value, the value is suppressed and not used in further stages. absolute_threshold, integral_threshold, integral_threshold_interval, threshold_units columns are used to configure this functionality.

Not all of the elements in this sequence have to be configured, missing operations are skipped and values are fed to a further stage of signal recalculation.

number_type field

This field is required for some protocols to determine a method to retrieve a signal value from hexadecimal form. Available values:

FLOAT - 32-bit single precision floating point value according to IEEE 754 standard
DOUBLE - 64-bit double precision floating point value according to IEEE 754 standard
DIGITAL - 1-bit boolean value
UNSIGNED8 - 8-bit unsigned integer (0 - 255)
SIGNED8 - 8-bit signed integer (-128 - 127)
UNSIGNED16 - 16-bit unsigned integer (0 - 65535)
SIGNED16 - 16-bit signed integer (-32768 - 32767)
UNSIGNED32 - 32-bit unsigned integer (0 - 4294967295)
SIGNED32 - 32-bit signed integer (-2147483648 - 2147483647)
UNSIGNED64 - 64-bit unsigned integer (0 - 18446744073709551615)
SIGNED64 - 64-bit signed integer (-9223372036854775808 - 9223372036854775807)

Number conversion uses big-endian byte order by default. Converted data will be invalid if the byte order on the connected device side is different. In such a case, byte swap operations can be used. Adding swap prefixes to number types will set different byte orders while converting values. Following swap operations are available:

  • SW8 - Swap every pair of bytes (8 bits) (e.g., 0xAABBCCDD is translated to 0xBBAADDCC);

  • SW16 - Swap every pair of words (16 bits) (e.g., 0xAABBCCDD is translated to 0xCCDDAABB);

  • SW32 - Swap every pair of two words (32 bits) (e.g., 0x1122334455667788 is translated to 0x5566778811223344);

Table. Example of using different swapping functions:

Address 0 1 2 3 4 5 6 7
Original number Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
SW8 Byte 1 Byte 0 Byte 3 Byte 2 Byte 5 Byte 4 Byte 7 Byte 6
SW16 Byte 4 Byte 5 Byte 6 Byte 7 Byte 1 Byte 6 Byte 4 Byte 5
SW32 Byte 4 Byte 5 Byte 6 Byte 7 Byte 0 Byte 1 Byte 2 Byte 3
SW8.SW16 Byte 3 Byte 2 Byte 1 Byte 0 Byte 7 Byte 6 Byte 5 Byte 4
SW8.SW32 Byte 4 Byte 4 Byte 7 Byte 6 Byte 1 Byte 0 Byte 3 Byte 2
SW8.SW16.SW32 Byte 7 Byte 6 Byte 5 Byte 4 Byte 3 Byte 2 Byte 1

Byte 0

Where Byte x, means bit x position in the byte.

Add a dot-separated prefix to the number format to use byte swapping. Multiple swap operations can be used simultaneously. For example, use SW8.SW16.SIGNED32 it to correctly parse a 32-bit signed integer in a little-endian format. Table 35 shows in detail how bytes, words, or double-words can be swapped and how swapping functions can be combined to make different swapping patterns. The table shows how byte swap is done for 64-bit (8-byte) numbers. It doesn’t matter if it is an unsigned/signed integer or double, byte swapping is considered a bit-level operation. If a number is shorter than 64 bits, the same logic applies, the only difference is the unavailability of some swapping operations (SW32 for 32-bit and smaller numbers). Using such an unavailable operation might lead to undefined behavior.

Linking signals

Signals can be linked together to achieve data transfer between several protocols. If a signal source is defined, all output from that source will be routed to the input of the target signal. This way events polled from a Modbus device (e.g., Modbus, IEC 60870-5, etc.) can be delivered to an external station over a different protocol. A signal source is required if a signal is created on a slave protocol configuration to link events between protocols.

Example 1:

To read a coil state from a Modbus device and transfer it to IEC 60870-5-104 station, the following steps may be taken:

  1. Create a Modbus master configuration in the Devices sheet.

  2. Create an IEC 60870-5-104 slave configuration in the Devices sheet.

  3. Create a signal on the master device to read coil status (function 1).

  4. Create a signal on the slave device with a single point type (data_type = 1).

  5. Set source_device_alias and source_signal_alias fields on slave device signal to match device_alias and signal_alias on master device’s coil signal.

Example 2

To write a coil state to a Modbus device on a command from IEC 60870-5-104 station, the following steps may be taken:

  1. Follow steps 1-3 from example 1.

  2. Create a signal on the slave device with a single command type (data_type = 45).

  3. Set source_device_alias and source_signal_alias fields on the master configuration coil signal to match device_alias and signal_alias on the slave device’s command signal. Coil will be written to a value received by a command.

  4. Set source_device_alias and source_signal_alias fields on the command signal to match device_alias and signal_alias on the master device’s coil signal. A command termination signal will be reported to the station on the coil write the result.

For additional information regarding the configuration of IEC 60870-5-101/103/104 protocols, please refer to ”IEC 60780-5-101/103/104 PID interoperability for WCC Lite devices”, accordingly.

Separators

These operators can be used when defining two or more values in a single cell. For example, source_signal_alias and source_device_alias from different signals have to be written in the same cell but separated by the separators listed below. This is useful when using the operation parameter when trying to do mathematical operations on more than one signal.

18.3 Mathematical functions

Signal value might require some recalculation or signal update prior to being sent. Understandably, existing columns in Excel configuration like multiply, add, bit_select might not be flexible enough. To overcome these limitations, symbolic mathematical expressions can be configured to do calculations automatically on every update of a signal.

It should be noted that filling mathematical expression disables other mathematical scalar operations for a single value such as multiply, add or bit_select. Other functions (primarily between several signals) are still available such as operation.

Feature list:

Mathematical functions

Table. Supported mathematical functions:

Name Argument count Explanation
sin 1

sine function (rad)

cos 1

cosine function (rad)

tan 1

tangent function (rad)

asin 1

arcus sine function (rad)

acos 1

arcus cosine function (rad)

atan 1

arcus tangens function (rad)

sinh

1

hyperbolic sine function

cosh 1

hyperbolic cosine

tanh 1

hyperbolic tangens function

asinh 1

hyperbolic arcus sine function

acosh 1

hyperbolic arcus tangens function

atanh 1

hyperbolic arcur tangens function

log2 1

logarithm to the base 2

log10 1

logarithm to the base 10

log 1

logarithm to base e (2.71828...)

ln 1

logarithm to base e (2.71828...)

exp 1

e raised to the power of x

sqrt 1

square root of a value

sign 1

sign function -1 if x<0; 1 if x>0

rint 1

round to nearest integer

abs 1

absolute value

min variable

min of all arguments

max variable

max of all arguments

sum variable

sum of all arguments

avg variable

mean value of all arguments

floor 1

round down to the nearest integer

It should be noted that trigonometric functions (excluding hiperbolic functions) only support arguments in radians. This means that arguments for this function have to be recalculated if angle is defined in degress.

Value recalculation is only triggered on signal change of the preconfigured signal. That means that using other signals (via TagValue() call) does not trigger value update.

Some mathematical expression cannot be mathematically evaluated in some conditions, for example, square root cannot be found for negative numbers. As complex numbers are not supported, result is then equal to Not a Number (NaN). These results are marked with an invalid (IV) flag.

Binary operations

Table. Supported binary operators:

Operator Description Priority

=

assignment

-1

»

right shift

0

«

left shift

0

&

bitwise and

0

|

bitwise or

0

&&

logical and

1

||

logical or

2

<=

less or equal

4

>=

greater or equal

4

!=

not equal

4

==

equal

4
>

greater than

4
<

less than

4
+

addition

5
-

subtraction

5
*

multiplication

6
%

modulo

6

/

division

6

^

raise x to the power of y

7

Ternary operators can be used. This expression can be compared to the operator supported by C/C++ language (Table 39). Condition is written before a question (?) sign. If condition is true, result after question sign is selected. If condition is false, result after colon (:) is selected.

Ternary operations

Table. Supported ternary operators

Operator Description Remarks

?:

if then else operator

C++ style syntax

Examples

Users can construct their own equation by using the aforementioned operators and functions. These examples can be seen in Table below.

Table. Example expressions

Expression

Description

value * 0.0001

Multiply the tag by a constant.

value + TagValue(”tag/dev_alias/sig_alias/out”)

Add value of tag/dev_alias/sig_alias/out to the current tag.

sin(value)

Return a predefined sine function value of the tag.

(value>5)? 1: 0

If the value is greater than 5, the result should be equal to 1, otherwise - equal to 0

Variable called value is generated or updated on every signal change and represents the signals being configured. If another value from tag list is intended to be used, one should use TagValue() function to retrieve its last value.

The inner argument of TagValue() function has to described in a Redis topic structure of WCC Lite. That means that it has to be constructed in a certain way. Quotes should be used to feed the topic name value, otherwise expression evaluation will fail.

Every Redis topic name is constructed as tag/[device_alias]/[signal_alias]/[direction]. Prefix tag/ is always used before the rest of argument. device_alias and signal_alias represent columns in Excel configuration. direction can have one of four possible values - rout, out, in, rin; all of which depend on the direction data is sent or acquired device-wise. For example, out keyword marks data sent out of WCC Lite device, whereas in direction represents data that WCC Lite is waiting to receive, for example, commands. Additional r before either direction means that data is raw, it was is presented the way it was read by an individual protocol.

Extra functions

Several functions are defined make tag operations possible:

18.4 Uploading configuration

As of WCC Lite version v1.4.0, there are three separate ways to import the configuration: import an Excel file via the web interface, generate compressed configuration files and later upload them via the web interface; or generate compressed configuration files and upload them via utility application.

For WCC Lite versions v1.4.0, the name of the file is shown in Protocol Hub->Configuration. Older versions only allow configuration files to be stored to a file called phub.xlsx and later downloaded with a custom-built name reflecting the date of a download. Upgrade process from older version to versions v1.4.0 and above when preserving configuration files automatically makes the necessary changes to enable this new functionality of WCC Lite.

If a user intends to downgrade the firmware to versions older than version v1.4.0 from newer versions, he/she must first download the configuration files and later reupload the configuration after finishing the upgrade process.

Importing an Excel file

Excel files can be imported without any external tools. This option can be used where there is no internet connection or only minor change has to be applied. This way of importing is not suitable for the validation of Excel configuration files.

Generating configuration is a resource-intensive task. It might take up to 10 minutes depending on configuration complexity

Supported types of an Excel configuration: .xlsx, .xlsm, .xltm, .xltx

To upload an Excel file, open Protocol Hub->Configuration screen in Web interface, select Configuration file, and press Import configuration.

Generating .zip file

To accelerate the task of generating configuration a computer can be used. For this users should download the WCC Excel Utility application. Upon opening an application, the user should search for a field called Excel file which lets to choose an Excel file for which a conversion should be made. The output file should be filled out automatically, however, this value can be edited.

To make a conversion press Convert. If there are no errors found in the configuration, the output file should contain the generated configuration, otherwise, an error message is shown to a user.

This .zip file can be uploaded via the Web interface, using the same tools as used for import of an Excel file.

Uploading configuration remotely

As of WCC Lite version, v1.4.0 generated configuration files can be uploaded with a click of a button in the Excel Utility. There are four parameters (not counting the configuration file itself) that have to be filled in before starting upload:

  • Hostname: an IP address for the device to connect to. This field conforms to hostname rules, therefore, if an invalid value is selected, it is reset to default (192.168.1.1);

  • Port: a PORT number to which an SSH connection can be made; valid values fall into a range between 1 and 65535; if an invalid value is selected, it is reset to default (22);

  • Username: a username which is used to make an SSH connection; make sure this user has enough rights, preferably root;

  • Password: a password of a user used for establishing an SSH connection;

Configuration can only be uploaded if a port used for SSH connection is open for IP address filled in the hostname entry field. Please check WCC Lite firewall settings in case of connection failure.

To upload a configuration remotely, press Upload configuration. If no errors occur, you should finally be met with text output mentioning configuration has been applied. During the course of the upload process, the aforementioned button is disabled to prevent spanning multiple concurrent processes.

18.5 Virtual device

General

The virtual device is a device that you can use to calculate additional math or keep a counter. It doesn't bind to any protocol and only works when its math expression is used. 

Virtual device functionality is only available since firmware version v1.6.3, of WCC Lite.

Configuring Virtual device

To configure WCC Lite to use the virtual device you must configure the device and signal sheets. 

Virtual device parameters for Device tab:

Parameter

Type

Description

Required

Default value

(when not specified)

Range

Min

Max

name string User-friendly device name Yes


description string Description of the device No


device_alias string Device alias to be used in the configuration Yes


protocol string Selection of protocol Yes
virtual

Virtual device parameters for Signals tab:

Parameter

Type

Description

Required

Default value

(when not specified)

Range

Min

Max

signal_name string User-friendly signal name Yes

 



device_alias string Device alias from a Devices tab Yes


signal_alias string Unique signal name to be used Yes


math_expression string

Field to calculate specific math. 

You must enter the signal you want to use.

Yes

The only field that is a must to use the virtual device is the math_expression field. Here you need to enter the signal which you want to associate it with. Some examples of what it can do: