shimh Posted June 26, 2008 Share Posted June 26, 2008 I am trying to dynamically draw different function curves on a graph. So this is what i am doing: component.graph.addtrace (test1) component.graph.test1.strYExpression = channelname It does not work. What did I do wrong? Link to comment Share on other sites More sharing options...
AzeoTech Posted June 26, 2008 Share Posted June 26, 2008 What is channelname? Is it a string variable containing the expression? It should not simply be the name of some channel. So, if you have a channel named MyChannel, this would work: component.graph.addtrace (test1) component.graph.test1.strYExpression = "MyChannel" or: private string channelname = "MyChannel" component.graph.addtrace (test1) component.graph.test1.strYExpression = channelname but this won't: component.graph.addtrace (test1) component.graph.test1.strYExpression = MyChannel since then it would be assigning the contents of MyChannel to the expression. Link to comment Share on other sites More sharing options...
Eythor Posted March 1, 2011 Share Posted March 1, 2011 Hi After testing above code I notice that it's not working. This is the correct way to add trace to a graph: component.graph.AddTrace ("test1") component.graph.test1.strYExpression = "MyChannel" The channel name that is added to the trace must have "_" → AddTrace ("test1") PS. Have made a example that is attached to this post showing how to add trace with button and quick sequence. Best Regards Eythor EX_AddTrace.ctl Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.