This VBA code:
Call Application.LogMessage(severity, "QuickWin", msg)
appears to crash processbook! Any ideas why?
Is your message longer than 255 characters?
In any event, I looked at the 3.1/3.2 code and it appears that Application.LogMessage doesn't actually log a message anywhere. It looks like it's broken.
Yes, it is longer that 255 characters. It is errors from a .NET addin such as the following:
2 - OSIsoft.AF.Asset.DataReference.TagException: Cannot retrieve PI Point 'L_90298_LV.S' for attribute 'New Root Element\LPN Hub 1 London SW\FOREST HILL\SubStations\OVERHILL RD S/O 105 BREDING NO2\Transformers\T1|KPIs|Tot KVA'.
at OSIsoft.AF.Asset.DataReference.PIBaseDR.GetValue(Object context, Object timeContextArg, AFAttributeList inputAttributes, AFValues inputValues)
at OSIsoft.AF.Asset.AFAttribute.GetValueFromDataReference(AFCase caseContext, Object timeContext, AFAttributeList inputAttributes, AFValues inputValues, UOM desiredUOM) in c:\Dev\AF\AF 2.3\Sources\SDK\Asset\AFAttribute.Value.cs:line 1673
I would use the PISDK MessageLog.PutString method instead.
There is also the MessageLog2.SendLogMessage method which can take a severity code (MsgSeverityConstants) as long as PI message subsystem 3.4.380 or greater is installed.
(PI Server, or PISDK 1.4.0 - coming soon).
Hmm, so far I have not needed to resort to using the SDK directly. It's lower down my list of priorities today so I may not bother but I now have the answer for when I do get around to it.
Retrieving data ...