AnsweredAssumed Answered

Add a PI expression in a graph in C#

Question asked by Ieltxu on Jan 30, 2017
Latest reply on Mar 1, 2018 by jnetz

I know how to plot a tag in a display in C#. But I need to do it with a PI expression...


PBSymLib.Trend myTrend;
PBObjLib.Display myDisplay;

myDisplay = axPbd1.Display as PBObjLib.Display;
PBObjLib.Symbol mySymbol = myDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolTrend);
myTrend = (PBSymLib.Trend)mySymbol;

Datasets MyDatasets = myDisplay.Datasets;
PIExpressionDataset MyDataset = MyDatasets.Add("NUEVO", null, true, 10, true, (int)pbDatasetType.pbDatasetPIExpression) as PIExpressionDataset;
MyDataset.Expression = tag + "+ 5";
MyDataset.ColumnName = "Value";
MyDataset.Interval = "10s";
MyDataset.Visible = true;
MyDataset.Stepped = true;

myTrend.SetTimeRange("2017/01/29", "2017/01/30");



Could you help me please?