Click or drag to resize

STARDiscover Class

STAR discover tools
Inheritance Hierarchy
SystemObject
  Huarui.STARLineSTARDiscover

Namespace:  Huarui.STARLine
Assembly:  SharpHamilton (in SharpHamilton.dll) Version: 0.1.0.0 (0.1.0.0)
Syntax
public class STARDiscover : IDisposable

The STARDiscover type exposes the following members.

Constructors
  NameDescription
Public methodSTARDiscover
Construction
Top
Properties
  NameDescription
Public propertyIsConnect
Instrument Connect status
Top
Methods
  NameDescription
Public methodDispose
Dispose the instance
Public methodSend
Send command to STAR
Public methodStart
Start Discover
Public methodStop
Stop discover
Top
Events
  NameDescription
Public eventOnConnect
device connected event
Public eventOnDisconnect
device disconnected event
Public eventOnReceive
reply from device received event
Top
Examples
it can be used to monitor the connection status of instrument, following example show you how to do it.
C#
//creating an instance and attach instrument connection event.
STARDiscover discover = new STARDiscover();
discover.OnConnect += Discover_OnConnect;
discover.OnDisconnect += Discover_OnDisconnect;
discover.OnReceive += Discover_OnReceive;
discover.Start();
When you want to control the instrument, you must stop monitor and release the connection
C#
//stop monitoring when instrument connected and you want to control the instrument
discover.Stop();
discover.OnConnect -= Discover_OnConnect;
discover.OnDisconnect -= Discover_OnDisconnect;
discover.OnReceive -= Discover_OnReceive;
discover.Dispose();
discover = null;
See Also