Hello everybody,

I have 2 numbers entered in PI ProcessBook. I would like to perform a mathematical operation on these numbers.

Ex. Value 1= 25, Value 2= 15 (these values are not taken from PI server, but are entered manually)

Lets say I would like to add these numbers and get the addition as a third value in PI ProcessBook.

Is there a possible way to do this operation using VBA / PI calculations?

Thank you for your help.

Regards

Alex

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