how to put data manual by use of processbook...
Regarding your question, we need some clarification: By "put data" do you mean writing events to AF Server or PI Data Archive? Is it a Collective?
i just want to write some manual input to the AF server and yes it is collective.
idea is to make an display for maual entery in procesbook by the operator.
YOU CAN TRY THESE..ITS FOR ENTERING VALUES USING PI SDK
Private Sub Submit1_Click()
Dim pipt As PIPoint
Dim pidata As pidata
Dim srv As Server
Dim pt As New PITimeFormat
Dim nam As Integer
Dim YesOrNoAnswerToMessageBox As String
Dim QuestionToMessageBox As String
'Code to set target
'Set refrences of PI SDK & PI Time
On Error GoTo eh
Set srv = PISDK.Servers("PIISERVER") 'sET pI sERVER
Set pipt = srv.PIPoints("Entry2_M") ' SETPI TAG
Set pidata = pipt.Data
QuestionToMessageBox = "Do want to save the value to PI Server?"
YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbYesNo, "Save Value to PI Server")
If YesOrNoAnswerToMessageBox = vbNo Then
MsgBox "Value Not Changed"
nam = ManualData1.Text
pidata.UpdateValue ManualData1.Text, pt, dmInsertDuplicates ' Update PITag value in Pi server
MsgBox "Value saved as :" & nam
Hi IIyas ,
Could you provide more information regarding the code to manually put data in PI using a PI-Processbook display? A screenshot of the display would help.
It looks like Ilyas has a Command Button called "Submit1" and then a text box called "ManualData1". If you create a display with these two elements, you should be able to copy and paste Ilyas' code into the VBA editor to test it out. Keep in mind that you will need to add the PISDK references and that you'll probably need to change the PI Server name and tag name.
For the PISDK references, are you talking about the modules piapi32 and StrFuncs?
To add the PISDK references:In Visual Basic Editor in PI ProcessBook, click on Tools > References, do you see PISDK Type Library (windows path: PIPC\pisdk\pisdk.dll)? If so, select the check box and click ok.
It will be good to add the PITimeServer Library too as I see that Ilyas's code makes use of that.
If you mean data entry to a PI point, then something like Ilyas suggested would work, and you could use VBA with ProcessBook for data entry.
However, you said that you wanted manual entry to AF. Could you clarify on this? AFSDK cannot be directly used with ProcessBook and to do so would require a wrapper to be written. What in AF are you trying to write to?
Retrieving data ...