mikeloria

Writing to History with PI Ace

Discussion created by mikeloria on Oct 8, 2011
Latest reply on Oct 11, 2011 by michaelh

 I recently started embracing PI Ace and found some tremendous advantages in using it. I am a C# programmer so I was using event pipes and OLEDB Provider to accomplish what I needed to do. I recently converted my code over into PI Ace but I am having trouble writing multiple values to an output tag.

 

Is there a limitation in doing this?

 

Here is a code snippet:

 
'get the 10 foot data

'1) Get the tach count at a given footage interval (0,10,20,30)

'2) Determine the time for the tach count based on a tachCounter PIPoint

'3) Write the footage to the PIAcePointAllias point at the given time when the tachcounter is equal to the calculated value

 

 

        Dim ValueToWriteToPI As Integer

        Dim CalculationValue As Integer

        Dim ValueTimeForEachPiValueIamWriting As PITimeServer.PITime

        Dim i As Integer

 

        ValueToWriteToPI = 0

        CalculationValue = 0

 

        i = 0

        While (i < 2000)

                CalculationValue = TachcountConstant + Convert.ToInt32(i * 731.79656)

                ValueTimeForEachPiValueIamWriting = tachCounter.FindEQ("*-2h", "*", CalculationValue)

                PIACEPointAlias.Value(ValueTimeForEachPiValueIamWriting) = ValueToWriteToPI

 

            i = i + 10

 

        End While

 

 

PIACEPointAlias is the alias that I am trying to write to and it is an int32. I am basically calculating a new time based on the time when another PIpoint (tachCounter) is equal to a certain value.

 

 

 

I also have a question on findEQ. I am assuming that it will interpolate? is that coorect? I tried findGE and findLE but got strange results. What I am doing is using a tach count and converting it to a footage and writing equally spaced fottages into PI for statistical and reporting purposes.

 

 

 

Thank you so much in advance for your help in this.

Outcomes