3 _ivscriptengineevents::onnotifyclient, Parameters, Return values – Teledyne LeCroy Automation API for Teledyne LeCroy PETracer_PETrainer User Manual
Page 138: Remarks, Example, If isarray(eventbody) then, For each item in eventbody, Lineindex = lineindex + 1, Ivscriptengineevents::onnotifyclient

Teledyne LeCroy
Automation API for PETracer/PETrainer
133
10.1.3 _IVScriptEngineEvents::OnNotifyClient
 
HRESULT OnNotifyClient( 
[in] int eventId, 
[in] VARIANT eventBody, 
[in] int TAG ) 
 
Fired when running a verification script, calls the NotifyClient() function.
Parameters 
 
eventId
Event Id
eventBody
Body of event packed in a VARIANT object
TAG
VSE object's tag
Return values
Remarks 
 
The information packed in the event body is opaque for VSE – it only packs the information given to
NotifyClient() function inside of verification script into a VARIANT object and sends it to client applications. See 
the PETracer Verification Script Engine Manual for details about the NotifyClient() script function. 
Example
 
PETracer Verification script: 
ProcessEvent() 
{ 
 . . . 
 NotifyClient( 2, [in.Index, in.Level, GetChannelName(), GetEventName(), TimeToText( in.Time 
)] ); 
 . . . 
} 
 
VBA (MS Excel): 
Public WithEvents VSEEvents As VScriptEngine 
. . . 
Private Sub VSEEvents_OnNotifyClient( ByVal eventId As Long, 
ByVal eventBody As Variant,
ByVal Tag As Long )
 Dim Col As Integer 
 Dim Item As Variant 
 ThisWorkbook.Sheets("Sheet1").Cells(LineIndex, 1) = eventId 
 
 If IsArray(eventBody) Then 
 Col = 3 
 
 For Each Item In eventBody 
 ThisWorkbook.Sheets("Sheet1").Cells(LineIndex, Col) = Item 
 Col = Col + 1 
 Next 
 Else 
 ThisWorkbook.Sheets("Sheet1").Cells(LineIndex, 2) = eventBody 
 End If 
 
 LineIndex = LineIndex + 1 
End Sub 
