EasyManua.ls Logo

Newport ORIEL Instruments Cornerstone 260 - Page 65

Newport ORIEL Instruments Cornerstone 260
76 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MCS260
CORNERSTONE 260 MONOCHROMATORS
64
USBEventArgs usbEvent = e as USBEventArgs;
cs.disconnect();
}
void usbDevices_DeviceAttached(object sender, EventArgs e)
{
USBEventArgs usbEvent = e as USBEventArgs;
cs.connect();
connect();
}
void connect()
{
cornerstone = cs.device;
usbDevices = cs.usbDevices;
deviceCount = usbDevices.Count;
}
void toggleButtons(Boolean toggle)
{
btnResponse.Enabled = toggle;
btnSend.Enabled = toggle;
btnQuery.Enabled = toggle;
}
C# (Form file) code:
namespace CornerstoneApp
{
public partial class MainForm : Form
{
public Int32 nActiveUnit = 1; // Used only for multiple devices (default) below
private void btnSend_Click(object sender, EventArgs e)
{
cs.sendCommand(txtComand.Text);
txtInfo.Text = cs.getLastMessage();
}
private void btnResponse_Click(object sender, EventArgs e)
{
txtInfo.Text = cs.getResponse();
}
//====================== Second Controls for second device if needed
// NOT needed for only one device.
private void btnSend2_Click(object sender, EventArgs e)
{
cs.setActiveDevice(cs.usbDevices.Count);
cs.sendCommand(txtComand2.Text);

Table of Contents

Related product manuals