chrismassie

Error using Processbook VBA to execute pisn_putsnapshotx

Discussion created by chrismassie on Feb 19, 2020

I have a processbook file with some VBA code to write a value back to the PI server. This code has worked in the past, but now pisn_putsnapshotx is giving me an error 2. I can't seem to find an explanation for the error code.

 

This is the VBA code:

 

If UserForm5.TextBox1.Value <> "" Then err1 = pisn_putsnapshotx(3041, WasherPH, ival, ByVal 0&, bsize, istat, qflag, PITime)

 

Getting the value from textbox1 on userform5. WasherPH is the variable and the value is valid when shown in a msgbox just prior to this line. ival = 0, bsize = 0, istat = 0, qflag = 0. PITime is also a valid PITimestamp variable and each of the values in the array are good.

 

The connection shows that it is connected with a PI trust that I have defined on the server for write access.

 

Looking in the online help for pisn_putsnapshotx, it shows: 

Returns

>0

System error

Success

 

But nothing else about what the System error is.

 

Any assistance would be appreciated.

Outcomes