//Programme de démonstration du module TC/USB-18A Visual C++ 2010 Express
// V1.0 : 30/10/2014: 3CC-DB : Release

#pragma once

#include "TCUSB18A.H"

namespace DemoTCUSB18A {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Description résumée de Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
			//
			//TODO: ajoutez ici le code du constructeur
			//
		}

	protected:
		/// <summary>
		/// Nettoyage des ressources utilisées.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::GroupBox^  groupBox3;
	protected: 
	private: System::Windows::Forms::Label^  labelDLL;
	private: System::Windows::Forms::Label^  labelFW;
	private: System::Windows::Forms::Label^  labelSN;
	private: System::Windows::Forms::GroupBox^  groupBox2;
	private: System::Windows::Forms::CheckBox^  checkBoxZ;
	private: System::Windows::Forms::Label^  label19;
	private: System::Windows::Forms::Label^  label18;
	private: System::Windows::Forms::Label^  label17;
	private: System::Windows::Forms::TextBox^  textBoxDataPos;
	private: System::Windows::Forms::Button^  button10;
	private: System::Windows::Forms::Panel^  panelB;
	private: System::Windows::Forms::Panel^  panelA;
	private: System::Windows::Forms::Panel^  panelZ;
	private: System::Windows::Forms::GroupBox^  groupBox1;
	private: System::Windows::Forms::Label^  label21;
	private: System::Windows::Forms::Label^  label8;
	private: System::Windows::Forms::Label^  label7;
	private: System::Windows::Forms::Label^  label6;
	private: System::Windows::Forms::Label^  label5;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::TextBox^  textBoxCTR8;
	private: System::Windows::Forms::TextBox^  textBoxCTR7;
	private: System::Windows::Forms::TextBox^  textBoxCTR6;
	private: System::Windows::Forms::TextBox^  textBoxCTR5;
	private: System::Windows::Forms::TextBox^  textBoxCTR4;
	private: System::Windows::Forms::TextBox^  textBoxCTR3;
	private: System::Windows::Forms::TextBox^  textBoxCTR2;
	private: System::Windows::Forms::TextBox^  textBoxCTR1;
	private: System::Windows::Forms::Panel^  panelI8;
	private: System::Windows::Forms::Panel^  panelI7;
	private: System::Windows::Forms::Panel^  panelI6;
	private: System::Windows::Forms::Panel^  panelI5;
	private: System::Windows::Forms::Button^  buttonS4;
	private: System::Windows::Forms::Panel^  panelI4;
	private: System::Windows::Forms::Button^  buttonS3;
	private: System::Windows::Forms::Panel^  panelI3;
	private: System::Windows::Forms::Button^  buttonS2;
	private: System::Windows::Forms::Button^  buttonS1;
	private: System::Windows::Forms::Panel^  panelI2;
	private: System::Windows::Forms::Panel^  panelI1;
	private: System::Windows::Forms::Button^  buttonOpen;
	private: System::Windows::Forms::TextBox^  TextBoxSN;
	private: System::Windows::Forms::GroupBox^  groupBox4;
	private: System::Windows::Forms::Label^  labelI4Amps;

	private: System::Windows::Forms::Label^  labelI4Volts;
	private: System::Windows::Forms::Label^  labelI3Amps;



	private: System::Windows::Forms::Label^  labelI3Volts;

	private: System::Windows::Forms::Label^  label16;
	private: System::Windows::Forms::Label^  label20;
	private: System::Windows::Forms::Label^  label22;
	private: System::Windows::Forms::TextBox^  textBoxRawI4;

	private: System::Windows::Forms::TextBox^  textBoxRawI3;

	private: System::Windows::Forms::NumericUpDown^  numericUpDownO2;

	private: System::Windows::Forms::Label^  labelI2Amps;
	private: System::Windows::Forms::Label^  labelI2Volts;

	private: System::Windows::Forms::Label^  labelI1Amps;
	private: System::Windows::Forms::Label^  labelI1Volts;

	private: System::Windows::Forms::Label^  label11;
	private: System::Windows::Forms::Label^  label10;
	private: System::Windows::Forms::Label^  label9;
	private: System::Windows::Forms::TextBox^  textBoxRawI2;
	private: System::Windows::Forms::TextBox^  textBoxRawI1;
	private: System::Windows::Forms::NumericUpDown^  numericUpDownO1;
	private: System::Windows::Forms::Timer^  timer1;
	private: System::Windows::Forms::Label^  label26;
	private: System::Windows::Forms::Label^  label25;
	private: System::Windows::Forms::Label^  label24;
	private: System::Windows::Forms::Label^  label23;
	private: System::Windows::Forms::Label^  label15;
	private: System::Windows::Forms::Label^  label14;
	private: System::Windows::Forms::Label^  label13;
	private: System::Windows::Forms::Label^  label12;
	private: System::ComponentModel::IContainer^  components;

	private:
		/// <summary>
		/// Variable nécessaire au concepteur.
		/// </summary>


