
Re: Mathematical Calculations in PI Process Book
dhollebeek Jun 5, 2012 2:30 PM (in response to AlexSempf)Alex,
It should be fairly simply in VBA. How you get the values from the PDI depends on the type of control these values are stored in the PDI. It's probably a MS Text Box or something, so. In VBA, you can do:
' written from memory, there may be some compile errors here, but you get the gist.
Dim result as Integer
result = Cint(MSTextBox1.Text) + Cint(MSTextBox2.Text)
MSResult.Text = Cstr(result)
Dave :D

Re: Mathematical Calculations in PI Process Book
AlexSempf Jun 5, 2012 3:14 PM (in response to dhollebeek)Hi Dave,
Thank you for your help. It worked when we used "Contents" instead of "Text".
Kind regards,
Alex

Re: Mathematical Calculations in PI Process Book
AlexSempf Jun 6, 2012 9:29 AM (in response to AlexSempf)I guess it will be a simple solution again but I am trying to add the result value to a trend in ProcessBook (without success so far). Is that possible too?
Instead of
MSResult.Text = Cstr(result)
there just should be something like
TrendResult.TrendValue = result (???)

Re: Mathematical Calculations in PI Process Book
andreas Jun 6, 2012 9:41 AM (in response to AlexSempf)Alexander, that will be not that simple. What you need to do is creating a dataset. An example how to do this you can find here: vcampus.osisoft.com/.../comparedailyvalues.aspx

Re: Mathematical Calculations in PI Process Book
AlexSempf Jun 6, 2012 10:00 AM (in response to andreas)Hey Andreas,
thanks a lot for the fast response. It looks like what I am looking for... Let me try and give feedback then...
Alex



