That gives me a reason to install a 64bit OS
However, you are introducing two issues here: 1. The 64bit system and 2. the Visual Studio Express.
Jan van der Ven
Later that day I used PB with a PDI file that had some code behind the form. This also failed in the UpdateValue function.
Can you provide the PDI file or some code to demonstrate the issue?
Andreas, when you do your tests I seem to remember seeing something similar but can't exactly remember order & details
I think the issue I had is because the 64bit SDK is installed after the 32bit SDK in the same directory - ProcessBook is installed (32bit SDK) on 64bit OS that puts SDK files in "...PIPC\PISDK" (I didn't put it in "..PIPC (x86)\PISDK"), then for other tasks I installed 64bit SDK in to the same directory. So the registry for 32bit PISDK points to the same directory where 64bit SDK now resides. Had to do some fiddling with the registry and a reinstall of SDK's to get it to work properly.
As I said I am relying on my overworked brain to remember that one, so it might not be entirely accurate.
So after Rhys warning I did install first the PI ProcessBook (with the 32bit PI SDK) in the Program Files (x86) folder and tested the PDI - works fine. Afterwards I did install the 64bit PI SDK in the Program Files folder and tested again - same result.
Did you install the 64bit PI SDK prior to the 32bit, or like I did first the 32bit PI SDK and later the 64bit?
64 bit first.
I'll reinstall everything in your order and see what happens.
So I uninstalled everything from OsiSoft (I did not uninstall the two Microsoft prerequisites kits).
Then I installed ProcessBook, ran my PDI again and got the same error message. I dug a bit deeper and found that my computer and the PI Server had a +10 minute time difference, which was causing the error. This was not related to ProcessBook at all. Sorry for that.
I then started the add-in project again, but that kept complaining about COM exceptions. I started a completely new project and this time I only changed the location of ProcBook.exe to Program Files (x86). Surprisingly this also worked. This is something I do not understand. As far as I know VS C# 2008 Express will create 64 bit code by default on a 64 bit system. However, when I inspected the dll with depends (http://www.dependencywalker.com/) it showed it as x86.
Finally I installed the 64 bit version of PIOLEDB, and verified that that worked as well.
Thanks everybody for helping me out.
Thank you for your quick reply.
The 32 bit SDK is in Program Files (x86)\PIPC
and the 64 bit SDK is in Program Files\PIPC
This is the output of the About ProcessBook:
COMCTL32.dll 6.0.6001.18000 6.10.6002.18005 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_5cb72f96088b0de0\
MFC80.DLL 8.00.50727.4053 8.0.50727.4053 C:\Windows\WinSxS\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.4053_none_cbf21254470d8752\
ModContextSupport.ocx 3.02 18.104.22.168 C:\Program Files (x86)\PIPC\PROCBOOK\ModuleContext\
ModuleContext.dll 3.02 22.214.171.124 C:\Program Files (x86)\PIPC\PROCBOOK\ModuleContext\
MSO9.DLL 9.0.4402 126.96.36.19902 C:\Windows\SysWOW64\Office\
MSVBVM60.DLL 6.00.9802 188.8.131.52 C:\Windows\system32\
MSVCR80.dll 8.00.50727.4053 8.0.50727.4053 C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_d08d7da0442a985d\
msvcrt.dll 7.0.6002.18005 7.0.6002.18005 C:\Windows\syswow64\
Pblib32.dll 184.108.40.206 220.127.116.11 C:\Program Files (x86)\PIPC\Procbook\
pisdk.dll 18.104.22.168 22.214.171.1243 C:\Program Files (x86)\PIPC\PISDK\
PISDKCommon.dll 126.96.36.199 188.8.131.521 C:\Program Files (x86)\PIPC\PISDK\
PISDKDlg.dll 1.06.0365 184.108.40.2065 C:\Program Files (x86)\PIPC\PISDK\
PITimeServer.dll 220.127.116.11 18.104.22.1681 C:\Program Files (x86)\PIPC\Library\
Plot.dll 22.214.171.124 126.96.36.199 C:\Program Files (x86)\PIPC\Procbook\
Prims32.dll 188.8.131.52 184.108.40.206 C:\Program Files (x86)\PIPC\Procbook\
Procbook.exe 220.127.116.11 18.104.22.168 C:\Program Files (x86)\PIPC\Procbook\
SQC.DLL 22.214.171.124 126.96.36.199 C:\Program Files (x86)\PIPC\Procbook\
svg_addin.dll 3.02 188.8.131.52 C:\Program Files (x86)\PIPC\PROCBOOK\SVG_addin\
Toolbox.dll 184.108.40.206 220.127.116.11 C:\Program Files (x86)\PIPC\Procbook\
Trend32.dll 18.104.22.168 22.214.171.124 C:\Program Files (x86)\PIPC\Procbook\
VBE6.DLL 6.05.1032 126.96.36.199 C:\PROGRA~2\COMMON~1\MICROS~1\VBA\VBA6\
xyplot.dll 188.8.131.52 184.108.40.206 C:\Program Files (x86)\PIPC\Procbook\
Copyright © 1993 - 2009 OSIsoft, Inc.
Progra~2 is also the (x86) folder.
The code behind the PDI is this:
Public Sub WriteNumericValue(tag As String, val As Double, timeStamp As Variant, Optional checkType As Boolean = True)
On Error GoTo WriteValue_Error
'bepaal de default server
Dim pisvr As PISDK.Server
Set pisvr = PISDK.Servers.DefaultServer
'zet het tijdstempel in een algemeen formaat
Dim ptf As PITimeFormat
Set ptf = New PITimeFormat
Select Case VarType(timeStamp)
ptf.LocalDate = timeStamp
ptf.InputString = timeStamp
MsgBox "Onbekend type voor timestamp: " + TypeName(timeStamp)
'type checking staat standaard aan, maar kan met de checkType parameter worden uitgezet om wat snelheidswinst te halen
If checkType Then
Dim pointType As Integer
pointType = pisvr.PIPoints(tag).pointType
'PI pointtype mag alleen een float32, float64 if int32 zijn
If pointType <> PISDK.pttypFloat32 And pointType <> PISDK.pttypFloat64 And pointType <> PISDK.pttypInt32 Then
MsgBox ("Verkeerd datatype voor tag '" + tag + "'")
'schrijf de waarde naar de tag
pisvr.PIPoints(tag).Data.UpdateValue val, ptf ' error here
On Error GoTo 0
MsgBox "Fout tijdens het schijven van tag '" + tag + "'"