#pragma region Windows Form Designer generated code
		/// <summary>
		/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
		/// le contenu de cette méthode avec l'éditeur de code.
		/// </summary>
		void InitializeComponent(void)
		{
			this->components = (gcnew System::ComponentModel::Container());
			this->groupBox3 = (gcnew System::Windows::Forms::GroupBox());
			this->labelDLL = (gcnew System::Windows::Forms::Label());
			this->labelFW = (gcnew System::Windows::Forms::Label());
			this->labelSN = (gcnew System::Windows::Forms::Label());
			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
			this->checkBoxZ = (gcnew System::Windows::Forms::CheckBox());
			this->label19 = (gcnew System::Windows::Forms::Label());
			this->label18 = (gcnew System::Windows::Forms::Label());
			this->label17 = (gcnew System::Windows::Forms::Label());
			this->textBoxDataPos = (gcnew System::Windows::Forms::TextBox());
			this->button10 = (gcnew System::Windows::Forms::Button());
			this->panelB = (gcnew System::Windows::Forms::Panel());
			this->panelA = (gcnew System::Windows::Forms::Panel());
			this->panelZ = (gcnew System::Windows::Forms::Panel());
			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
			this->label21 = (gcnew System::Windows::Forms::Label());
			this->label8 = (gcnew System::Windows::Forms::Label());
			this->label7 = (gcnew System::Windows::Forms::Label());
			this->label6 = (gcnew System::Windows::Forms::Label());
			this->label5 = (gcnew System::Windows::Forms::Label());
			this->label4 = (gcnew System::Windows::Forms::Label());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->textBoxCTR8 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxCTR7 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxCTR6 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxCTR5 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxCTR4 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxCTR3 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxCTR2 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxCTR1 = (gcnew System::Windows::Forms::TextBox());
			this->panelI8 = (gcnew System::Windows::Forms::Panel());
			this->panelI7 = (gcnew System::Windows::Forms::Panel());
			this->panelI6 = (gcnew System::Windows::Forms::Panel());
			this->panelI5 = (gcnew System::Windows::Forms::Panel());
			this->buttonS4 = (gcnew System::Windows::Forms::Button());
			this->panelI4 = (gcnew System::Windows::Forms::Panel());
			this->buttonS3 = (gcnew System::Windows::Forms::Button());
			this->panelI3 = (gcnew System::Windows::Forms::Panel());
			this->buttonS2 = (gcnew System::Windows::Forms::Button());
			this->buttonS1 = (gcnew System::Windows::Forms::Button());
			this->panelI2 = (gcnew System::Windows::Forms::Panel());
			this->panelI1 = (gcnew System::Windows::Forms::Panel());
			this->buttonOpen = (gcnew System::Windows::Forms::Button());
			this->TextBoxSN = (gcnew System::Windows::Forms::TextBox());
			this->groupBox4 = (gcnew System::Windows::Forms::GroupBox());
			this->label26 = (gcnew System::Windows::Forms::Label());
			this->label25 = (gcnew System::Windows::Forms::Label());
			this->label24 = (gcnew System::Windows::Forms::Label());
			this->label23 = (gcnew System::Windows::Forms::Label());
			this->label15 = (gcnew System::Windows::Forms::Label());
			this->label14 = (gcnew System::Windows::Forms::Label());
			this->label13 = (gcnew System::Windows::Forms::Label());
			this->label12 = (gcnew System::Windows::Forms::Label());
			this->labelI4Amps = (gcnew System::Windows::Forms::Label());
			this->labelI4Volts = (gcnew System::Windows::Forms::Label());
			this->labelI3Amps = (gcnew System::Windows::Forms::Label());
			this->labelI3Volts = (gcnew System::Windows::Forms::Label());
			this->label16 = (gcnew System::Windows::Forms::Label());
			this->label20 = (gcnew System::Windows::Forms::Label());
			this->label22 = (gcnew System::Windows::Forms::Label());
			this->textBoxRawI4 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxRawI3 = (gcnew System::Windows::Forms::TextBox());
			this->numericUpDownO2 = (gcnew System::Windows::Forms::NumericUpDown());
			this->labelI2Amps = (gcnew System::Windows::Forms::Label());
			this->labelI2Volts = (gcnew System::Windows::Forms::Label());
			this->labelI1Amps = (gcnew System::Windows::Forms::Label());
			this->labelI1Volts = (gcnew System::Windows::Forms::Label());
			this->label11 = (gcnew System::Windows::Forms::Label());
			this->label10 = (gcnew System::Windows::Forms::Label());
			this->label9 = (gcnew System::Windows::Forms::Label());
			this->textBoxRawI2 = (gcnew System::Windows::Forms::TextBox());
			this->textBoxRawI1 = (gcnew System::Windows::Forms::TextBox());
			this->numericUpDownO1 = (gcnew System::Windows::Forms::NumericUpDown());
			this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
			this->groupBox3->SuspendLayout();
			this->groupBox2->SuspendLayout();
			this->groupBox1->SuspendLayout();
			this->groupBox4->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDownO2))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDownO1))->BeginInit();
			this->SuspendLayout();
			// 
			// groupBox3
			// 
			this->groupBox3->Controls->Add(this->labelDLL);
			this->groupBox3->Controls->Add(this->labelFW);
			this->groupBox3->Controls->Add(this->labelSN);
			this->groupBox3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->groupBox3->Location = System::Drawing::Point(317, 167);
			this->groupBox3->Name = L"groupBox3";
			this->groupBox3->Size = System::Drawing::Size(279, 122);
			this->groupBox3->TabIndex = 9;
			this->groupBox3->TabStop = false;
			this->groupBox3->Text = L"TC/USB-18A Info";
			// 
			// labelDLL
			// 
			this->labelDLL->AutoSize = true;
			this->labelDLL->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->labelDLL->Location = System::Drawing::Point(18, 92);
			this->labelDLL->Name = L"labelDLL";
			this->labelDLL->Size = System::Drawing::Size(10, 13);
			this->labelDLL->TabIndex = 2;
			this->labelDLL->Text = L" ";
			// 
			// labelFW
			// 
			this->labelFW->AutoSize = true;
			this->labelFW->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->labelFW->Location = System::Drawing::Point(18, 60);
			this->labelFW->Name = L"labelFW";
			this->labelFW->Size = System::Drawing::Size(10, 13);
			this->labelFW->TabIndex = 1;
			this->labelFW->Text = L" ";
			// 
			// labelSN
			// 
			this->labelSN->AutoSize = true;
			this->labelSN->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->labelSN->Location = System::Drawing::Point(18, 28);
			this->labelSN->Name = L"labelSN";
			this->labelSN->Size = System::Drawing::Size(10, 13);
			this->labelSN->TabIndex = 0;
			this->labelSN->Text = L" ";
			// 
			// groupBox2
			// 
			this->groupBox2->Controls->Add(this->checkBoxZ);
			this->groupBox2->Controls->Add(this->label19);
			this->groupBox2->Controls->Add(this->label18);
			this->groupBox2->Controls->Add(this->label17);
			this->groupBox2->Controls->Add(this->textBoxDataPos);
			this->groupBox2->Controls->Add(this->button10);
			this->groupBox2->Controls->Add(this->panelB);
			this->groupBox2->Controls->Add(this->panelA);
			this->groupBox2->Controls->Add(this->panelZ);
			this->groupBox2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->groupBox2->Location = System::Drawing::Point(12, 167);
			this->groupBox2->Name = L"groupBox2";
			this->groupBox2->Size = System::Drawing::Size(279, 122);
			this->groupBox2->TabIndex = 8;
			this->groupBox2->TabStop = false;
			this->groupBox2->Text = L"Encoder";
			// 
			// checkBoxZ
			// 
			this->checkBoxZ->AutoSize = true;
			this->checkBoxZ->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->checkBoxZ->Location = System::Drawing::Point(126, 50);
			this->checkBoxZ->Name = L"checkBoxZ";
			this->checkBoxZ->Size = System::Drawing::Size(101, 17);
			this->checkBoxZ->TabIndex = 13;
			this->checkBoxZ->Text = L"Reset on Top Z";
			this->checkBoxZ->UseVisualStyleBackColor = true;
			this->checkBoxZ->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBoxZ_CheckedChanged);
			this->checkBoxZ->CheckStateChanged += gcnew System::EventHandler(this, &Form1::checkBoxZ_CheckStateChanged);
			// 
			// label19
			// 
			this->label19->AutoSize = true;
			this->label19->Location = System::Drawing::Point(103, 21);
			this->label19->Name = L"label19";
			this->label19->Size = System::Drawing::Size(15, 13);
			this->label19->TabIndex = 12;
			this->label19->Text = L"B";
			// 
			// label18
			// 
			this->label18->AutoSize = true;
			this->label18->Location = System::Drawing::Point(68, 21);
			this->label18->Name = L"label18";
			this->label18->Size = System::Drawing::Size(15, 13);
			this->label18->TabIndex = 11;
			this->label18->Text = L"A";
			// 
			// label17
			// 
			this->label17->AutoSize = true;
			this->label17->Location = System::Drawing::Point(32, 21);
			this->label17->Name = L"label17";
			this->label17->Size = System::Drawing::Size(15, 13);
			this->label17->TabIndex = 10;
			this->label17->Text = L"Z";
			// 
			// textBoxDataPos
			// 
			this->textBoxDataPos->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->textBoxDataPos->Location = System::Drawing::Point(18, 89);
			this->textBoxDataPos->Name = L"textBoxDataPos";
			this->textBoxDataPos->ReadOnly = true;
			this->textBoxDataPos->Size = System::Drawing::Size(100, 20);
			this->textBoxDataPos->TabIndex = 9;
			this->textBoxDataPos->Text = L"0";
			// 
			// button10
			// 
			this->button10->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->button10->Location = System::Drawing::Point(126, 86);
			this->button10->Name = L"button10";
			this->button10->Size = System::Drawing::Size(126, 23);
			this->button10->TabIndex = 8;
			this->button10->Text = L"Reset position";
			this->button10->UseVisualStyleBackColor = true;
			this->button10->Click += gcnew System::EventHandler(this, &Form1::button10_Click);
			// 
			// panelB
			// 
			this->panelB->BackColor = System::Drawing::Color::Green;
			this->panelB->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelB->Location = System::Drawing::Point(90, 37);
			this->panelB->Name = L"panelB";
			this->panelB->Size = System::Drawing::Size(30, 30);
			this->panelB->TabIndex = 5;
			// 
			// panelA
			// 
			this->panelA->BackColor = System::Drawing::Color::Green;
			this->panelA->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelA->Location = System::Drawing::Point(54, 37);
			this->panelA->Name = L"panelA";
			this->panelA->Size = System::Drawing::Size(30, 30);
			this->panelA->TabIndex = 6;
			// 
			// panelZ
			// 
			this->panelZ->BackColor = System::Drawing::Color::Green;
			this->panelZ->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelZ->Location = System::Drawing::Point(18, 37);
			this->panelZ->Name = L"panelZ";
			this->panelZ->Size = System::Drawing::Size(30, 30);
			this->panelZ->TabIndex = 4;
			// 
			// groupBox1
			// 
			this->groupBox1->Controls->Add(this->label21);
			this->groupBox1->Controls->Add(this->label8);
			this->groupBox1->Controls->Add(this->label7);
			this->groupBox1->Controls->Add(this->label6);
			this->groupBox1->Controls->Add(this->label5);
			this->groupBox1->Controls->Add(this->label4);
			this->groupBox1->Controls->Add(this->label3);
			this->groupBox1->Controls->Add(this->label2);
			this->groupBox1->Controls->Add(this->label1);
			this->groupBox1->Controls->Add(this->textBoxCTR8);
			this->groupBox1->Controls->Add(this->textBoxCTR7);
			this->groupBox1->Controls->Add(this->textBoxCTR6);
			this->groupBox1->Controls->Add(this->textBoxCTR5);
			this->groupBox1->Controls->Add(this->textBoxCTR4);
			this->groupBox1->Controls->Add(this->textBoxCTR3);
			this->groupBox1->Controls->Add(this->textBoxCTR2);
			this->groupBox1->Controls->Add(this->textBoxCTR1);
			this->groupBox1->Controls->Add(this->panelI8);
			this->groupBox1->Controls->Add(this->panelI7);
			this->groupBox1->Controls->Add(this->panelI6);
			this->groupBox1->Controls->Add(this->panelI5);
			this->groupBox1->Controls->Add(this->buttonS4);
			this->groupBox1->Controls->Add(this->panelI4);
			this->groupBox1->Controls->Add(this->buttonS3);
			this->groupBox1->Controls->Add(this->panelI3);
			this->groupBox1->Controls->Add(this->buttonS2);
			this->groupBox1->Controls->Add(this->buttonS1);
			this->groupBox1->Controls->Add(this->panelI2);
			this->groupBox1->Controls->Add(this->panelI1);
			this->groupBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->groupBox1->Location = System::Drawing::Point(12, 39);
			this->groupBox1->Name = L"groupBox1";
			this->groupBox1->Size = System::Drawing::Size(584, 122);
			this->groupBox1->TabIndex = 7;
			this->groupBox1->TabStop = false;
			this->groupBox1->Text = L"Inputs / Outputs";
			// 
			// label21
			// 
			this->label21->AutoSize = true;
			this->label21->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->label21->Location = System::Drawing::Point(26, 22);
			this->label21->Name = L"label21";
			this->label21->Size = System::Drawing::Size(268, 13);
			this->label21->TabIndex = 38;
			this->label21->Text = L"I 1        I 2       I 3        I 4         I 5        I 6        I 7       I 8";
			// 
			// label8
			// 
			this->label8->AutoSize = true;
			this->label8->Location = System::Drawing::Point(521, 62);
			this->label8->Name = L"label8";
			this->label8->Size = System::Drawing::Size(47, 13);
			this->label8->TabIndex = 29;
			this->label8->Text = L"Count8";
			// 
			// label7
			// 
			this->label7->AutoSize = true;
			this->label7->Location = System::Drawing::Point(453, 62);
			this->label7->Name = L"label7";
			this->label7->Size = System::Drawing::Size(47, 13);
			this->label7->TabIndex = 28;
			this->label7->Text = L"Count7";
			// 
			// label6
			// 
			this->label6->AutoSize = true;
			this->label6->Location = System::Drawing::Point(387, 62);
			this->label6->Name = L"label6";
			this->label6->Size = System::Drawing::Size(47, 13);
			this->label6->TabIndex = 27;
			this->label6->Text = L"Count6";
			// 
			// label5
			// 
			this->label5->AutoSize = true;
			this->label5->Location = System::Drawing::Point(324, 61);
			this->label5->Name = L"label5";
			this->label5->Size = System::Drawing::Size(47, 13);
			this->label5->TabIndex = 26;
			this->label5->Text = L"Count5";
			// 
			// label4
			// 
			this->label4->AutoSize = true;
			this->label4->Location = System::Drawing::Point(521, 22);
			this->label4->Name = L"label4";
			this->label4->Size = System::Drawing::Size(47, 13);
			this->label4->TabIndex = 25;
			this->label4->Text = L"Count4";
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->Location = System::Drawing::Point(453, 22);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(47, 13);
			this->label3->TabIndex = 24;
			this->label3->Text = L"Count3";
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Location = System::Drawing::Point(387, 22);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(47, 13);
			this->label2->TabIndex = 23;
			this->label2->Text = L"Count2";
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(326, 22);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(47, 13);
			this->label1->TabIndex = 22;
			this->label1->Text = L"Count1";
			// 
			// textBoxCTR8
			// 
			this->textBoxCTR8->Location = System::Drawing::Point(524, 78);
			this->textBoxCTR8->Name = L"textBoxCTR8";
			this->textBoxCTR8->ReadOnly = true;
			this->textBoxCTR8->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR8->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR8->TabIndex = 13;
			this->textBoxCTR8->Text = L"0";
			// 
			// textBoxCTR7
			// 
			this->textBoxCTR7->Location = System::Drawing::Point(456, 78);
			this->textBoxCTR7->Name = L"textBoxCTR7";
			this->textBoxCTR7->ReadOnly = true;
			this->textBoxCTR7->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR7->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR7->TabIndex = 12;
			this->textBoxCTR7->Text = L"0";
			// 
			// textBoxCTR6
			// 
			this->textBoxCTR6->Location = System::Drawing::Point(390, 78);
			this->textBoxCTR6->Name = L"textBoxCTR6";
			this->textBoxCTR6->ReadOnly = true;
			this->textBoxCTR6->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR6->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR6->TabIndex = 11;
			this->textBoxCTR6->Text = L"0";
			// 
			// textBoxCTR5
			// 
			this->textBoxCTR5->Location = System::Drawing::Point(327, 78);
			this->textBoxCTR5->Name = L"textBoxCTR5";
			this->textBoxCTR5->ReadOnly = true;
			this->textBoxCTR5->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR5->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR5->TabIndex = 10;
			this->textBoxCTR5->Text = L"0";
			// 
			// textBoxCTR4
			// 
			this->textBoxCTR4->Location = System::Drawing::Point(524, 38);
			this->textBoxCTR4->Name = L"textBoxCTR4";
			this->textBoxCTR4->ReadOnly = true;
			this->textBoxCTR4->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR4->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR4->TabIndex = 9;
			this->textBoxCTR4->Text = L"0";
			// 
			// textBoxCTR3
			// 
			this->textBoxCTR3->Location = System::Drawing::Point(456, 38);
			this->textBoxCTR3->Name = L"textBoxCTR3";
			this->textBoxCTR3->ReadOnly = true;
			this->textBoxCTR3->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR3->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR3->TabIndex = 8;
			this->textBoxCTR3->Text = L"0";
			// 
			// textBoxCTR2
			// 
			this->textBoxCTR2->Location = System::Drawing::Point(390, 38);
			this->textBoxCTR2->Name = L"textBoxCTR2";
			this->textBoxCTR2->ReadOnly = true;
			this->textBoxCTR2->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR2->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR2->TabIndex = 7;
			this->textBoxCTR2->Text = L"0";
			// 
			// textBoxCTR1
			// 
			this->textBoxCTR1->Location = System::Drawing::Point(327, 38);
			this->textBoxCTR1->Name = L"textBoxCTR1";
			this->textBoxCTR1->ReadOnly = true;
			this->textBoxCTR1->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
			this->textBoxCTR1->Size = System::Drawing::Size(40, 20);
			this->textBoxCTR1->TabIndex = 6;
			this->textBoxCTR1->Text = L"0";
			// 
			// panelI8
			// 
			this->panelI8->BackColor = System::Drawing::Color::Green;
			this->panelI8->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI8->Location = System::Drawing::Point(269, 38);
			this->panelI8->Name = L"panelI8";
			this->panelI8->Size = System::Drawing::Size(30, 30);
			this->panelI8->TabIndex = 3;
			// 
			// panelI7
			// 
			this->panelI7->BackColor = System::Drawing::Color::Green;
			this->panelI7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI7->Location = System::Drawing::Point(233, 38);
			this->panelI7->Name = L"panelI7";
			this->panelI7->Size = System::Drawing::Size(30, 30);
			this->panelI7->TabIndex = 3;
			// 
			// panelI6
			// 
			this->panelI6->BackColor = System::Drawing::Color::Green;
			this->panelI6->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI6->Location = System::Drawing::Point(197, 38);
			this->panelI6->Name = L"panelI6";
			this->panelI6->Size = System::Drawing::Size(30, 30);
			this->panelI6->TabIndex = 3;
			// 
			// panelI5
			// 
			this->panelI5->BackColor = System::Drawing::Color::Green;
			this->panelI5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI5->Location = System::Drawing::Point(161, 38);
			this->panelI5->Name = L"panelI5";
			this->panelI5->Size = System::Drawing::Size(30, 30);
			this->panelI5->TabIndex = 3;
			// 
			// buttonS4
			// 
			this->buttonS4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->buttonS4->Location = System::Drawing::Point(197, 82);
			this->buttonS4->Name = L"buttonS4";
			this->buttonS4->Size = System::Drawing::Size(30, 30);
			this->buttonS4->TabIndex = 4;
			this->buttonS4->Tag = L"4";
			this->buttonS4->Text = L"O4";
			this->buttonS4->UseVisualStyleBackColor = true;
			this->buttonS4->Click += gcnew System::EventHandler(this, &Form1::buttonS4_Click);
			// 
			// panelI4
			// 
			this->panelI4->BackColor = System::Drawing::Color::Green;
			this->panelI4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI4->Location = System::Drawing::Point(125, 38);
			this->panelI4->Name = L"panelI4";
			this->panelI4->Size = System::Drawing::Size(30, 30);
			this->panelI4->TabIndex = 3;
			// 
			// buttonS3
			// 
			this->buttonS3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->buttonS3->Location = System::Drawing::Point(161, 82);
			this->buttonS3->Name = L"buttonS3";
			this->buttonS3->Size = System::Drawing::Size(30, 30);
			this->buttonS3->TabIndex = 4;
			this->buttonS3->Tag = L"3";
			this->buttonS3->Text = L"O3";
			this->buttonS3->UseVisualStyleBackColor = true;
			this->buttonS3->Click += gcnew System::EventHandler(this, &Form1::buttonS3_Click);
			// 
			// panelI3
			// 
			this->panelI3->BackColor = System::Drawing::Color::Green;
			this->panelI3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI3->Location = System::Drawing::Point(89, 38);
			this->panelI3->Name = L"panelI3";
			this->panelI3->Size = System::Drawing::Size(30, 30);
			this->panelI3->TabIndex = 3;
			// 
			// buttonS2
			// 
			this->buttonS2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->buttonS2->Location = System::Drawing::Point(125, 82);
			this->buttonS2->Name = L"buttonS2";
			this->buttonS2->Size = System::Drawing::Size(30, 30);
			this->buttonS2->TabIndex = 4;
			this->buttonS2->Tag = L"2";
			this->buttonS2->Text = L"O2";
			this->buttonS2->UseVisualStyleBackColor = true;
			this->buttonS2->Click += gcnew System::EventHandler(this, &Form1::buttonS2_Click);
			// 
			// buttonS1
			// 
			this->buttonS1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->buttonS1->Location = System::Drawing::Point(89, 82);
			this->buttonS1->Name = L"buttonS1";
			this->buttonS1->Size = System::Drawing::Size(30, 30);
			this->buttonS1->TabIndex = 1;
			this->buttonS1->Tag = L"1";
			this->buttonS1->Text = L"O1";
			this->buttonS1->UseVisualStyleBackColor = true;
			this->buttonS1->Click += gcnew System::EventHandler(this, &Form1::buttonS1_Click);
			// 
			// panelI2
			// 
			this->panelI2->BackColor = System::Drawing::Color::Green;
			this->panelI2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI2->Location = System::Drawing::Point(53, 38);
			this->panelI2->Name = L"panelI2";
			this->panelI2->Size = System::Drawing::Size(30, 30);
			this->panelI2->TabIndex = 3;
			// 
			// panelI1
			// 
			this->panelI1->BackColor = System::Drawing::Color::Green;
			this->panelI1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->panelI1->Location = System::Drawing::Point(17, 38);
			this->panelI1->Name = L"panelI1";
			this->panelI1->Size = System::Drawing::Size(30, 30);
			this->panelI1->TabIndex = 0;
			// 
			// buttonOpen
			// 
			this->buttonOpen->Location = System::Drawing::Point(118, 13);
			this->buttonOpen->Name = L"buttonOpen";
			this->buttonOpen->Size = System::Drawing::Size(75, 20);
			this->buttonOpen->TabIndex = 6;
			this->buttonOpen->Text = L"Open!";
			this->buttonOpen->UseVisualStyleBackColor = true;
			this->buttonOpen->Click += gcnew System::EventHandler(this, &Form1::buttonOpen_Click);
			// 
			// TextBoxSN
			// 
			this->TextBoxSN->Location = System::Drawing::Point(12, 13);
			this->TextBoxSN->Name = L"TextBoxSN";
			this->TextBoxSN->Size = System::Drawing::Size(100, 20);
			this->TextBoxSN->TabIndex = 5;
			this->TextBoxSN->Text = L"0";
			this->TextBoxSN->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
			// 
			// groupBox4
			// 
			this->groupBox4->Controls->Add(this->label26);
			this->groupBox4->Controls->Add(this->label25);
			this->groupBox4->Controls->Add(this->label24);
			this->groupBox4->Controls->Add(this->label23);
			this->groupBox4->Controls->Add(this->label15);
			this->groupBox4->Controls->Add(this->label14);
			this->groupBox4->Controls->Add(this->label13);
			this->groupBox4->Controls->Add(this->label12);
			this->groupBox4->Controls->Add(this->labelI4Amps);
			this->groupBox4->Controls->Add(this->labelI4Volts);
			this->groupBox4->Controls->Add(this->labelI3Amps);
			this->groupBox4->Controls->Add(this->labelI3Volts);
			this->groupBox4->Controls->Add(this->label16);
			this->groupBox4->Controls->Add(this->label20);
			this->groupBox4->Controls->Add(this->label22);
			this->groupBox4->Controls->Add(this->textBoxRawI4);
			this->groupBox4->Controls->Add(this->textBoxRawI3);
			this->groupBox4->Controls->Add(this->numericUpDownO2);
			this->groupBox4->Controls->Add(this->labelI2Amps);
			this->groupBox4->Controls->Add(this->labelI2Volts);
			this->groupBox4->Controls->Add(this->labelI1Amps);
			this->groupBox4->Controls->Add(this->labelI1Volts);
			this->groupBox4->Controls->Add(this->label11);
			this->groupBox4->Controls->Add(this->label10);
			this->groupBox4->Controls->Add(this->label9);
			this->groupBox4->Controls->Add(this->textBoxRawI2);
			this->groupBox4->Controls->Add(this->textBoxRawI1);
			this->groupBox4->Controls->Add(this->numericUpDownO1);
			this->groupBox4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->groupBox4->Location = System::Drawing::Point(14, 296);
			this->groupBox4->Name = L"groupBox4";
			this->groupBox4->Size = System::Drawing::Size(581, 150);
			this->groupBox4->TabIndex = 10;
			this->groupBox4->TabStop = false;
			this->groupBox4->Text = L"Analog Inputs / Outputs";
			// 
			// label26
			// 
			this->label26->AutoSize = true;
			this->label26->Location = System::Drawing::Point(507, 120);
			this->label26->Name = L"label26";
			this->label26->Size = System::Drawing::Size(24, 13);
			this->label26->TabIndex = 27;
			this->label26->Text = L"mA";
			// 
			// label25
			// 
			this->label25->AutoSize = true;
			this->label25->Location = System::Drawing::Point(403, 120);
			this->label25->Name = L"label25";
			this->label25->Size = System::Drawing::Size(24, 13);
			this->label25->TabIndex = 26;
			this->label25->Text = L"mA";
			// 
			// label24
			// 
			this->label24->AutoSize = true;
			this->label24->Location = System::Drawing::Point(127, 120);
			this->label24->Name = L"label24";
			this->label24->Size = System::Drawing::Size(24, 13);
			this->label24->TabIndex = 25;
			this->label24->Text = L"mA";
			// 
			// label23
			// 
			this->label23->AutoSize = true;
			this->label23->Location = System::Drawing::Point(231, 120);
			this->label23->Name = L"label23";
			this->label23->Size = System::Drawing::Size(24, 13);
			this->label23->TabIndex = 24;
			this->label23->Text = L"mA";
			// 
			// label15
			// 
			this->label15->AutoSize = true;
			this->label15->Location = System::Drawing::Point(516, 81);
			this->label15->Name = L"label15";
			this->label15->Size = System::Drawing::Size(15, 13);
			this->label15->TabIndex = 23;
			this->label15->Text = L"V";
			// 
			// label14
			// 
			this->label14->AutoSize = true;
			this->label14->Location = System::Drawing::Point(409, 81);
			this->label14->Name = L"label14";
			this->label14->Size = System::Drawing::Size(15, 13);
			this->label14->TabIndex = 22;
			this->label14->Text = L"V";
			// 
			// label13
			// 
			this->label13->AutoSize = true;
			this->label13->Location = System::Drawing::Point(240, 81);
			this->label13->Name = L"label13";
			this->label13->Size = System::Drawing::Size(15, 13);
			this->label13->TabIndex = 21;
			this->label13->Text = L"V";
			// 
			// label12
			// 
			this->label12->AutoSize = true;
			this->label12->Location = System::Drawing::Point(131, 81);
			this->label12->Name = L"label12";
			this->label12->Size = System::Drawing::Size(15, 13);
			this->label12->TabIndex = 20;
			this->label12->Text = L"V";
			// 
			// labelI4Amps
			// 
			this->labelI4Amps->AutoSize = true;
			this->labelI4Amps->Location = System::Drawing::Point(472, 120);
			this->labelI4Amps->Name = L"labelI4Amps";
			this->labelI4Amps->Size = System::Drawing::Size(25, 13);
			this->labelI4Amps->TabIndex = 19;
			this->labelI4Amps->Text = L"0.0";
			// 
			// labelI4Volts
			// 
			this->labelI4Volts->AutoSize = true;
			this->labelI4Volts->Location = System::Drawing::Point(472, 81);
			this->labelI4Volts->Name = L"labelI4Volts";
			this->labelI4Volts->Size = System::Drawing::Size(25, 13);
			this->labelI4Volts->TabIndex = 18;
			this->labelI4Volts->Text = L"0.0";
			// 
			// labelI3Amps
			// 
			this->labelI3Amps->AutoSize = true;
			this->labelI3Amps->Location = System::Drawing::Point(363, 120);
			this->labelI3Amps->Name = L"labelI3Amps";
			this->labelI3Amps->Size = System::Drawing::Size(25, 13);
			this->labelI3Amps->TabIndex = 17;
			this->labelI3Amps->Text = L"0.0";
			// 
			// labelI3Volts
			// 
			this->labelI3Volts->AutoSize = true;
			this->labelI3Volts->Location = System::Drawing::Point(363, 81);
			this->labelI3Volts->Name = L"labelI3Volts";
			this->labelI3Volts->Size = System::Drawing::Size(25, 13);
			this->labelI3Volts->TabIndex = 16;
			this->labelI3Volts->Text = L"0.0";
			// 
			// label16
			// 
			this->label16->AutoSize = true;
			this->label16->Location = System::Drawing::Point(430, 81);
			this->label16->Name = L"label16";
			this->label16->Size = System::Drawing::Size(18, 13);
			this->label16->TabIndex = 15;
			this->label16->Text = L"I4";
			// 
			// label20
			// 
			this->label20->AutoSize = true;
			this->label20->Location = System::Drawing::Point(324, 81);
			this->label20->Name = L"label20";
			this->label20->Size = System::Drawing::Size(18, 13);
			this->label20->TabIndex = 14;
			this->label20->Text = L"I3";
			// 
			// label22
			// 
			this->label22->AutoSize = true;
			this->label22->Location = System::Drawing::Point(348, 50);
			this->label22->Name = L"label22";
			this->label22->Size = System::Drawing::Size(23, 13);
			this->label22->TabIndex = 13;
			this->label22->Text = L"O2";
			// 
			// textBoxRawI4
			// 
			this->textBoxRawI4->Location = System::Drawing::Point(433, 97);
			this->textBoxRawI4->Name = L"textBoxRawI4";
			this->textBoxRawI4->ReadOnly = true;
			this->textBoxRawI4->Size = System::Drawing::Size(100, 20);
			this->textBoxRawI4->TabIndex = 12;
			this->textBoxRawI4->Text = L"0.0";
			// 
			// textBoxRawI3
			// 
			this->textBoxRawI3->Location = System::Drawing::Point(327, 97);
			this->textBoxRawI3->Name = L"textBoxRawI3";
			this->textBoxRawI3->ReadOnly = true;
			this->textBoxRawI3->Size = System::Drawing::Size(100, 20);
			this->textBoxRawI3->TabIndex = 11;
			this->textBoxRawI3->Text = L"0.0";
			// 
			// numericUpDownO2
			// 
			this->numericUpDownO2->DecimalPlaces = 2;
			this->numericUpDownO2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->numericUpDownO2->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 65536});
			this->numericUpDownO2->Location = System::Drawing::Point(377, 33);
			this->numericUpDownO2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
			this->numericUpDownO2->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, System::Int32::MinValue});
			this->numericUpDownO2->Name = L"numericUpDownO2";
			this->numericUpDownO2->Size = System::Drawing::Size(100, 38);
			this->numericUpDownO2->TabIndex = 10;
			this->numericUpDownO2->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDownO2_ValueChanged);
			// 
			// labelI2Amps
			// 
			this->labelI2Amps->AutoSize = true;
			this->labelI2Amps->Location = System::Drawing::Point(196, 120);
			this->labelI2Amps->Name = L"labelI2Amps";
			this->labelI2Amps->Size = System::Drawing::Size(25, 13);
			this->labelI2Amps->TabIndex = 9;
			this->labelI2Amps->Text = L"0.0";
			// 
			// labelI2Volts
			// 
			this->labelI2Volts->AutoSize = true;
			this->labelI2Volts->Location = System::Drawing::Point(196, 81);
			this->labelI2Volts->Name = L"labelI2Volts";
			this->labelI2Volts->Size = System::Drawing::Size(25, 13);
			this->labelI2Volts->TabIndex = 8;
			this->labelI2Volts->Text = L"0.0";
			// 
			// labelI1Amps
			// 
			this->labelI1Amps->AutoSize = true;
			this->labelI1Amps->Location = System::Drawing::Point(87, 120);
			this->labelI1Amps->Name = L"labelI1Amps";
			this->labelI1Amps->Size = System::Drawing::Size(25, 13);
			this->labelI1Amps->TabIndex = 7;
			this->labelI1Amps->Text = L"0.0";
			// 
			// labelI1Volts
			// 
			this->labelI1Volts->AutoSize = true;
			this->labelI1Volts->Location = System::Drawing::Point(87, 81);
			this->labelI1Volts->Name = L"labelI1Volts";
			this->labelI1Volts->Size = System::Drawing::Size(25, 13);
			this->labelI1Volts->TabIndex = 6;
			this->labelI1Volts->Text = L"0.0";
			// 
			// label11
			// 
			this->label11->AutoSize = true;
			this->label11->Location = System::Drawing::Point(154, 81);
			this->label11->Name = L"label11";
			this->label11->Size = System::Drawing::Size(18, 13);
			this->label11->TabIndex = 5;
			this->label11->Text = L"I2";
			// 
			// label10
			// 
			this->label10->AutoSize = true;
			this->label10->Location = System::Drawing::Point(48, 81);
			this->label10->Name = L"label10";
			this->label10->Size = System::Drawing::Size(18, 13);
			this->label10->TabIndex = 4;
			this->label10->Text = L"I1";
			// 
			// label9
			// 
			this->label9->AutoSize = true;
			this->label9->Location = System::Drawing::Point(73, 50);
			this->label9->Name = L"label9";
			this->label9->Size = System::Drawing::Size(23, 13);
			this->label9->TabIndex = 3;
			this->label9->Text = L"O1";
			// 
			// textBoxRawI2
			// 
			this->textBoxRawI2->Location = System::Drawing::Point(157, 97);
			this->textBoxRawI2->Name = L"textBoxRawI2";
			this->textBoxRawI2->ReadOnly = true;
			this->textBoxRawI2->Size = System::Drawing::Size(100, 20);
			this->textBoxRawI2->TabIndex = 2;
			this->textBoxRawI2->Text = L"0.0";
			// 
			// textBoxRawI1
			// 
			this->textBoxRawI1->Location = System::Drawing::Point(51, 97);
			this->textBoxRawI1->Name = L"textBoxRawI1";
			this->textBoxRawI1->ReadOnly = true;
			this->textBoxRawI1->Size = System::Drawing::Size(100, 20);
			this->textBoxRawI1->TabIndex = 1;
			this->textBoxRawI1->Text = L"0.0";
			// 
			// numericUpDownO1
			// 
			this->numericUpDownO1->DecimalPlaces = 2;
			this->numericUpDownO1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->numericUpDownO1->Increment = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, 65536});
			this->numericUpDownO1->Location = System::Drawing::Point(102, 33);
			this->numericUpDownO1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, 0});
			this->numericUpDownO1->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {10, 0, 0, System::Int32::MinValue});
			this->numericUpDownO1->Name = L"numericUpDownO1";
			this->numericUpDownO1->Size = System::Drawing::Size(100, 38);
			this->numericUpDownO1->TabIndex = 0;
			this->numericUpDownO1->ValueChanged += gcnew System::EventHandler(this, &Form1::numericUpDownO1_ValueChanged);
			// 
			// timer1
			// 
			this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(610, 456);
			this->Controls->Add(this->groupBox4);
			this->Controls->Add(this->groupBox3);
			this->Controls->Add(this->groupBox2);
			this->Controls->Add(this->groupBox1);
			this->Controls->Add(this->buttonOpen);
			this->Controls->Add(this->TextBoxSN);
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
			this->Name = L"Form1";
			this->Text = L"TC/USB-18A Demo Program v1.0 -(c) 2014 3C-Concept S.A.S Visual C++ 2010";
			this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
			this->groupBox3->ResumeLayout(false);
			this->groupBox3->PerformLayout();
			this->groupBox2->ResumeLayout(false);
			this->groupBox2->PerformLayout();
			this->groupBox1->ResumeLayout(false);
			this->groupBox1->PerformLayout();
			this->groupBox4->ResumeLayout(false);
			this->groupBox4->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDownO2))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numericUpDownO1))->EndInit();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion

		bool ModuleOpened;
	public: void actualise(void)
			{
				int i=0,j=0;
				DWORD InputData=0;
				long DataPos=0/*,etat=0*/;
				WORD mask=0x0001;
				short AnalogRawData=0x0000;
				double AnalogValue=0;
				BYTE ctr=0;
				BYTE etat=0;

				//Rafraichissement données du module
				i=TCUSB18A_Refresh(1);
				
				//Lecture entrées TOR
				i=TCUSB18A_Input(1,&InputData);
				if ((mask & InputData)==mask)panelI1->BackColor= Color::Lime;
				else						 panelI1->BackColor= Color::Green;
				mask=mask<<1;
				if ((mask & InputData)==mask)panelI2->BackColor= Color::Lime;
				else						 panelI2->BackColor= Color::Green;
				mask=mask<<1;
				if ((mask & InputData)==mask)panelI3->BackColor= Color::Lime;
				else						 panelI3->BackColor= Color::Green;
				mask=mask<<1;
				if ((mask & InputData)==mask)panelI4->BackColor= Color::Lime;
				else						 panelI4->BackColor= Color::Green;
				mask=mask<<1;
				if ((mask & InputData)==mask)panelI5->BackColor= Color::Lime;
				else						 panelI5->BackColor= Color::Green;
				mask=mask<<1;
				if ((mask & InputData)==mask)panelI6->BackColor= Color::Lime;
				else						 panelI6->BackColor= Color::Green;
				mask=mask<<1;
				if ((mask & InputData)==mask)panelI7->BackColor= Color::Lime;
				else						 panelI7->BackColor= Color::Green;
				mask=mask<<1;
				if ((mask & InputData)==mask)panelI8->BackColor= Color::Lime;
				else						 panelI8->BackColor= Color::Green;
				
				
				//Lecture entrées ABZ
				i=TCUSB18A_BitInput(1,1,&etat);
				if (etat==1)  panelZ->BackColor = Color::Lime;
				else		  panelZ->BackColor = Color::Green;

				i=TCUSB18A_BitInput(1,2,&etat);
				if (etat==1)  panelA->BackColor = Color::Lime;
				else		  panelA->BackColor = Color::Green;

				i=TCUSB18A_BitInput(1,3,&etat);
				if (etat==1)  panelB->BackColor = Color::Lime;
				else		  panelB->BackColor = Color::Green;

				//Lecture compteur de position codeur
				i=TCUSB18A_Pos(1,&DataPos);	
				textBoxDataPos->Text=DataPos.ToString();
				
				//Lecteur des compteurs d'évenement sur les entrées TOR
				i=TCUSB18A_Counter(1,1,&ctr);textBoxCTR1->Text=ctr.ToString();
				i=TCUSB18A_Counter(1,2,&ctr);textBoxCTR2->Text=ctr.ToString();
				i=TCUSB18A_Counter(1,3,&ctr);textBoxCTR3->Text=ctr.ToString();
				i=TCUSB18A_Counter(1,4,&ctr);textBoxCTR4->Text=ctr.ToString();
				i=TCUSB18A_Counter(1,5,&ctr);textBoxCTR5->Text=ctr.ToString();
				i=TCUSB18A_Counter(1,6,&ctr);textBoxCTR6->Text=ctr.ToString();
				i=TCUSB18A_Counter(1,7,&ctr);textBoxCTR7->Text=ctr.ToString();
				i=TCUSB18A_Counter(1,8,&ctr);textBoxCTR8->Text=ctr.ToString();

				//Read Analog Raw value
				i=TCUSB18A_AnaIn(1,1,&AnalogRawData); textBoxRawI1->Text=AnalogRawData.ToString("");
				i=TCUSB18A_AnaIn(1,2,&AnalogRawData); textBoxRawI2->Text=AnalogRawData.ToString("");
				i=TCUSB18A_AnaIn(1,3,&AnalogRawData); textBoxRawI3->Text=AnalogRawData.ToString("");
				i=TCUSB18A_AnaIn(1,4,&AnalogRawData); textBoxRawI4->Text=AnalogRawData.ToString("");

				//Read Analog Amp value
				i=TCUSB18A_AnaInmA(1,1,&AnalogValue); labelI1Amps->Text=AnalogValue.ToString("F2") ;
				i=TCUSB18A_AnaInmA(1,2,&AnalogValue); labelI2Amps->Text=AnalogValue.ToString("F2") ;
				i=TCUSB18A_AnaInmA(1,3,&AnalogValue); labelI3Amps->Text=AnalogValue.ToString("F2") ;
				i=TCUSB18A_AnaInmA(1,4,&AnalogValue); labelI4Amps->Text=AnalogValue.ToString("F2") ;

				//Read Analog Volt value
				i=TCUSB18A_AnaInVolts(1,1,&AnalogValue); labelI1Volts->Text=AnalogValue.ToString("F2");
				i=TCUSB18A_AnaInVolts(1,2,&AnalogValue); labelI2Volts->Text=AnalogValue.ToString("F2");
				i=TCUSB18A_AnaInVolts(1,3,&AnalogValue); labelI3Volts->Text=AnalogValue.ToString("F2");
				i=TCUSB18A_AnaInVolts(1,4,&AnalogValue); labelI4Volts->Text=AnalogValue.ToString("F2");


			}
	private: System::Void buttonOpen_Click(System::Object^  sender, System::EventArgs^  e)
			 {
				int err = 0;
				int i=0;
				DWORD SN=0;
				BYTE Data1=0,Data2=0;

				//ouverture du module
				SN=Convert::ToUInt32(TextBoxSN->Text);
				err=TCUSB18A_OpenN(1,&SN);
						
				if (err==0)
				{
					buttonOpen->Enabled=false;
					ModuleOpened=true;
					labelSN->Text= "SN: "+SN.ToString();
					TextBoxSN->Text=SN.ToString();

					//Actualision des données du module
					err=TCUSB18A_Refresh(1);

					//Lecture du firmware et la version de la dll
					err=TCUSB18A_Version(1,&Data1,&Data2);
					labelFW->Text= "Firmware version: "+Data1.ToString();
					labelDLL->Text="DLL version: "+Data2.ToString();
					timer1->Enabled=true;
				}
				else
				{
					TextBoxSN->Text="Erreur N°"+i.ToString();
					ModuleOpened = false;
					if (err == 1) MessageBox::Show("Numero de serie incorrect");
					if (err == 2) MessageBox::Show("N° de module incorrect");
					if (err == 3) MessageBox::Show("Pas de module TC/USB-18A détecté");
					if (err == 4) MessageBox::Show("Module non initialisé");
					Close();
				}
			 }
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) 
		 {
			actualise();
		 }
