EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-09-14 09:05 PM . Last Modified: 2023-05-03 12:10 AM
Hi,
I am working with ViewX automation to program the creation and update of thousands of trend objects. Templates won't work here, the customer has many different internal opinions about which trends look good.
I can seem to edit almost all the properties but I cannot seem to edit the Marker limit or other marker properties.
private void AddTrace(dynamic traces, string relativePath, string label,
TraceDataMode mode, TraceColors color, string yaxis, DrwDashStyle style = DrwDashStyle.DashSolid)
{
// added for CS 2017 R2 August
System.Threading.Thread.Sleep(1000);
dynamic newTrace = traces.Add(mode, _systemName, relativePath);
newTrace.Label = label;
newTrace.TraceStyle = TraceStyle.TraceLine;
newTrace.Interval = "5M";
newTrace.LineColour = (int)color;
newTrace.LineStyle = style;
newTrace.LineWidth = 1.0;
newTrace.MarkerLimit = "0"; // This line and the next two fail
newTrace.MarkerSize = 2; // What is the correct field name?
newTrace.MarkerStyle = MarkerStyle.Diamond; // Fails too (this enums to zero)
newTrace.ShowMarkers = 0;
newTrace.ShowAnnotations = 0;
newTrace.ShowAlarmLimits = 0;
newTrace.YAxis = yaxis;
}
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-09-15 12:19 AM
So I ended up figuring out something and getting this working. Updated code looks like:
private void AddTrace(dynamic traces, string relativePath, string label,
TraceDataMode mode, TraceColors color, string yaxis, DrwDashStyle style = DrwDashStyle.DashSolid)
{
// added for CS 2017 R2 August
System.Threading.Thread.Sleep(1000);
dynamic newTrace = traces.Add(mode, _systemName, relativePath);
newTrace.Label = label;
newTrace.TraceStyle = TraceStyle.TraceLine;
newTrace.Interval = "5M";
newTrace.LineColour = (int)color;
newTrace.LineStyle = style;
newTrace.LineWidth = 1.0;
newTrace.MarkerLimit = (int)1; // I think the API won't let values less than 1 go by
// Following two lines were not required for this config, commented out
// newTrace.MarkerSize = 2;
// newTrace.MarkerStyle = MarkerStyle.Diamond;
newTrace.ShowMarkers = 0;
newTrace.ShowAnnotations = 0;
newTrace.ShowAlarmLimits = 0;
newTrace.YAxis = yaxis;
}
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-09-15 12:19 AM
So I ended up figuring out something and getting this working. Updated code looks like:
private void AddTrace(dynamic traces, string relativePath, string label,
TraceDataMode mode, TraceColors color, string yaxis, DrwDashStyle style = DrwDashStyle.DashSolid)
{
// added for CS 2017 R2 August
System.Threading.Thread.Sleep(1000);
dynamic newTrace = traces.Add(mode, _systemName, relativePath);
newTrace.Label = label;
newTrace.TraceStyle = TraceStyle.TraceLine;
newTrace.Interval = "5M";
newTrace.LineColour = (int)color;
newTrace.LineStyle = style;
newTrace.LineWidth = 1.0;
newTrace.MarkerLimit = (int)1; // I think the API won't let values less than 1 go by
// Following two lines were not required for this config, commented out
// newTrace.MarkerSize = 2;
// newTrace.MarkerStyle = MarkerStyle.Diamond;
newTrace.ShowMarkers = 0;
newTrace.ShowAnnotations = 0;
newTrace.ShowAlarmLimits = 0;
newTrace.YAxis = yaxis;
}
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.