Advanced OPC Data Logger

Trust In Confidence!

For Windows 2000 - Windows 10 (2016) (incl. Server, x86 and x64). Latest version: 3.2.6 build 711. .


Filtering data out if a OPC tag value is not equal to a specified value

Problem scenario:

I have this item Kemro.opc.4.IF1.1.92.Mars1.SVs.system.sv_ShotCounter[14]="1" in OPC Data Logger. I want to take data and write it to MySQL, only when the value will be equal "1".

Requirements:

It is assumed that:

1. You've created a configuration (using the "Green Plus" button in the main window and added an OPC group in the opc logger and can receive any data from an selected OPC server.

2. The OPC tag has the numerical data type.

3. You've configured a data export to MySQL.

Solution:

1. Enable highlighted options in the OPC group settings.

OPC group settings

Fig.1. OPC group settings

2. The tag name must contain alphanumberic or "_" characters only. If the tag name contains other characters (as in the problem scenario) then you must assign a new shorten valid name (fig. 2). In this tutorials the new name will sv_ShotCounter.

Assigning new name

Fig.2. Assigning new name

3. Download and install the "Expressions" plugin.

4. Enable it (fig. 3).

Expressions plugin

Fig.3. Expressions plugin

5. Select the plugin in the list and click the "Setup" button below.

6. In the editor window (fig. 4) specify the following expression. Please, note that the new tag name is used in this expression.

DISCARD_DATA_PACKET_IF(sv_ShotCounter<>1)

The filter expression

Fig.4. Expression

7. Click the "OK" button and save all changes.

Related articles:

OPC and DCOM Configuration on Windows 2008 and Windows 7

OPC and DCOM Configuration on Windows Server 2012 and Windows 8