//Author: LabJack
//July 18, 2007
//This example program calls ControlConfig function, and reads the various
//parameters associated with the Control processor.

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using LabJack;

namespace ControlConfigUSB
{
	public class ControlConfigUSBForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label errorLabel;
		private System.Windows.Forms.TextBox errorBox;
		private System.Windows.Forms.TabControl tabControl1;
		private System.Windows.Forms.TabPage ControlConfig0Tab;
		private System.Windows.Forms.TabPage ControlConfig1Tab;
		private System.Windows.Forms.TabPage ControlConfig2Tab;
		private System.Windows.Forms.TabPage ControlConfig3Tab;
		private System.Windows.Forms.TextBox controlBLVerBox;
		private System.Windows.Forms.TextBox controlFWVerBox;
		private System.Windows.Forms.TextBox resetSourceBox;
		private System.Windows.Forms.TextBox powerLevelBox;
		private System.Windows.Forms.Label controlBLVerText;
		private System.Windows.Forms.Label controlFWVerText;
		private System.Windows.Forms.Label resetSourceText;
		private System.Windows.Forms.Label powerLevelText;
		private System.Windows.Forms.Button ControlConfigButton;
		private System.Windows.Forms.Label fio4;
		private System.Windows.Forms.Label fio7;
		private System.Windows.Forms.Label fio6;
		private System.Windows.Forms.Label fio5;
		private System.Windows.Forms.Label fio3;
		private System.Windows.Forms.Label fio2;
		private System.Windows.Forms.Label fio1;
		private System.Windows.Forms.Label fio0;
		private System.Windows.Forms.TextBox fioD7;
		private System.Windows.Forms.TextBox fioS7;
		private System.Windows.Forms.TextBox fioD6;
		private System.Windows.Forms.TextBox fioS6;
		private System.Windows.Forms.Label fioDir2Text;
		private System.Windows.Forms.Label fioState2Text;
		private System.Windows.Forms.Label fio2Text;
		private System.Windows.Forms.TextBox fioD5;
		private System.Windows.Forms.TextBox fioD4;
		private System.Windows.Forms.TextBox fioD3;
		private System.Windows.Forms.TextBox fioS5;
		private System.Windows.Forms.TextBox fioS4;
		private System.Windows.Forms.TextBox fioS3;
		private System.Windows.Forms.TextBox fioD2;
		private System.Windows.Forms.TextBox fioD1;
		private System.Windows.Forms.TextBox fioD0;
		private System.Windows.Forms.TextBox fioS2;
		private System.Windows.Forms.TextBox fioS1;
		private System.Windows.Forms.TextBox fioS0;
		private System.Windows.Forms.Label fioDirText;
		private System.Windows.Forms.Label fioStateText;
		private System.Windows.Forms.Label fioText;
		private System.Windows.Forms.Label eio4;
		private System.Windows.Forms.Label eio7;
		private System.Windows.Forms.Label eio6;
		private System.Windows.Forms.Label eio5;
		private System.Windows.Forms.Label eio3;
		private System.Windows.Forms.Label eio2;
		private System.Windows.Forms.Label eio1;
		private System.Windows.Forms.Label eio0;
		private System.Windows.Forms.TextBox eioD7;
		private System.Windows.Forms.TextBox eioS7;
		private System.Windows.Forms.TextBox eioD6;
		private System.Windows.Forms.TextBox eioS6;
		private System.Windows.Forms.Label EIODir2Text;
		private System.Windows.Forms.Label EIOState2Text;
		private System.Windows.Forms.Label eio2Text;
		private System.Windows.Forms.TextBox eioD5;
		private System.Windows.Forms.TextBox eioD4;
		private System.Windows.Forms.TextBox eioD3;
		private System.Windows.Forms.TextBox eioS5;
		private System.Windows.Forms.TextBox eioS4;
		private System.Windows.Forms.TextBox eioS3;
		private System.Windows.Forms.TextBox eioD2;
		private System.Windows.Forms.TextBox eioD1;
		private System.Windows.Forms.TextBox eioD0;
		private System.Windows.Forms.TextBox eioS2;
		private System.Windows.Forms.TextBox eioS1;
		private System.Windows.Forms.TextBox eioS0;
		private System.Windows.Forms.Label EIODirText;
		private System.Windows.Forms.Label EIOStateText;
		private System.Windows.Forms.Label eioText;
		private System.Windows.Forms.Label mio2;
		private System.Windows.Forms.Label mio1;
		private System.Windows.Forms.Label mio0;
		private System.Windows.Forms.Label cio3;
		private System.Windows.Forms.Label cio2;
		private System.Windows.Forms.Label cio1;
		private System.Windows.Forms.Label cio0;
		private System.Windows.Forms.TextBox mioD2;
		private System.Windows.Forms.TextBox mioD1;
		private System.Windows.Forms.Label mioDirText;
		private System.Windows.Forms.Label mioStateText;
		private System.Windows.Forms.Label mioText;
		private System.Windows.Forms.TextBox mioD0;
		private System.Windows.Forms.TextBox cioD3;
		private System.Windows.Forms.TextBox cioS3;
		private System.Windows.Forms.TextBox cioD2;
		private System.Windows.Forms.TextBox cioD1;
		private System.Windows.Forms.TextBox cioD0;
		private System.Windows.Forms.TextBox cioS2;
		private System.Windows.Forms.TextBox cioS1;
		private System.Windows.Forms.TextBox cioS0;
		private System.Windows.Forms.Label cioDirText;
		private System.Windows.Forms.Label cioStateText;
		private System.Windows.Forms.Label cioText;
		private System.Windows.Forms.TextBox mioS2;
		private System.Windows.Forms.TextBox mioS1;
		private System.Windows.Forms.TextBox mioS0;
		private System.Windows.Forms.TabPage ControlConfig4Tab;
		private System.Windows.Forms.TextBox dacV1;
		private System.Windows.Forms.TextBox dacV0;
		private System.Windows.Forms.Label voltageText;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox dacE1;
		private System.Windows.Forms.TextBox dacE0;
		private System.Windows.Forms.Label enabledText;
		private System.Windows.Forms.Label dacText;
		private System.Windows.Forms.MainMenu mainMenu1;
		private System.Windows.Forms.Label idLabel;
		private System.Windows.Forms.NumericUpDown idBox;
		private UE9 ue9Dev;

