Back

Topic

[KB774]Configuring a variable trace

Tags: Variables

10 years ago
By RM
Options
Print
Applies to:

PcVue 9.0 SP2 and later


Summary:

How to trace the actions and events of a particular variable or variables.


Details:

You can trace the actions and events associated with a particular variable or variables in the Event Viewer.To enable a variable trace, (from PcVue 9.0 SP2 until PcVue 15.0) you add the following lines to varconf.dat found in the C folder:

[VARIABLESTRACE]
  Name0=<Varname a>
  Name1=<Varname b>

From PcVue 15.1 onwards, you add the following lines to the file PER\TracesConf.dat:
[Variables]
<Varname a>=FFFFFFFF
<Varname b>=FFFFFFFF

Where <varname a> etc. is the full name of a variables tree variable. For example: Branch02.Branch01.Register01
The number of variables to which you can apply the trace is not limited but be aware that it produces a verbose output!

When you have added a variable trace, you will see something like the following in the Event Viewer at startup.

2014/01/27,14:01:57.732,5,T,,0,,1,—-STARTWATCH—- group=0ms
2014/01/27,14:01:57.732,5,I,,316,,1,Message ID          = Branch01.Branch02.Register01 WatchAna
2014/01/27,14:01:57.732,5,I,,318,,1,Type                = Watch
2014/01/27,14:01:57.732,5,I,,320,,1,Function            = 511
2014/01/27,14:01:57.732,5,I,,322,,1,Source manager      = UserInterface
2014/01/27,14:01:57.732,5,I,,324,,1,Destination manager = Variable
2014/01/27,14:01:57.732,5,I,,326,,1,Source station      = 1
2014/01/27,14:01:57.732,5,I,,328,,1,Destination station = 1
2014/01/27,14:01:57.732,5,T,,0,,1,Register subscription[0ms] response to UserInterface manager of station number=1 Branch01.Branch02.Register01 [ Value=0 Timestamp=27/01/14,14:01:57:249 (SV) Status= ( NS )]
2014/01/27,14:01:57.732,5,T,,0,,1,First response
2014/01/27,14:01:57.732,5,T,,0,,1,Send Register subscription response to UserInterface manager station number=1 Branch01.Branch02.Register01 [ Value=0 Timestamp=27/01/14,14:01:57:249 (SV) Status= ( NS )] Transition UNKNOWNTRANS

Further trace information will appear each time the value of the variable changes or there is some other action to report. For example:

2014/01/27,14:54:17.721,5,T,,0,,1,WriteVar Branch01.Branch02.Register01 value=32767.5
2014/01/27,14:54:17.721,5,T,,0,,1,Current value = [ Value=0 Timestamp=27/01/14,14:51:42:922 (SV) Status= ( NS )]
2014/01/27,14:54:17.721,5,T,,0,,1,Write different value=32767.5
2014/01/27,14:54:17.721,5,T,,0,,1,Register subscription[0ms] response to UserInterface manager of station number=1 Branch01.Branch02.Register01 [ Value=32767.5 Timestamp=27/01/14,14:54:17:721 (SV) Status=OK]
2014/01/27,14:54:17.721,5,T,,0,,1,Send Register subscription response to UserInterface manager station number=1 Branch01.Branch02.Register01 [ Value=32767.5 Timestamp=27/01/14,14:54:17:721 (SV) Status=OK] Transition VAL

You can also use (from PcVue 10.0 SP2) the SCADA instruction VARIABLE(“TRACE”, Var_Name, “ON/OFF”)

Since PcVue 15, it is possible to trace variables from the Application Explorer.
Firstly you have to activate the following property in the file Bin\AiexplorerConfig.xml:
<FieldName dt=”string”>bAllowVariableTracing</FieldName>
<FieldValue dt=”boolean”>True</FieldValue>

In the variable selector, a right click on a variable open a popup and select ‘Set trace’ or ‘Reset trace’:
Set trace from AI explorer

All variables where ‘Set trace’ is applied are saved in PER\TracesConf.dat


Created on: 13 Apr 2015 Last update: 04 Sep 2024