Click or drag to resize

Instrument connection monitor

In this section, the instrument connection status monitoring is dicussed

monitoring instrument connection status

Before controling the instrument, the instrument should be online, so we have to monitor the status of connection. By listening to event of STARDiscover, you will be informed when connection status change

C#
STARDiscover discover = new STARDiscover();
discover.OnConnect += Discover_OnConnect;
discover.OnDisconnect += Discover_OnDisconnect;
discover.OnReceive += Discover_OnReceive;
discover.Start();

Before control the STARDiscover must be release to stop connection to instrument

C#
discover.Stop();
discover.OnConnect -= Discover_OnConnect;
discover.OnDisconnect -= Discover_OnDisconnect;
discover.OnReceive -= Discover_OnReceive;
discover.Dispose();
discover = null;