Combination of "FILTER" and "EVENTMASK"

10 Posts
5 Users
0 Likes
46 Views
(@d.schmidt@pcvue.de)
Posts: 0
New Member Guest
 

Hi,
I have a problem with the filtering of the LogViewer.

I would like to combine a filter that uses bothe the Mnemonics FILTER and EVENTMASK.
I want to use FILTER for the display of the respective variable names and EVENTMASK for User login and logoff.

When I use only one (FILTER or EVENTMASK), the respective action works, but I cannot figure out how to combine them.

FILTER:
VarFilter = Addstring("=#t BEG ",WindowsBranch);
LogDisplay("FILTER", GETARG("WINDOW"),WindowsBranch, "Log1", VarFilter, 1 );

EVENTMASK:
LogDisplay("EVENTMASK", GETARG("WINDOW"),WindowsBranch, "Log1", mask1,1);

I'm using HDS archiving.

My question is:
Did anybody ever try something like that?
Is it possible at all?

Thanks a lot in advance for your ideas?

BR,
Daniel

 
Posted : 18/11/2014 8:07 pm
e.mahaut
(@e-mahautarcinfo-com)
Posts: 270
Member Moderator
 

Hi Daniel,

I take this opportunity regarding our conversation of yesterday, about the behavior which is different when the archive unit type is HDS or proprietary. I confirm what I said.

As a matter of fact, applying the following filter using LogDisplay, leads to 2 results:
Print ("HDS : ", LogDisplay("FILTER", "LogMimic", "", "LogHDS", "=(#t BEG Branch01)"));
1/ HDS: only events matching the filter are displayed excluding programs and login/logoff
2/ Proprietary: only events matching the filter are displayed including programs and login/logoff

I know that for HDS format, the filter is converted as ...[Name] like 'Branch01%'
But actually I am not able to say if the first result or the second one is good or both depending on the archive unit type.

BR
Edouard

PS: I let the others react on your first question and this answer.

 
Posted : 19/11/2014 9:01 pm
(@d.schmidt@pcvue.de)
Posts: 0
New Member Guest
 

Hi Edouard,

thanks a lot for your feedback!
At least we know now that this is by design.

BR,
Daniel

 
Posted : 19/11/2014 9:11 pm
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

Daniel,

The modes FILTER and EVENTMASK have an optional flag called [context].
If set to 1 Scada Basic will wait the mode "EXECUTE" to apply both "filters" in 1 shot.

 
Posted : 20/11/2014 8:40 am
(@admin_doc72)
Posts: 493
Member Admin
 

At least we know now that this is by design.

I think this is not what Edouard wanted to express.
As pointed out it would be interesting to understand if the behavior of the HDS or the proprietary unit is the desired one. Or - if both is correct - the diverging behavior is intended?

Anyway, Nico's suggestion sounds like a solution. Does it solve your problem?

 
Posted : 20/11/2014 2:06 pm
f.martin
(@f-martinarcinfo-com)
Posts: 148
Member Admin
 

Hello,

I think Edouard gave the correct explanation. I had quite the same problem with Vergnet, but with empty domain.

I did not remember me the correct syntax, but you have to create a filter indicating that you want to include the empty varname...

Try something like: "[OR]#t BEG Branch,[OR]#t="

SPR #13393

 
Posted : 20/11/2014 3:19 pm
(@d.schmidt@pcvue.de)
Posts: 0
New Member Guest
 

Hi,
Thanks for your feedback first of all!

So far I tried with Nico's approach, but it doesn't work properly. When I do it like this, the LogViewer remains empty.

Here is my code:
Dim WindowsBranch as Str;
Dim VarFilter as Str;
mask1=128;
WindowsBranch = Getarg("WBRANCH");

VarFilter = Addstring("=#t BEG ",WindowsBranch);
Print ("Filter: ",VarFilter);

LogDisplay("FILTER", GETARG("WINDOW"),WindowsBranch, "Log1", VarFilter,1);
'Print("check1: ",check1);
wind = GetArg("WINDOW");
Print(wind);
check2=LogDisplay("EVENTMASK", GETARG("WINDOW"),WindowsBranch, "Log1", mask1,1);
Print("check2: ",check2);

check3=LogDisplay("EXECUTE", GETARG("WINDOW"), WindowsBranch, "Log1");
Print("check3: ",check3);

Did I miss something?

As I said, only one filter always works, but the combination doesn not work.

Thank you.

BR,
Daniel

 
Posted : 20/11/2014 5:25 pm
f.martin
(@f-martinarcinfo-com)
Posts: 148
Member Admin
 

With HDS units, when you apply a filter on variable name, it automatically exclude all event that are not linked to a variable:
- login
- logoff
- program execution
- ...

The workaround I found in Vergnet was to include the empty string with the following filter:
"[OR]#t BEG Branch,[OR]#t="

 
Posted : 20/11/2014 5:36 pm
(@d.schmidt@pcvue.de)
Posts: 0
New Member Guest
 

Hi Florent,
I also tried with the workaround.
But unfortunately the result is the same. As soon as I add the second part of the filter (||#t=), the logviewer is always completely empty.

This is what my filter looks like in the result view: =#t BEG Branch||(=#t ).
I also tried =(#t BEG Branch)||(=#t ) and some other variations, but the result doesn't change.

BR,
Daniel

 
Posted : 20/11/2014 6:33 pm
(@d.schmidt@pcvue.de)
Posts: 0
New Member Guest
 

Hello,

I finally figured out the solution with the help of Armin for Florent's approach.

This is the code:
VarFilter = Addstring("=(#t BEG '",WindowsBranch);

VarFilter = Addstring(VarFilter,"') || (#t=='')");
Print ("Filter: ",VarFilter);

LogDisplay("FILTER", GETARG("WINDOW"),WindowsBranch, "Log1", VarFilter);

Thank you all for your help!

BR,
Daniel

 
Posted : 20/11/2014 7:11 pm