OnRead Event in Serial Port Sniffer AX Control

The OnRead event occurs when other application reads data from the sniffed port.(See OnReadData event)  

 VARIANT* Data// Pointer to the VARIANT (VT_ARRAY | VT_UI1)

  Data     [in, out] Pointer to the VARIANT type variable that contains data read from the port as VT_ARRAY | VT_UI1.


This event is really convenient to use under VB6, C#, VB.Net. See example.

Example (VB 6.0):

Private Sub SerialPortSniffer1_OnRead( Data As Variant)

 ReDim Data (2) ‘ set new size for the data  
 Data (0) = 3  
 Data (1) = 5  

End Sub


See also

OnWrite event, OnReadData event, OnWriteData event