- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
Cannot Change Marker Limit using .NET API and ViewX Automation
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;
}
- Tags:
- english
Authentication Failed.
- Authentication Ticket Mismatched, failed authentication.
Link copied. Please paste this link to share this article on your social media post.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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;
}
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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;
}
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.

