3 Replies Latest reply on Dec 5, 2014 4:07 PM by dhollebeek

    Coding to change tags name


      Hi all,




      In below works, when I click [Report.PDI]'s C1 rectangle, it will call out [C1.PDI]. Now I want writing coding [Report.PDI]'s C2,C3....... can call [Common.PDI] to display C2, C3 ....... 's trend.


      I don't want to create [C2.PDI], [C3.PDI] ......


      Any example/ coding can help me to solve this problem.



























        • Re: Coding to change tags name

          Hi Thomas,


          hope i understand your problem the right way.


          you can use a PDI which is containing an empty trend (e.g. display1 containing trend object trend1). in the calling display (display 2) you can use the following code:


          Private Sub Rectangle1_Click(ByVal lvarX As Long, ByVal lvarY As Long)


          Dim d1 As Display


          Set d1 = Application.Displays.Open("\\\RPZMSxxxx\Displays\display1.pdi", True)


          d1.trend1.AddTrace ("\\PIServername\sinusoidu")


          End Sub


          Private Sub Rectangle2_Click(ByVal lvarX As Long, ByVal lvarY As Long)


          Dim d1 As Display


          Set d1 = Application.Displays.Open("\\RPZMSxxxx\Displays\display1.pdi", True)


          d1.trend1.AddTrace ("\\PIServername\sinusoid")


          End Sub


          when clicking on Rectangle1 the trend is confiugred with sinusoidu when clicking on Rectangle2 the trend is configured with sinusoid tag.