		public ControlConfigUSBForm()
		{
			InitializeComponent();
		}
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			base.Dispose( disposing );
		}
		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.idLabel = new System.Windows.Forms.Label();
			this.errorLabel = new System.Windows.Forms.Label();
			this.errorBox = new System.Windows.Forms.TextBox();
			this.tabControl1 = new System.Windows.Forms.TabControl();
			this.ControlConfig0Tab = new System.Windows.Forms.TabPage();
			this.controlBLVerBox = new System.Windows.Forms.TextBox();
			this.controlFWVerBox = new System.Windows.Forms.TextBox();
			this.resetSourceBox = new System.Windows.Forms.TextBox();
			this.powerLevelBox = new System.Windows.Forms.TextBox();
			this.controlBLVerText = new System.Windows.Forms.Label();
			this.controlFWVerText = new System.Windows.Forms.Label();
			this.resetSourceText = new System.Windows.Forms.Label();
			this.powerLevelText = new System.Windows.Forms.Label();
			this.ControlConfigButton = new System.Windows.Forms.Button();
			this.ControlConfig1Tab = new System.Windows.Forms.TabPage();
			this.fio4 = new System.Windows.Forms.Label();
			this.fio7 = new System.Windows.Forms.Label();
			this.fio6 = new System.Windows.Forms.Label();
			this.fio5 = new System.Windows.Forms.Label();
			this.fio3 = new System.Windows.Forms.Label();
			this.fio2 = new System.Windows.Forms.Label();
			this.fio1 = new System.Windows.Forms.Label();
			this.fio0 = new System.Windows.Forms.Label();
			this.fioD7 = new System.Windows.Forms.TextBox();
			this.fioS7 = new System.Windows.Forms.TextBox();
			this.fioD6 = new System.Windows.Forms.TextBox();
			this.fioS6 = new System.Windows.Forms.TextBox();
			this.fioDir2Text = new System.Windows.Forms.Label();
			this.fioState2Text = new System.Windows.Forms.Label();
			this.fio2Text = new System.Windows.Forms.Label();
			this.fioD5 = new System.Windows.Forms.TextBox();
			this.fioD4 = new System.Windows.Forms.TextBox();
			this.fioD3 = new System.Windows.Forms.TextBox();
			this.fioS5 = new System.Windows.Forms.TextBox();
			this.fioS4 = new System.Windows.Forms.TextBox();
			this.fioS3 = new System.Windows.Forms.TextBox();
			this.fioD2 = new System.Windows.Forms.TextBox();
			this.fioD1 = new System.Windows.Forms.TextBox();
			this.fioD0 = new System.Windows.Forms.TextBox();
			this.fioS2 = new System.Windows.Forms.TextBox();
			this.fioS1 = new System.Windows.Forms.TextBox();
			this.fioS0 = new System.Windows.Forms.TextBox();
			this.fioDirText = new System.Windows.Forms.Label();
			this.fioStateText = new System.Windows.Forms.Label();
			this.fioText = new System.Windows.Forms.Label();
			this.ControlConfig2Tab = new System.Windows.Forms.TabPage();
			this.eio4 = new System.Windows.Forms.Label();
			this.eio7 = new System.Windows.Forms.Label();
			this.eio6 = new System.Windows.Forms.Label();
			this.eio5 = new System.Windows.Forms.Label();
			this.eio3 = new System.Windows.Forms.Label();
			this.eio2 = new System.Windows.Forms.Label();
			this.eio1 = new System.Windows.Forms.Label();
			this.eio0 = new System.Windows.Forms.Label();
			this.eioD7 = new System.Windows.Forms.TextBox();
			this.eioS7 = new System.Windows.Forms.TextBox();
			this.eioD6 = new System.Windows.Forms.TextBox();
			this.eioS6 = new System.Windows.Forms.TextBox();
			this.EIODir2Text = new System.Windows.Forms.Label();
			this.EIOState2Text = new System.Windows.Forms.Label();
			this.eio2Text = new System.Windows.Forms.Label();
			this.eioD5 = new System.Windows.Forms.TextBox();
			this.eioD4 = new System.Windows.Forms.TextBox();
			this.eioD3 = new System.Windows.Forms.TextBox();
			this.eioS5 = new System.Windows.Forms.TextBox();
			this.eioS4 = new System.Windows.Forms.TextBox();
			this.eioS3 = new System.Windows.Forms.TextBox();
			this.eioD2 = new System.Windows.Forms.TextBox();
			this.eioD1 = new System.Windows.Forms.TextBox();
			this.eioD0 = new System.Windows.Forms.TextBox();
			this.eioS2 = new System.Windows.Forms.TextBox();
			this.eioS1 = new System.Windows.Forms.TextBox();
			this.eioS0 = new System.Windows.Forms.TextBox();
			this.EIODirText = new System.Windows.Forms.Label();
			this.EIOStateText = new System.Windows.Forms.Label();
			this.eioText = new System.Windows.Forms.Label();
			this.ControlConfig3Tab = new System.Windows.Forms.TabPage();
			this.mioS2 = new System.Windows.Forms.TextBox();
			this.mioS1 = new System.Windows.Forms.TextBox();
			this.mioS0 = new System.Windows.Forms.TextBox();
			this.mio2 = new System.Windows.Forms.Label();
			this.mio1 = new System.Windows.Forms.Label();
			this.mio0 = new System.Windows.Forms.Label();
			this.cio3 = new System.Windows.Forms.Label();
			this.cio2 = new System.Windows.Forms.Label();
			this.cio1 = new System.Windows.Forms.Label();
			this.cio0 = new System.Windows.Forms.Label();
			this.mioD2 = new System.Windows.Forms.TextBox();
			this.mioD1 = new System.Windows.Forms.TextBox();
			this.mioDirText = new System.Windows.Forms.Label();
			this.mioStateText = new System.Windows.Forms.Label();
			this.mioText = new System.Windows.Forms.Label();
			this.mioD0 = new System.Windows.Forms.TextBox();
			this.cioD3 = new System.Windows.Forms.TextBox();
			this.cioS3 = new System.Windows.Forms.TextBox();
			this.cioD2 = new System.Windows.Forms.TextBox();
			this.cioD1 = new System.Windows.Forms.TextBox();
			this.cioD0 = new System.Windows.Forms.TextBox();
			this.cioS2 = new System.Windows.Forms.TextBox();
			this.cioS1 = new System.Windows.Forms.TextBox();
			this.cioS0 = new System.Windows.Forms.TextBox();
			this.cioDirText = new System.Windows.Forms.Label();
			this.cioStateText = new System.Windows.Forms.Label();
			this.cioText = new System.Windows.Forms.Label();
			this.ControlConfig4Tab = new System.Windows.Forms.TabPage();
			this.dacV1 = new System.Windows.Forms.TextBox();
			this.dacV0 = new System.Windows.Forms.TextBox();
			this.voltageText = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.dacE1 = new System.Windows.Forms.TextBox();
			this.dacE0 = new System.Windows.Forms.TextBox();
			this.enabledText = new System.Windows.Forms.Label();
			this.dacText = new System.Windows.Forms.Label();
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.idBox = new System.Windows.Forms.NumericUpDown();
			// 
			// idLabel
			// 
			this.idLabel.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.idLabel.Location = new System.Drawing.Point(8, 208);
			this.idLabel.Size = new System.Drawing.Size(104, 16);
			this.idLabel.Text = "UE9 Local ID :";
			// 
			// errorLabel
			// 
			this.errorLabel.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.errorLabel.Location = new System.Drawing.Point(8, 240);
			this.errorLabel.Size = new System.Drawing.Size(40, 20);
			this.errorLabel.Text = "Error:";
			// 
			// errorBox
			// 
			this.errorBox.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
			this.errorBox.Location = new System.Drawing.Point(56, 240);
			this.errorBox.ReadOnly = true;
			this.errorBox.Size = new System.Drawing.Size(176, 21);
			this.errorBox.Text = "";
			// 
			// tabControl1
			// 
			this.tabControl1.Controls.Add(this.ControlConfig0Tab);
			this.tabControl1.Controls.Add(this.ControlConfig1Tab);
			this.tabControl1.Controls.Add(this.ControlConfig2Tab);
			this.tabControl1.Controls.Add(this.ControlConfig3Tab);
			this.tabControl1.Controls.Add(this.ControlConfig4Tab);
			this.tabControl1.SelectedIndex = 0;
			this.tabControl1.Size = new System.Drawing.Size(240, 192);
			// 
			// ControlConfig0Tab
			// 
			this.ControlConfig0Tab.Controls.Add(this.controlBLVerBox);
			this.ControlConfig0Tab.Controls.Add(this.controlFWVerBox);
			this.ControlConfig0Tab.Controls.Add(this.resetSourceBox);
			this.ControlConfig0Tab.Controls.Add(this.powerLevelBox);
			this.ControlConfig0Tab.Controls.Add(this.controlBLVerText);
			this.ControlConfig0Tab.Controls.Add(this.controlFWVerText);
			this.ControlConfig0Tab.Controls.Add(this.resetSourceText);
			this.ControlConfig0Tab.Controls.Add(this.powerLevelText);
			this.ControlConfig0Tab.Controls.Add(this.ControlConfigButton);
			this.ControlConfig0Tab.Location = new System.Drawing.Point(4, 4);
			this.ControlConfig0Tab.Size = new System.Drawing.Size(232, 166);
			this.ControlConfig0Tab.Text = "ControlConfig";
			// 
			// controlBLVerBox
			// 
			this.controlBLVerBox.Location = new System.Drawing.Point(80, 104);
			this.controlBLVerBox.ReadOnly = true;
			this.controlBLVerBox.Size = new System.Drawing.Size(56, 22);
			this.controlBLVerBox.Text = "";
			// 
			// controlFWVerBox
			// 
			this.controlFWVerBox.Location = new System.Drawing.Point(80, 72);
			this.controlFWVerBox.ReadOnly = true;
			this.controlFWVerBox.Size = new System.Drawing.Size(56, 22);
			this.controlFWVerBox.Text = "";
			// 
			// resetSourceBox
			// 
			this.resetSourceBox.Location = new System.Drawing.Point(80, 40);
			this.resetSourceBox.ReadOnly = true;
			this.resetSourceBox.Text = "";
			// 
			// powerLevelBox
			// 
			this.powerLevelBox.Location = new System.Drawing.Point(80, 8);
			this.powerLevelBox.ReadOnly = true;
			this.powerLevelBox.Text = "";
			// 
			// controlBLVerText
			// 
			this.controlBLVerText.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.controlBLVerText.Location = new System.Drawing.Point(8, 104);
			this.controlBLVerText.Size = new System.Drawing.Size(56, 32);
			this.controlBLVerText.Text = "Control BL Ver:";
			// 
			// controlFWVerText
			// 
			this.controlFWVerText.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.controlFWVerText.Location = new System.Drawing.Point(8, 72);
			this.controlFWVerText.Size = new System.Drawing.Size(56, 32);
			this.controlFWVerText.Text = "Control FW Ver:";
			// 
			// resetSourceText
			// 
			this.resetSourceText.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.resetSourceText.Location = new System.Drawing.Point(8, 40);
			this.resetSourceText.Size = new System.Drawing.Size(72, 16);
			this.resetSourceText.Text = "Reset Src:";
			// 
			// powerLevelText
			// 
			this.powerLevelText.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.powerLevelText.Location = new System.Drawing.Point(8, 8);
			this.powerLevelText.Size = new System.Drawing.Size(64, 16);
			this.powerLevelText.Text = "Pwr Lvl:";
			// 
			// ControlConfigButton
			// 
			this.ControlConfigButton.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.ControlConfigButton.Location = new System.Drawing.Point(80, 136);
			this.ControlConfigButton.Size = new System.Drawing.Size(72, 24);
			this.ControlConfigButton.Text = "Run";
			this.ControlConfigButton.Click += new System.EventHandler(this.ControlConfigButton_Click);
			// 
			// ControlConfig1Tab
			// 
			this.ControlConfig1Tab.Controls.Add(this.fio4);
			this.ControlConfig1Tab.Controls.Add(this.fio7);
			this.ControlConfig1Tab.Controls.Add(this.fio6);
			this.ControlConfig1Tab.Controls.Add(this.fio5);
			this.ControlConfig1Tab.Controls.Add(this.fio3);
			this.ControlConfig1Tab.Controls.Add(this.fio2);
			this.ControlConfig1Tab.Controls.Add(this.fio1);
			this.ControlConfig1Tab.Controls.Add(this.fio0);
			this.ControlConfig1Tab.Controls.Add(this.fioD7);
			this.ControlConfig1Tab.Controls.Add(this.fioS7);
			this.ControlConfig1Tab.Controls.Add(this.fioD6);
			this.ControlConfig1Tab.Controls.Add(this.fioS6);
			this.ControlConfig1Tab.Controls.Add(this.fioDir2Text);
			this.ControlConfig1Tab.Controls.Add(this.fioState2Text);
			this.ControlConfig1Tab.Controls.Add(this.fio2Text);
			this.ControlConfig1Tab.Controls.Add(this.fioD5);
			this.ControlConfig1Tab.Controls.Add(this.fioD4);
			this.ControlConfig1Tab.Controls.Add(this.fioD3);
			this.ControlConfig1Tab.Controls.Add(this.fioS5);
			this.ControlConfig1Tab.Controls.Add(this.fioS4);
			this.ControlConfig1Tab.Controls.Add(this.fioS3);
			this.ControlConfig1Tab.Controls.Add(this.fioD2);
			this.ControlConfig1Tab.Controls.Add(this.fioD1);
			this.ControlConfig1Tab.Controls.Add(this.fioD0);
			this.ControlConfig1Tab.Controls.Add(this.fioS2);
			this.ControlConfig1Tab.Controls.Add(this.fioS1);
			this.ControlConfig1Tab.Controls.Add(this.fioS0);
			this.ControlConfig1Tab.Controls.Add(this.fioDirText);
			this.ControlConfig1Tab.Controls.Add(this.fioStateText);
			this.ControlConfig1Tab.Controls.Add(this.fioText);
			this.ControlConfig1Tab.Location = new System.Drawing.Point(4, 4);
			this.ControlConfig1Tab.Size = new System.Drawing.Size(232, 166);
			this.ControlConfig1Tab.Text = "FIO";
			// 
			// fio4
			// 
			this.fio4.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio4.Location = new System.Drawing.Point(16, 133);
			this.fio4.Size = new System.Drawing.Size(16, 16);
			this.fio4.Text = "4";
			// 
			// fio7
			// 
			this.fio7.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio7.Location = new System.Drawing.Point(128, 85);
			this.fio7.Size = new System.Drawing.Size(16, 16);
			this.fio7.Text = "7";
			// 
			// fio6
			// 
			this.fio6.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio6.Location = new System.Drawing.Point(128, 61);
			this.fio6.Size = new System.Drawing.Size(16, 16);
			this.fio6.Text = "6";
			// 
			// fio5
			// 
			this.fio5.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio5.Location = new System.Drawing.Point(128, 37);
			this.fio5.Size = new System.Drawing.Size(16, 16);
			this.fio5.Text = "5";
			// 
			// fio3
			// 
			this.fio3.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio3.Location = new System.Drawing.Point(16, 109);
			this.fio3.Size = new System.Drawing.Size(16, 16);
			this.fio3.Text = "3";
			// 
			// fio2
			// 
			this.fio2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio2.Location = new System.Drawing.Point(16, 85);
			this.fio2.Size = new System.Drawing.Size(16, 16);
			this.fio2.Text = "2";
			// 
			// fio1
			// 
			this.fio1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio1.Location = new System.Drawing.Point(16, 61);
			this.fio1.Size = new System.Drawing.Size(16, 16);
			this.fio1.Text = "1";
			// 
			// fio0
			// 
			this.fio0.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.fio0.Location = new System.Drawing.Point(16, 37);
			this.fio0.Size = new System.Drawing.Size(16, 16);
			this.fio0.Text = "0";
			// 
			// fioD7
			// 
			this.fioD7.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD7.Location = new System.Drawing.Point(152, 85);
			this.fioD7.ReadOnly = true;
			this.fioD7.Size = new System.Drawing.Size(32, 21);
			this.fioD7.Text = "";
			// 
			// fioS7
			// 
			this.fioS7.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS7.Location = new System.Drawing.Point(192, 85);
			this.fioS7.ReadOnly = true;
			this.fioS7.Size = new System.Drawing.Size(32, 21);
			this.fioS7.Text = "";
			// 
			// fioD6
			// 
			this.fioD6.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD6.Location = new System.Drawing.Point(152, 61);
			this.fioD6.ReadOnly = true;
			this.fioD6.Size = new System.Drawing.Size(32, 21);
			this.fioD6.Text = "";
			// 
			// fioS6
			// 
			this.fioS6.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS6.Location = new System.Drawing.Point(192, 61);
			this.fioS6.ReadOnly = true;
			this.fioS6.Size = new System.Drawing.Size(32, 21);
			this.fioS6.Text = "";
			// 
			// fioDir2Text
			// 
			this.fioDir2Text.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.fioDir2Text.Location = new System.Drawing.Point(152, 13);
			this.fioDir2Text.Size = new System.Drawing.Size(24, 16);
			this.fioDir2Text.Text = "Dir";
			this.fioDir2Text.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// fioState2Text
			// 
			this.fioState2Text.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.fioState2Text.Location = new System.Drawing.Point(184, 13);
			this.fioState2Text.Size = new System.Drawing.Size(40, 16);
			this.fioState2Text.Text = "State";
			this.fioState2Text.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// fio2Text
			// 
			this.fio2Text.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.fio2Text.Location = new System.Drawing.Point(120, 13);
			this.fio2Text.Size = new System.Drawing.Size(32, 16);
			this.fio2Text.Text = "FIO";
			// 
			// fioD5
			// 
			this.fioD5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD5.Location = new System.Drawing.Point(152, 37);
			this.fioD5.ReadOnly = true;
			this.fioD5.Size = new System.Drawing.Size(32, 21);
			this.fioD5.Text = "";
			// 
			// fioD4
			// 
			this.fioD4.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD4.Location = new System.Drawing.Point(40, 133);
			this.fioD4.ReadOnly = true;
			this.fioD4.Size = new System.Drawing.Size(32, 21);
			this.fioD4.Text = "";
			// 
			// fioD3
			// 
			this.fioD3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD3.Location = new System.Drawing.Point(40, 109);
			this.fioD3.ReadOnly = true;
			this.fioD3.Size = new System.Drawing.Size(32, 21);
			this.fioD3.Text = "";
			// 
			// fioS5
			// 
			this.fioS5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS5.Location = new System.Drawing.Point(192, 37);
			this.fioS5.ReadOnly = true;
			this.fioS5.Size = new System.Drawing.Size(32, 21);
			this.fioS5.Text = "";
			// 
			// fioS4
			// 
			this.fioS4.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS4.Location = new System.Drawing.Point(80, 133);
			this.fioS4.ReadOnly = true;
			this.fioS4.Size = new System.Drawing.Size(32, 21);
			this.fioS4.Text = "";
			// 
			// fioS3
			// 
			this.fioS3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS3.Location = new System.Drawing.Point(80, 109);
			this.fioS3.ReadOnly = true;
			this.fioS3.Size = new System.Drawing.Size(32, 21);
			this.fioS3.Text = "";
			// 
			// fioD2
			// 
			this.fioD2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD2.Location = new System.Drawing.Point(40, 85);
			this.fioD2.ReadOnly = true;
			this.fioD2.Size = new System.Drawing.Size(32, 21);
			this.fioD2.Text = "";
			// 
			// fioD1
			// 
			this.fioD1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD1.Location = new System.Drawing.Point(40, 61);
			this.fioD1.ReadOnly = true;
			this.fioD1.Size = new System.Drawing.Size(32, 21);
			this.fioD1.Text = "";
			// 
			// fioD0
			// 
			this.fioD0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioD0.Location = new System.Drawing.Point(40, 37);
			this.fioD0.ReadOnly = true;
			this.fioD0.Size = new System.Drawing.Size(32, 21);
			this.fioD0.Text = "";
			// 
			// fioS2
			// 
			this.fioS2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS2.Location = new System.Drawing.Point(80, 85);
			this.fioS2.ReadOnly = true;
			this.fioS2.Size = new System.Drawing.Size(32, 21);
			this.fioS2.Text = "";
			// 
			// fioS1
			// 
			this.fioS1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS1.Location = new System.Drawing.Point(80, 61);
			this.fioS1.ReadOnly = true;
			this.fioS1.Size = new System.Drawing.Size(32, 21);
			this.fioS1.Text = "";
			// 
			// fioS0
			// 
			this.fioS0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.fioS0.Location = new System.Drawing.Point(80, 37);
			this.fioS0.ReadOnly = true;
			this.fioS0.Size = new System.Drawing.Size(32, 21);
			this.fioS0.Text = "";
			// 
			// fioDirText
			// 
			this.fioDirText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.fioDirText.Location = new System.Drawing.Point(40, 13);
			this.fioDirText.Size = new System.Drawing.Size(24, 16);
			this.fioDirText.Text = "Dir";
			this.fioDirText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// fioStateText
			// 
			this.fioStateText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.fioStateText.Location = new System.Drawing.Point(72, 13);
			this.fioStateText.Size = new System.Drawing.Size(40, 16);
			this.fioStateText.Text = "State";
			this.fioStateText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// fioText
			// 
			this.fioText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.fioText.Location = new System.Drawing.Point(8, 13);
			this.fioText.Size = new System.Drawing.Size(32, 16);
			this.fioText.Text = "FIO";
			// 
			// ControlConfig2Tab
			// 
			this.ControlConfig2Tab.Controls.Add(this.eio4);
			this.ControlConfig2Tab.Controls.Add(this.eio7);
			this.ControlConfig2Tab.Controls.Add(this.eio6);
			this.ControlConfig2Tab.Controls.Add(this.eio5);
			this.ControlConfig2Tab.Controls.Add(this.eio3);
			this.ControlConfig2Tab.Controls.Add(this.eio2);
			this.ControlConfig2Tab.Controls.Add(this.eio1);
			this.ControlConfig2Tab.Controls.Add(this.eio0);
			this.ControlConfig2Tab.Controls.Add(this.eioD7);
			this.ControlConfig2Tab.Controls.Add(this.eioS7);
			this.ControlConfig2Tab.Controls.Add(this.eioD6);
			this.ControlConfig2Tab.Controls.Add(this.eioS6);
			this.ControlConfig2Tab.Controls.Add(this.EIODir2Text);
			this.ControlConfig2Tab.Controls.Add(this.EIOState2Text);
			this.ControlConfig2Tab.Controls.Add(this.eio2Text);
			this.ControlConfig2Tab.Controls.Add(this.eioD5);
			this.ControlConfig2Tab.Controls.Add(this.eioD4);
			this.ControlConfig2Tab.Controls.Add(this.eioD3);
			this.ControlConfig2Tab.Controls.Add(this.eioS5);
			this.ControlConfig2Tab.Controls.Add(this.eioS4);
			this.ControlConfig2Tab.Controls.Add(this.eioS3);
			this.ControlConfig2Tab.Controls.Add(this.eioD2);
			this.ControlConfig2Tab.Controls.Add(this.eioD1);
			this.ControlConfig2Tab.Controls.Add(this.eioD0);
			this.ControlConfig2Tab.Controls.Add(this.eioS2);
			this.ControlConfig2Tab.Controls.Add(this.eioS1);
			this.ControlConfig2Tab.Controls.Add(this.eioS0);
			this.ControlConfig2Tab.Controls.Add(this.EIODirText);
			this.ControlConfig2Tab.Controls.Add(this.EIOStateText);
			this.ControlConfig2Tab.Controls.Add(this.eioText);
			this.ControlConfig2Tab.Location = new System.Drawing.Point(4, 4);
			this.ControlConfig2Tab.Size = new System.Drawing.Size(232, 166);
			this.ControlConfig2Tab.Text = "EIO";
			// 
			// eio4
			// 
			this.eio4.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio4.Location = new System.Drawing.Point(16, 133);
			this.eio4.Size = new System.Drawing.Size(16, 16);
			this.eio4.Text = "4";
			// 
			// eio7
			// 
			this.eio7.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio7.Location = new System.Drawing.Point(128, 85);
			this.eio7.Size = new System.Drawing.Size(16, 16);
			this.eio7.Text = "7";
			// 
			// eio6
			// 
			this.eio6.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio6.Location = new System.Drawing.Point(128, 61);
			this.eio6.Size = new System.Drawing.Size(16, 16);
			this.eio6.Text = "6";
			// 
			// eio5
			// 
			this.eio5.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio5.Location = new System.Drawing.Point(128, 37);
			this.eio5.Size = new System.Drawing.Size(16, 16);
			this.eio5.Text = "5";
			// 
			// eio3
			// 
			this.eio3.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio3.Location = new System.Drawing.Point(16, 109);
			this.eio3.Size = new System.Drawing.Size(16, 16);
			this.eio3.Text = "3";
			// 
			// eio2
			// 
			this.eio2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio2.Location = new System.Drawing.Point(16, 85);
			this.eio2.Size = new System.Drawing.Size(16, 16);
			this.eio2.Text = "2";
			// 
			// eio1
			// 
			this.eio1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio1.Location = new System.Drawing.Point(16, 61);
			this.eio1.Size = new System.Drawing.Size(16, 16);
			this.eio1.Text = "1";
			// 
			// eio0
			// 
			this.eio0.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.eio0.Location = new System.Drawing.Point(16, 37);
			this.eio0.Size = new System.Drawing.Size(16, 16);
			this.eio0.Text = "0";
			// 
			// eioD7
			// 
			this.eioD7.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD7.Location = new System.Drawing.Point(152, 85);
			this.eioD7.ReadOnly = true;
			this.eioD7.Size = new System.Drawing.Size(32, 21);
			this.eioD7.Text = "";
			// 
			// eioS7
			// 
			this.eioS7.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS7.Location = new System.Drawing.Point(192, 85);
			this.eioS7.ReadOnly = true;
			this.eioS7.Size = new System.Drawing.Size(32, 21);
			this.eioS7.Text = "";
			// 
			// eioD6
			// 
			this.eioD6.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD6.Location = new System.Drawing.Point(152, 61);
			this.eioD6.ReadOnly = true;
			this.eioD6.Size = new System.Drawing.Size(32, 21);
			this.eioD6.Text = "";
			// 
			// eioS6
			// 
			this.eioS6.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS6.Location = new System.Drawing.Point(192, 61);
			this.eioS6.ReadOnly = true;
			this.eioS6.Size = new System.Drawing.Size(32, 21);
			this.eioS6.Text = "";
			// 
			// EIODir2Text
			// 
			this.EIODir2Text.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.EIODir2Text.Location = new System.Drawing.Point(152, 13);
			this.EIODir2Text.Size = new System.Drawing.Size(24, 16);
			this.EIODir2Text.Text = "Dir";
			this.EIODir2Text.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// EIOState2Text
			// 
			this.EIOState2Text.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.EIOState2Text.Location = new System.Drawing.Point(184, 13);
			this.EIOState2Text.Size = new System.Drawing.Size(40, 16);
			this.EIOState2Text.Text = "State";
			this.EIOState2Text.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// eio2Text
			// 
			this.eio2Text.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.eio2Text.Location = new System.Drawing.Point(120, 13);
			this.eio2Text.Size = new System.Drawing.Size(32, 16);
			this.eio2Text.Text = "EIO";
			// 
			// eioD5
			// 
			this.eioD5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD5.Location = new System.Drawing.Point(152, 37);
			this.eioD5.ReadOnly = true;
			this.eioD5.Size = new System.Drawing.Size(32, 21);
			this.eioD5.Text = "";
			// 
			// eioD4
			// 
			this.eioD4.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD4.Location = new System.Drawing.Point(40, 133);
			this.eioD4.ReadOnly = true;
			this.eioD4.Size = new System.Drawing.Size(32, 21);
			this.eioD4.Text = "";
			// 
			// eioD3
			// 
			this.eioD3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD3.Location = new System.Drawing.Point(40, 109);
			this.eioD3.ReadOnly = true;
			this.eioD3.Size = new System.Drawing.Size(32, 21);
			this.eioD3.Text = "";
			// 
			// eioS5
			// 
			this.eioS5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS5.Location = new System.Drawing.Point(192, 37);
			this.eioS5.ReadOnly = true;
			this.eioS5.Size = new System.Drawing.Size(32, 21);
			this.eioS5.Text = "";
			// 
			// eioS4
			// 
			this.eioS4.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS4.Location = new System.Drawing.Point(80, 133);
			this.eioS4.ReadOnly = true;
			this.eioS4.Size = new System.Drawing.Size(32, 21);
			this.eioS4.Text = "";
			// 
			// eioS3
			// 
			this.eioS3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS3.Location = new System.Drawing.Point(80, 109);
			this.eioS3.ReadOnly = true;
			this.eioS3.Size = new System.Drawing.Size(32, 21);
			this.eioS3.Text = "";
			// 
			// eioD2
			// 
			this.eioD2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD2.Location = new System.Drawing.Point(40, 85);
			this.eioD2.ReadOnly = true;
			this.eioD2.Size = new System.Drawing.Size(32, 21);
			this.eioD2.Text = "";
			// 
			// eioD1
			// 
			this.eioD1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD1.Location = new System.Drawing.Point(40, 61);
			this.eioD1.ReadOnly = true;
			this.eioD1.Size = new System.Drawing.Size(32, 21);
			this.eioD1.Text = "";
			// 
			// eioD0
			// 
			this.eioD0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioD0.Location = new System.Drawing.Point(40, 37);
			this.eioD0.ReadOnly = true;
			this.eioD0.Size = new System.Drawing.Size(32, 21);
			this.eioD0.Text = "";
			// 
			// eioS2
			// 
			this.eioS2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS2.Location = new System.Drawing.Point(80, 85);
			this.eioS2.ReadOnly = true;
			this.eioS2.Size = new System.Drawing.Size(32, 21);
			this.eioS2.Text = "";
			// 
			// eioS1
			// 
			this.eioS1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS1.Location = new System.Drawing.Point(80, 61);
			this.eioS1.ReadOnly = true;
			this.eioS1.Size = new System.Drawing.Size(32, 21);
			this.eioS1.Text = "";
			// 
			// eioS0
			// 
			this.eioS0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.eioS0.Location = new System.Drawing.Point(80, 37);
			this.eioS0.ReadOnly = true;
			this.eioS0.Size = new System.Drawing.Size(32, 21);
			this.eioS0.Text = "";
			// 
			// EIODirText
			// 
			this.EIODirText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.EIODirText.Location = new System.Drawing.Point(40, 13);
			this.EIODirText.Size = new System.Drawing.Size(24, 16);
			this.EIODirText.Text = "Dir";
			this.EIODirText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// EIOStateText
			// 
			this.EIOStateText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.EIOStateText.Location = new System.Drawing.Point(72, 13);
			this.EIOStateText.Size = new System.Drawing.Size(40, 16);
			this.EIOStateText.Text = "State";
			this.EIOStateText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// eioText
			// 
			this.eioText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.eioText.Location = new System.Drawing.Point(8, 13);
			this.eioText.Size = new System.Drawing.Size(32, 16);
			this.eioText.Text = "EIO";
			// 
			// ControlConfig3Tab
			// 
			this.ControlConfig3Tab.Controls.Add(this.mioS2);
			this.ControlConfig3Tab.Controls.Add(this.mioS1);
			this.ControlConfig3Tab.Controls.Add(this.mioS0);
			this.ControlConfig3Tab.Controls.Add(this.mio2);
			this.ControlConfig3Tab.Controls.Add(this.mio1);
			this.ControlConfig3Tab.Controls.Add(this.mio0);
			this.ControlConfig3Tab.Controls.Add(this.cio3);
			this.ControlConfig3Tab.Controls.Add(this.cio2);
			this.ControlConfig3Tab.Controls.Add(this.cio1);
			this.ControlConfig3Tab.Controls.Add(this.cio0);
			this.ControlConfig3Tab.Controls.Add(this.mioD2);
			this.ControlConfig3Tab.Controls.Add(this.mioD1);
			this.ControlConfig3Tab.Controls.Add(this.mioDirText);
			this.ControlConfig3Tab.Controls.Add(this.mioStateText);
			this.ControlConfig3Tab.Controls.Add(this.mioText);
			this.ControlConfig3Tab.Controls.Add(this.mioD0);
			this.ControlConfig3Tab.Controls.Add(this.cioD3);
			this.ControlConfig3Tab.Controls.Add(this.cioS3);
			this.ControlConfig3Tab.Controls.Add(this.cioD2);
			this.ControlConfig3Tab.Controls.Add(this.cioD1);
			this.ControlConfig3Tab.Controls.Add(this.cioD0);
			this.ControlConfig3Tab.Controls.Add(this.cioS2);
			this.ControlConfig3Tab.Controls.Add(this.cioS1);
			this.ControlConfig3Tab.Controls.Add(this.cioS0);
			this.ControlConfig3Tab.Controls.Add(this.cioDirText);
			this.ControlConfig3Tab.Controls.Add(this.cioStateText);
			this.ControlConfig3Tab.Controls.Add(this.cioText);
			this.ControlConfig3Tab.Location = new System.Drawing.Point(4, 4);
			this.ControlConfig3Tab.Size = new System.Drawing.Size(232, 166);
			this.ControlConfig3Tab.Text = "CIO/MIO";
			// 
			// mioS2
			// 
			this.mioS2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.mioS2.Location = new System.Drawing.Point(192, 88);
			this.mioS2.ReadOnly = true;
			this.mioS2.Size = new System.Drawing.Size(32, 21);
			this.mioS2.Text = "";
			// 
			// mioS1
			// 
			this.mioS1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.mioS1.Location = new System.Drawing.Point(192, 64);
			this.mioS1.ReadOnly = true;
			this.mioS1.Size = new System.Drawing.Size(32, 21);
			this.mioS1.Text = "";
			// 
			// mioS0
			// 
			this.mioS0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.mioS0.Location = new System.Drawing.Point(192, 40);
			this.mioS0.ReadOnly = true;
			this.mioS0.Size = new System.Drawing.Size(32, 21);
			this.mioS0.Text = "";
			// 
			// mio2
			// 
			this.mio2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.mio2.Location = new System.Drawing.Point(128, 88);
			this.mio2.Size = new System.Drawing.Size(16, 16);
			this.mio2.Text = "2";
			// 
			// mio1
			// 
			this.mio1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.mio1.Location = new System.Drawing.Point(128, 64);
			this.mio1.Size = new System.Drawing.Size(16, 16);
			this.mio1.Text = "1";
			// 
			// mio0
			// 
			this.mio0.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.mio0.Location = new System.Drawing.Point(128, 40);
			this.mio0.Size = new System.Drawing.Size(16, 16);
			this.mio0.Text = "0";
			// 
			// cio3
			// 
			this.cio3.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.cio3.Location = new System.Drawing.Point(16, 112);
			this.cio3.Size = new System.Drawing.Size(16, 16);
			this.cio3.Text = "3";
			// 
			// cio2
			// 
			this.cio2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.cio2.Location = new System.Drawing.Point(16, 88);
			this.cio2.Size = new System.Drawing.Size(16, 16);
			this.cio2.Text = "2";
			// 
			// cio1
			// 
			this.cio1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.cio1.Location = new System.Drawing.Point(16, 64);
			this.cio1.Size = new System.Drawing.Size(16, 16);
			this.cio1.Text = "1";
			// 
			// cio0
			// 
			this.cio0.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.cio0.Location = new System.Drawing.Point(16, 40);
			this.cio0.Size = new System.Drawing.Size(16, 16);
			this.cio0.Text = "0";
			// 
			// mioD2
			// 
			this.mioD2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.mioD2.Location = new System.Drawing.Point(152, 88);
			this.mioD2.ReadOnly = true;
			this.mioD2.Size = new System.Drawing.Size(32, 21);
			this.mioD2.Text = "";
			// 
			// mioD1
			// 
			this.mioD1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.mioD1.Location = new System.Drawing.Point(152, 64);
			this.mioD1.ReadOnly = true;
			this.mioD1.Size = new System.Drawing.Size(32, 21);
			this.mioD1.Text = "";
			// 
			// mioDirText
			// 
			this.mioDirText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.mioDirText.Location = new System.Drawing.Point(152, 16);
			this.mioDirText.Size = new System.Drawing.Size(24, 16);
			this.mioDirText.Text = "Dir";
			this.mioDirText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// mioStateText
			// 
			this.mioStateText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.mioStateText.Location = new System.Drawing.Point(184, 16);
			this.mioStateText.Size = new System.Drawing.Size(40, 16);
			this.mioStateText.Text = "State";
			this.mioStateText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// mioText
			// 
			this.mioText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.mioText.Location = new System.Drawing.Point(120, 16);
			this.mioText.Size = new System.Drawing.Size(32, 16);
			this.mioText.Text = "MIO";
			// 
			// mioD0
			// 
			this.mioD0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.mioD0.Location = new System.Drawing.Point(152, 40);
			this.mioD0.ReadOnly = true;
			this.mioD0.Size = new System.Drawing.Size(32, 21);
			this.mioD0.Text = "";
			// 
			// cioD3
			// 
			this.cioD3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioD3.Location = new System.Drawing.Point(40, 112);
			this.cioD3.ReadOnly = true;
			this.cioD3.Size = new System.Drawing.Size(32, 21);
			this.cioD3.Text = "";
			// 
			// cioS3
			// 
			this.cioS3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioS3.Location = new System.Drawing.Point(80, 112);
			this.cioS3.ReadOnly = true;
			this.cioS3.Size = new System.Drawing.Size(32, 21);
			this.cioS3.Text = "";
			// 
			// cioD2
			// 
			this.cioD2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioD2.Location = new System.Drawing.Point(40, 88);
			this.cioD2.ReadOnly = true;
			this.cioD2.Size = new System.Drawing.Size(32, 21);
			this.cioD2.Text = "";
			// 
			// cioD1
			// 
			this.cioD1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioD1.Location = new System.Drawing.Point(40, 64);
			this.cioD1.ReadOnly = true;
			this.cioD1.Size = new System.Drawing.Size(32, 21);
			this.cioD1.Text = "";
			// 
			// cioD0
			// 
			this.cioD0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioD0.Location = new System.Drawing.Point(40, 40);
			this.cioD0.ReadOnly = true;
			this.cioD0.Size = new System.Drawing.Size(32, 21);
			this.cioD0.Text = "";
			// 
			// cioS2
			// 
			this.cioS2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioS2.Location = new System.Drawing.Point(80, 88);
			this.cioS2.ReadOnly = true;
			this.cioS2.Size = new System.Drawing.Size(32, 21);
			this.cioS2.Text = "";
			// 
			// cioS1
			// 
			this.cioS1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioS1.Location = new System.Drawing.Point(80, 64);
			this.cioS1.ReadOnly = true;
			this.cioS1.Size = new System.Drawing.Size(32, 21);
			this.cioS1.Text = "";
			// 
			// cioS0
			// 
			this.cioS0.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);
			this.cioS0.Location = new System.Drawing.Point(80, 40);
			this.cioS0.ReadOnly = true;
			this.cioS0.Size = new System.Drawing.Size(32, 21);
			this.cioS0.Text = "";
			// 
			// cioDirText
			// 
			this.cioDirText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.cioDirText.Location = new System.Drawing.Point(40, 16);
			this.cioDirText.Size = new System.Drawing.Size(24, 16);
			this.cioDirText.Text = "Dir";
			this.cioDirText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// cioStateText
			// 
			this.cioStateText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.cioStateText.Location = new System.Drawing.Point(72, 16);
			this.cioStateText.Size = new System.Drawing.Size(40, 16);
			this.cioStateText.Text = "State";
			this.cioStateText.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// cioText
			// 
			this.cioText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.cioText.Location = new System.Drawing.Point(8, 16);
			this.cioText.Size = new System.Drawing.Size(32, 16);
			this.cioText.Text = "CIO";
			// 
			// ControlConfig4Tab
			// 
			this.ControlConfig4Tab.Controls.Add(this.dacV1);
			this.ControlConfig4Tab.Controls.Add(this.dacV0);
			this.ControlConfig4Tab.Controls.Add(this.voltageText);
			this.ControlConfig4Tab.Controls.Add(this.label1);
			this.ControlConfig4Tab.Controls.Add(this.label2);
			this.ControlConfig4Tab.Controls.Add(this.dacE1);
			this.ControlConfig4Tab.Controls.Add(this.dacE0);
			this.ControlConfig4Tab.Controls.Add(this.enabledText);
			this.ControlConfig4Tab.Controls.Add(this.dacText);
			this.ControlConfig4Tab.Location = new System.Drawing.Point(4, 4);
			this.ControlConfig4Tab.Size = new System.Drawing.Size(232, 166);
			this.ControlConfig4Tab.Text = "DAC";
			// 
			// dacV1
			// 
			this.dacV1.Location = new System.Drawing.Point(136, 64);
			this.dacV1.ReadOnly = true;
			this.dacV1.Size = new System.Drawing.Size(64, 22);
			this.dacV1.Text = "";
			// 
			// dacV0
			// 
			this.dacV0.Location = new System.Drawing.Point(136, 40);
			this.dacV0.ReadOnly = true;
			this.dacV0.Size = new System.Drawing.Size(64, 22);
			this.dacV0.Text = "";
			// 
			// voltageText
			// 
			this.voltageText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.voltageText.Location = new System.Drawing.Point(136, 16);
			this.voltageText.Size = new System.Drawing.Size(64, 16);
			this.voltageText.Text = "Voltage";
			this.voltageText.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.label1.Location = new System.Drawing.Point(40, 64);
			this.label1.Size = new System.Drawing.Size(16, 16);
			this.label1.Text = "1";
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.label2.Location = new System.Drawing.Point(40, 40);
			this.label2.Size = new System.Drawing.Size(16, 16);
			this.label2.Text = "0";
			// 
			// dacE1
			// 
			this.dacE1.Location = new System.Drawing.Point(80, 64);
			this.dacE1.ReadOnly = true;
			this.dacE1.Size = new System.Drawing.Size(32, 22);
			this.dacE1.Text = "";
			// 
			// dacE0
			// 
			this.dacE0.Location = new System.Drawing.Point(80, 40);
			this.dacE0.ReadOnly = true;
			this.dacE0.Size = new System.Drawing.Size(32, 22);
			this.dacE0.Text = "";
			// 
			// enabledText
			// 
			this.enabledText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.enabledText.Location = new System.Drawing.Point(72, 16);
			this.enabledText.Size = new System.Drawing.Size(56, 16);
			this.enabledText.Text = "Enabled";
			// 
			// dacText
			// 
			this.dacText.Font = new System.Drawing.Font("Tahoma", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))));
			this.dacText.Location = new System.Drawing.Point(32, 16);
			this.dacText.Size = new System.Drawing.Size(32, 16);
			this.dacText.Text = "DAC";
			// 
			// idBox
			// 
			this.idBox.Location = new System.Drawing.Point(120, 208);
			this.idBox.Maximum = new System.Decimal(new int[] {
																  255,
																  0,
																  0,
																  0});
			this.idBox.Minimum = new System.Decimal(new int[] {
																  1,
																  0,
																  0,
																  -2147483648});
			this.idBox.Size = new System.Drawing.Size(56, 20);
			this.idBox.Value = new System.Decimal(new int[] {
																1,
																0,
																0,
																-2147483648});
			// 
			// ControlConfigUSBForm
			// 
			this.Controls.Add(this.idBox);
			this.Controls.Add(this.tabControl1);
			this.Controls.Add(this.idLabel);
			this.Controls.Add(this.errorLabel);
			this.Controls.Add(this.errorBox);
			this.Menu = this.mainMenu1;
			this.MinimizeBox = false;
			this.Text = "ue9ControlConfig USB";

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>

		static void Main() 
		{
			Application.Run(new ControlConfigUSBForm());
		}

		private void ControlConfigButton_Click(object sender, System.EventArgs e)
		{
			int err = 0;
			Error errorText = new Error(); 
			ue9Dev = new UE9();
			errorBox.Text = "";

			if((err = ue9Dev.openUSBConnection(Convert.ToInt32(idBox.Value))) < 0)
			{
				errorBox.Text = errorText.getError(err);
				return;
			}

			if( (err = ue9Dev.getCalibrationInfo()) < 0)
			{
				errorBox.Text = errorText.getError(err);
				ue9Dev.closeUSBConnection();				
				return;
			}

			if( (err = controlConfig_example()) < 0)
			{
				errorBox.Text = errorText.getError(err);
				if(err == -18)
					errorBox.Text += ue9Dev.errorcode;

				ue9Dev.closeUSBConnection();				
				return;
			}
			
			if( (err = ue9Dev.closeUSBConnection()) < 0)
			{
				errorBox.Text = errorText.getError(err);
				return;
			}
			
		}

		private int controlConfig_example()
		{
			byte []sendBuff = new byte[18];
			byte []recBuff = new byte[24];
			int i;
			ushort checksumTotal;
			uint dac = 0;

			sendBuff[1] = (byte)(0xF8);  //command byte
			sendBuff[2] = (byte)(0x06);  //number of data words
			sendBuff[3] = (byte)(0x08);  //extended command number

			//WriteMask, PowerLevel, FIODir, etc. are all passed a value of
			//zero since we only want to read Control configuration settings, 
			//not change them 
			for(i = 6; i < 18; i++)
				sendBuff[i] = (byte)(0x00);

			UE9.extendedChecksum(ref sendBuff,18);
  
			try
			{
				if(UE9.LJUSB_BulkWrite(ue9Dev.handle, UE9.UE9_PIPE_EP1_OUT, sendBuff, 18) != 18)
					throw new Exception();
			}
			catch(System.Exception)
			{
				return -14;
			}

			try
			{
				if(UE9.LJUSB_BulkRead(ue9Dev.handle, UE9.UE9_PIPE_EP1_IN, recBuff, 24) != 24)
					throw new Exception();
			}
			catch(System.Exception)
			{
				return -15;
			}

			
			checksumTotal = UE9.extendedChecksum16(recBuff, 24);
			if( (byte)((checksumTotal / 256) & 0xff) != recBuff[5])
				return -16;

			if( (byte)(checksumTotal & 0xff) != recBuff[4])
				return -16;

			if( UE9.extendedChecksum8(recBuff) != recBuff[0])
				return -17;


			if( recBuff[1] != (byte)(0xF8) || recBuff[2] != (byte)(0x09) || recBuff[3] != (byte)(0x08) )
				return -10;

			if( recBuff[6] != 0)
			{
				ue9Dev.errorcode = (int)recBuff[6];
				return -18;
			}
 
			powerLevelBox.Text = Convert.ToUInt32(recBuff[7]).ToString();			
			resetSourceBox.Text = Convert.ToUInt32(recBuff[8]).ToString();			
			controlFWVerBox.Text = string.Format("{0:f3}", (uint)recBuff[10]  + (double)recBuff[9]/100.0);						
			controlBLVerBox.Text = string.Format("{0:f3}", (uint)recBuff[12]  + (double)recBuff[11]/100.0);						

			fioD0.Text = (recBuff[14] & 0x01).ToString();
			fioS0.Text = (recBuff[15] & 0x01).ToString();
			fioD1.Text = ((recBuff[14] / 2) & 0x01).ToString();
			fioS1.Text = ((recBuff[15] / 2) & 0x01).ToString();
			fioD2.Text = ((recBuff[14] / 4) & 0x01).ToString();
			fioS2.Text = ((recBuff[15] / 4) & 0x01).ToString();
			fioD3.Text = ((recBuff[14] / 8) & 0x01).ToString();
			fioS3.Text = ((recBuff[15] / 8) & 0x01).ToString();
			fioD4.Text = ((recBuff[14] / 16) & 0x01).ToString();
			fioS4.Text = ((recBuff[15] / 16) & 0x01).ToString();
			fioD5.Text = ((recBuff[14] / 32) & 0x01).ToString();
			fioS5.Text = ((recBuff[15] / 32) & 0x01).ToString();
			fioD6.Text = ((recBuff[14] / 64) & 0x01).ToString();
			fioS6.Text = ((recBuff[15] / 64) & 0x01).ToString();
			fioD7.Text = ((recBuff[14] / 128) & 0x01).ToString();
			fioS7.Text = ((recBuff[15] / 128) & 0x01).ToString();

			eioD0.Text = (recBuff[16] & 0x01).ToString();
			eioS0.Text = (recBuff[17] & 0x01).ToString();
			eioD1.Text = ((recBuff[16] / 2) & 0x01).ToString();
			eioS1.Text = ((recBuff[17] / 2) & 0x01).ToString();
			eioD2.Text = ((recBuff[16] / 4) & 0x01).ToString();
			eioS2.Text = ((recBuff[17] / 4) & 0x01).ToString();
			eioD3.Text = ((recBuff[16] / 8) & 0x01).ToString();
			eioS3.Text = ((recBuff[17] / 8) & 0x01).ToString();
			eioD4.Text = ((recBuff[16] / 16) & 0x01).ToString();
			eioS4.Text = ((recBuff[17] / 16) & 0x01).ToString();
			eioD5.Text = ((recBuff[16] / 32) & 0x01).ToString();
			eioS5.Text = ((recBuff[17] / 32) & 0x01).ToString();
			eioD6.Text = ((recBuff[16] / 64) & 0x01).ToString();
			eioS6.Text = ((recBuff[17] / 64) & 0x01).ToString();
			eioD7.Text = ((recBuff[16] / 128) & 0x01).ToString();
			eioS7.Text = ((recBuff[17] / 128) & 0x01).ToString();

			cioD0.Text = ((recBuff[18] / 16) & 0x01).ToString();
			cioS0.Text = (recBuff[18] & 0x01).ToString();
			cioD1.Text = ((recBuff[18] / 32) & 0x01).ToString();
			cioS1.Text = ((recBuff[18] / 2) & 0x01).ToString();
			cioD2.Text = ((recBuff[18] / 64) & 0x01).ToString();
			cioS2.Text = ((recBuff[18] / 4) & 0x01).ToString();
			cioD3.Text = ((recBuff[18] / 128) & 0x01).ToString();
			cioS3.Text = ((recBuff[18] / 8) & 0x01).ToString();;
			
			mioD0.Text = ((recBuff[19] / 16) & 0x01).ToString();
			mioS0.Text = (recBuff[19] & 0x01).ToString();
			mioD1.Text = ((recBuff[19] / 32) & 0x01).ToString();
			mioS1.Text = ((recBuff[19] / 2) & 0x01).ToString();
			mioD2.Text = ((recBuff[19] / 64) & 0x01).ToString();
			mioS2.Text = ((recBuff[19] / 4) & 0x01).ToString();
			
			dacE0.Text = ((recBuff[21] / 128) & 0x01).ToString();
			dac = (uint)recBuff[20] + (uint)((recBuff[21] & 0x0f) * 256);			
			dacV0.Text = string.Format("{0:f3}", (dac - ue9Dev.caliInfo.DACOffset[0])/ue9Dev.caliInfo.DACSlope[0]);

			dacE1.Text = ((recBuff[23] / 128) & 0x01).ToString();
			dac = (uint)recBuff[22] + (uint)((recBuff[23] & 0x0f) * 256);
			dacV1.Text = string.Format("{0:f3}", (dac - ue9Dev.caliInfo.DACOffset[1])/ue9Dev.caliInfo.DACSlope[1]);
  
			return 0;
		}
	}
}