private: System::Void Form1_FormClosing(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e) 
		 {
			 int i=0;
			 //Fermeture module
			 if (ModuleOpened)
				i=TCUSB18A_Close(1);
		 }
private: System::Void buttonS1_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 BYTE Etat=0;
			 int i=0;
			 //Lecture de l'etat de la sortie et inversion de sa commande
			 i=TCUSB18A_Refresh(1);
			 i=TCUSB18A_BitReadBack(1,1,&Etat);
			 Etat=~Etat & 0x00000001;
			 TCUSB18A_BitOutput(1,1,Etat);
			 i=TCUSB18A_Refresh(1);
		 }
private: System::Void buttonS2_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 BYTE Etat=0;
			 int i=0;
			 //Lecture de l'etat de la sortie et inversion de sa commande
			 i=TCUSB18A_Refresh(1);
			 i=TCUSB18A_BitReadBack(1,2,&Etat);
			 Etat=~Etat & 0x00000001;
			 TCUSB18A_BitOutput(1,2,Etat);
			 i=TCUSB18A_Refresh(1);
		 }
private: System::Void buttonS3_Click(System::Object^  sender, System::EventArgs^  e)
		 {
			 BYTE Etat=0;
			 int i=0;
			 //Lecture de l'etat de la sortie et inversion de sa commande
			 i=TCUSB18A_Refresh(1);
			 i=TCUSB18A_BitReadBack(1,3,&Etat);
			 Etat=~Etat & 0x00000001;
			 TCUSB18A_BitOutput(1,3,Etat);
			 i=TCUSB18A_Refresh(1);

		 }
