Hi,
I'm having problems when I try to set a datareference to an AFAttribute object; I don't know if somebody could help me.
This is the code where I have the problems:
...
afattrib = miElemento.Attributes(nombreAtributo)
'Busco el elemento PIPoint en el PISystem
myPIServer = PIServer.FindPIServer(myPISystem, sNombreServidorPI)
myPIPoint = PIPoint.FindPIPoint(myPIServer, tag)
'Creo los atributos que voy a asociar al tag recien creado con el tipo de PIPoint obtenido
afvalue = New AFValue()
afvalue.Value = myPIPoint.InterpolatedValue(Time.AFTime.Now).Value
afvalue.PIPoint = myPIPoint
afattrib.IsConfigurationItem = False
afattrib.DataReferencePlugIn = myPISystem.DataReferencePlugIns("PI Point")
configString = "\\" + sNombreServidorPI + "\" + tag + ";ReadOnly=False"
If (afattrib.DataReference.ToString() <> configString) Then
afattrib.DataReference.ConfigString = configString
bDatoModificado = True
End If
afattrib.DataReference.SetValue(Nothing, afvalue)
miElemento.CheckIn()
...
The error I can see is: "[-11414] Buffered point does not accept new events", and the method where I get the error: "afattrib.DataReference.SetValue(Nothing, afvalue)".
It's a strange error because I only get it with a few tags, the most of the tags execute that instruction correctly.
I don't see anything particular in the tags that produce the error. In fact, I can create it manually from PI System Explorer; it's in visual basic code where I get the error.
Does anybody knows which one could be the reason for that error?
Thank you very much.
Hi Loretto,
The -11414 error is occurring because the point you are trying to edit the value for is locked and owned by an instance of PI Buffer Subsystem. This lock is necessary to ensure the proper operation of compression. If you are able to edit the values in PSE, then the PSE client is probably buffered. Basically there are two options: 1) reset the point ownership so that it is not owned by PI Buffer Subsystem (keep in mind if a buffered source writes to the point, it will be locked again), or 2) configure PI Buffer Subsystem on the machine running your VB code (needs to be PI Buffer Subsystem 4.3 to buffer AF SDK calls) so that it can transfer ownership to itself.
To check which PI Buffer Subsystem has ownership of the point, run the command following command on the PI Data Archive server:
%piserver%adm>piartool -sd \<pt id>
The output of this should show you the snapshot record for the pt id specified. Choose the pt id for the point that you are encountering the error. In the compressed event section, there should be one value listed at the end of the "value" field. This value is actually the registration ID of the Buffer Subsystem that owns the point.
Once you have this ID, run the next command:
%piserver%adm>piartool -bfs
This will output all of the registered PI Buffer Subsystems. Find the one that matches the ID from the snapshot dump and that will show you on which machine it is on. If you want to reset the ownership, use the command:
%piserver%adm>piartool -bfs <id> -reset
Once the buffer subsystem is reset, you should be able to write to the point again.
For more information, please see KB00093.