3 Replies Latest reply on Aug 25, 2015 2:04 PM by aksnk89

    Processbook Trend Scales

    aksnk89

      HI ,

      I have created a trend in processbook with all the required configuration . The trend is a multiscaled trend . Each trace has a different max and min scale.

      I have written a piece of code to replecate the trend with same configuration but the problem i am facing is for the Max and Min for each trace of the trend. It tends to take the Max and Min of the last Trace in the Trend.

       

      For j = 1 To trnd.TraceCount

                  sTagName = trnd.GetTagName(j)

                  minS = trnd.ScaleMin

                  maxS = trnd.ScaleMax

                  sTagName = Replace(sTagName, Trim(txtPath1.Text), Trim(txtPath2.Text))

               

                 On Error Resume Next

                 trnd.SetTagName j, sTagName

                 trnd.SetTraceScale minS, maxS

      Next j

       

       

      Can anybody solve this issue ?

        • Re: Processbook Trend Scales
          Asle Frantzen

          Hi

           

          How about doing what I normally do with this:

           

              'Remove all trend traces
              For vIndex = thisTrend.TraceCount To 1 Step -1
                  status = thisTrend.RemoveTrace(vIndex)
              Next vIndex
          

           

          Remove everything, and then re-add with correct configuration.

          • Re: Processbook Trend Scales
            Rhys Kirk

            For j = 1 To trnd.TraceCount

                        trnd.CurrentTrace = j

                        sTagName = trnd.GetTagName(j)

                        minS = trnd.ScaleMin

                        maxS = trnd.ScaleMax

                        sTagName = Replace(sTagName, Trim(txtPath1.Text), Trim(txtPath2.Text))

                    

                       On Error Resume Next

                       trnd.SetTagName j, sTagName

                       trnd.SetTraceScale minS, maxS

            Next j

            1 of 1 people found this helpful