![]() | Instrument connection monitor |
In this section, the instrument connection status monitoring is dicussed
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
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
discover.Stop();
discover.OnConnect -= Discover_OnConnect;
discover.OnDisconnect -= Discover_OnDisconnect;
discover.OnReceive -= Discover_OnReceive;
discover.Dispose();
discover = null;