private: System::Void buttonS4_Click(System::Object^  sender, System::EventArgs^  e)
		 {
			 BYTE Etat=0;
			 int i=0;
			 //Lecture de l'etat de la sortie et inversion de sa commande
			 i=TCUSB18A_Refresh(1);
			 i=TCUSB18A_BitReadBack(1,4,&Etat);
			 Etat=~Etat & 0x00000001;
			 TCUSB18A_BitOutput(1,4,Etat);
			 i=TCUSB18A_Refresh(1);
		 }
private: System::Void button10_Click(System::Object^  sender, System::EventArgs^  e)
		 {
			 //Raz de la position codeur & actualisation de l'affichage
			 TCUSB18A_ResetPos(1);
			 actualise();
		 }
private: System::Void checkBoxZ_CheckStateChanged(System::Object^  sender, System::EventArgs^  e) 
		 {
			 //configuration du Topz (actif ou non)
			 int i=0;
			 long j=0;
			 
			 if (checkBoxZ->Checked == true)
				TCUSB18A_Config(1,0x08);
			 else
				TCUSB18A_Config(1,0x00);
			 i=TCUSB18A_Refresh(1);
		 }
private: System::Void numericUpDownO1_ValueChanged(System::Object^  sender, System::EventArgs^  e)
		 {
			 int i=0;
			 double Valeur= (double)numericUpDownO1->Value;
			 i=TCUSB18A_AnaOutVolts(1,1,Valeur);
			 i=TCUSB18A_Refresh(1);
		 }
private: System::Void numericUpDownO2_ValueChanged(System::Object^  sender, System::EventArgs^  e)
		 {
			 int i=0;
			 double Valeur= (double)numericUpDownO2->Value;
			 i=TCUSB18A_AnaOutVolts(1,2,Valeur);
			 i=TCUSB18A_Refresh(1);
		 }
private: System::Void checkBoxZ_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
		 }
};
}

