Hello guys, I just stumbled upon this forum using google and I hope you guys can help me out with a problem im having.
I am trying to configure a Triend Client in a graphic object using scripting.
First I configure the historian, then I add 1 Pen and then I configure that pen1. now the problem is I have alot of trends to configure and every trend has multiple pens. So if i have to configure the expression, Units, Trend high and trend Low for every pen for multiple trends, that's gonna take alot of time.
So my idea was to make a property that contains the expression and then in scripting use that property and the specified text to it, soo for example:
my expression or object is:
But what I wanna do is this:
BUT this doesn't really work. the trendclient will see this as a String and just put the string there. so in Windowviewer trendhi and trendlo would display NaN (not a number) cause it's a string. is there anyway to let the program now its a reference or a property?
I am trying to configure a Triend Client in a graphic object using scripting.
First I configure the historian, then I add 1 Pen and then I configure that pen1. now the problem is I have alot of trends to configure and every trend has multiple pens. So if i have to configure the expression, Units, Trend high and trend Low for every pen for multiple trends, that's gonna take alot of time.
So my idea was to make a property that contains the expression and then in scripting use that property and the specified text to it, soo for example:
my expression or object is:
in that object I have configured the units, trendhi and trendlow so the right references would be (in the script of the trend graphic object):Temperature01
TrendClient.Units = Temperature01.EngUnits
TrendClient.TrendHi = Temperature01.Trendhi
TrendClient.TrendLo = Temperature01.TrendLo
But what I wanna do is this:
So that I only have to fill in the property Pen01 and let the scripting do the rest.Pen01 = Temperature01
TrendClient.Units = Pen01 + ".EngUnits"
TrendClient.TrendHi = Pen01 + ".TrendHi"
TrendClient.TrendLo = Pen01 + ".TrendLo"
BUT this doesn't really work. the trendclient will see this as a String and just put the string there. so in Windowviewer trendhi and trendlo would display NaN (not a number) cause it's a string. is there anyway to let the program now its a reference or a property?