Quick Help

Knowledgebase is a categorized collection of answers to frequently asked questions (FAQ) and articles. You can read articles in this category or select a subcategory that you are interested in.



 Filtering the infomation in a data logger

Problem

We are reading the infos of a machine, which are like 40 different values but we do not want to read it every 30 seconds but only if a value of these 40 changes. We are not able to do it with your filter options.

Solution

The Enterprise edition of our data logger has many filter plugins. In this case you may use the "Script Execute" plugin with a custom script:

Note: any parser plugin should be configured before in some data loggers.

1. Enable the plugin (fig.1).

Filter plugin

2. Copy and paste the following "Pascal Script" (fig.2).

Script

var i: integer;
 s, s1, s_prev: string;
 v: variant;
 sName: string = 'LAST_STATE';
begin
 s := ''; // this script variable will contain a representation of all values
 // repeat for all values in a data packet
 for i := 0 to GetVariableCount-1 do
  begin
   v := GetVariableByIndex(i);
   s1 := UpperCase(GetVariableNameByIndex(i));
   if(s1 <> 'DATA_PACKET')and
     (s1 <> 'FULL_DATA_PACKET')and
     (s1 <> 'DATE_TIME_STAMP')then
    s := s + VarToStr(v) + '|';
  end;

 // checks that a last state was stored before
 if IsVariableStored(sName) then
   // retrieves a stored variable
   s_prev := PopVariable(sName)
 else
   // otherwise initialize our value
   s_prev := '';

 // check if any value is changed
 if s_prev <> s then
  // stores a value between script executions
  PushVariable(sName, s)
 else
  // discard data (do not export)
  DiscardDataPacket();
end.

Attachments:
img1.png img1.png
img2.png img2.png

 
Was this article helpful? yes / no

Article details

Article ID: 81

Category: Data Loggers

Date added: 2017-03-31 05:36:47

Views : 1077

Rating (Votes): Article rated 5.0/5.0 (1)