Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84249members
353348posts

Cannot Change Marker Limit using .NET API and ViewX Automation

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
du5tin
Lieutenant
Lieutenant
0 Likes
1
612

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 (1)

Accepted Solutions
du5tin
Lieutenant
Lieutenant

Re: Cannot Change Marker Limit using .NET API and ViewX Automation

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;

}

 

See Answer In Context

Tags (1)
1 Reply 1
du5tin
Lieutenant
Lieutenant

Re: Cannot Change Marker Limit using .NET API and ViewX Automation

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 (1)