//***********************************************************************/
//*                                                                     */
//*     ＩＦ＿５０ＡＰＩ用サンプルプログラム                            */
//*                                                                     */
//*      Copyright(c) 2012  TEXIO TECHNOLOGY CORPORATION                */
//***********************************************************************/
#pragma once

#include "IF_50_m.h"

namespace LW_Access {

	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>
	/// LW_Access の概要
	///
	/// 警告: このクラスの名前を変更する場合、このクラスが依存するすべての .resx ファイルに関連付けられた
	///          マネージ リソース コンパイラ ツールに対して 'Resource File Name' プロパティを
	///          変更する必要があります。この変更を行わないと、
	///          デザイナと、このフォームに関連付けられたローカライズ済みリソースとが、
	///          正しく相互に利用できなくなります。
	/// </summary>
	public ref class LW_Access : public System::Windows::Forms::Form
	{
	public:
		LW_Access(void)
		{
			InitializeComponent();
			//
			//TODO: ここにコンストラクタ コードを追加します
			//
		}

	protected:
		/// <summary>
		/// 使用中のリソースをすべてクリーンアップします。
		/// </summary>
		~LW_Access()
		{
			if (components)
			{
				delete components;
			}
		}
	internal: System::Windows::Forms::TextBox^  TextBox1;
	protected: 
	internal: System::Windows::Forms::GroupBox^  GroupBox1;
	internal: System::Windows::Forms::Label^  Label8;
	internal: System::Windows::Forms::ComboBox^  ComboBox3;
	internal: System::Windows::Forms::ComboBox^  ComboBox2;
	internal: System::Windows::Forms::Label^  Label3;
	internal: System::Windows::Forms::ComboBox^  ComboBox1;
	internal: System::Windows::Forms::Label^  Label1;
	internal: System::Windows::Forms::Label^  Label5;
	internal: System::Windows::Forms::Label^  Label2;
	internal: System::Windows::Forms::Button^  Button1;
	internal: System::Windows::Forms::Button^  Button7;
	internal: System::Windows::Forms::GroupBox^  GroupBox3;
	internal: System::Windows::Forms::Button^  Button5;
	internal: System::Windows::Forms::Button^  Button4;
	internal: System::Windows::Forms::Button^  Button3;
	internal: System::Windows::Forms::Button^  Button6;
	internal: System::Windows::Forms::Button^  Button2;
	internal: System::Windows::Forms::GroupBox^  GroupBox2;

	private:
		/// <summary>
		/// 必要なデザイナ変数です。
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
		/// コード エディタで変更しないでください。
		/// </summary>
		void InitializeComponent(void)
		{
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(LW_Access::typeid));
			this->TextBox1 = (gcnew System::Windows::Forms::TextBox());
			this->GroupBox1 = (gcnew System::Windows::Forms::GroupBox());
			this->Label8 = (gcnew System::Windows::Forms::Label());
			this->ComboBox3 = (gcnew System::Windows::Forms::ComboBox());
			this->ComboBox2 = (gcnew System::Windows::Forms::ComboBox());
			this->Label3 = (gcnew System::Windows::Forms::Label());
			this->ComboBox1 = (gcnew System::Windows::Forms::ComboBox());
			this->Label1 = (gcnew System::Windows::Forms::Label());
			this->Label5 = (gcnew System::Windows::Forms::Label());
			this->Label2 = (gcnew System::Windows::Forms::Label());
			this->Button1 = (gcnew System::Windows::Forms::Button());
			this->Button7 = (gcnew System::Windows::Forms::Button());
			this->GroupBox3 = (gcnew System::Windows::Forms::GroupBox());
			this->Button5 = (gcnew System::Windows::Forms::Button());
			this->Button4 = (gcnew System::Windows::Forms::Button());
			this->Button3 = (gcnew System::Windows::Forms::Button());
			this->Button6 = (gcnew System::Windows::Forms::Button());
			this->Button2 = (gcnew System::Windows::Forms::Button());
			this->GroupBox2 = (gcnew System::Windows::Forms::GroupBox());
			this->GroupBox1->SuspendLayout();
			this->GroupBox3->SuspendLayout();
			this->SuspendLayout();
			// 
			// TextBox1
			// 
			this->TextBox1->Location = System::Drawing::Point(98, 137);
			this->TextBox1->Multiline = true;
			this->TextBox1->Name = L"TextBox1";
			this->TextBox1->Size = System::Drawing::Size(232, 56);
			this->TextBox1->TabIndex = 35;
			// 
			// GroupBox1
			// 
			this->GroupBox1->Controls->Add(this->Label8);
			this->GroupBox1->Controls->Add(this->ComboBox3);
			this->GroupBox1->Controls->Add(this->ComboBox2);
			this->GroupBox1->Controls->Add(this->Label3);
			this->GroupBox1->Controls->Add(this->ComboBox1);
			this->GroupBox1->Controls->Add(this->Label1);
			this->GroupBox1->Controls->Add(this->Label5);
			this->GroupBox1->Controls->Add(this->Label2);
			this->GroupBox1->Controls->Add(this->Button1);
			this->GroupBox1->Location = System::Drawing::Point(2, 3);
			this->GroupBox1->Name = L"GroupBox1";
			this->GroupBox1->Size = System::Drawing::Size(328, 64);
			this->GroupBox1->TabIndex = 32;
			this->GroupBox1->TabStop = false;
			this->GroupBox1->Text = L" Device ";
			// 
			// Label8
			// 
			this->Label8->Font = (gcnew System::Drawing::Font(L"Arial", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->Label8->Location = System::Drawing::Point(245, 15);
			this->Label8->Name = L"Label8";
			this->Label8->Size = System::Drawing::Size(72, 16);
			this->Label8->TabIndex = 24;
			this->Label8->Text = L"SYS ADDR";
			// 
			// ComboBox3
			// 
			this->ComboBox3->Location = System::Drawing::Point(248, 32);
			this->ComboBox3->Name = L"ComboBox3";
			this->ComboBox3->Size = System::Drawing::Size(64, 20);
			this->ComboBox3->TabIndex = 19;
			this->ComboBox3->Text = L"1";
			// 
			// ComboBox2
			// 
			this->ComboBox2->Location = System::Drawing::Point(173, 31);
			this->ComboBox2->Name = L"ComboBox2";
			this->ComboBox2->Size = System::Drawing::Size(64, 20);
			this->ComboBox2->TabIndex = 32;
			this->ComboBox2->Text = L"1";
			// 
			// Label3
			// 
			this->Label3->Font = (gcnew System::Drawing::Font(L"Arial", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->Label3->Location = System::Drawing::Point(173, 15);
			this->Label3->Name = L"Label3";
			this->Label3->Size = System::Drawing::Size(64, 16);
			this->Label3->TabIndex = 23;
			this->Label3->Text = L"PC ADDR";
			// 
			// ComboBox1
			// 
			this->ComboBox1->Location = System::Drawing::Point(85, 31);
			this->ComboBox1->Name = L"ComboBox1";
			this->ComboBox1->Size = System::Drawing::Size(80, 20);
			this->ComboBox1->TabIndex = 31;
			this->ComboBox1->Text = L"USB";
			// 
			// Label1
			// 
			this->Label1->Font = (gcnew System::Drawing::Font(L"Arial", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->Label1->Location = System::Drawing::Point(165, 31);
			this->Label1->Name = L"Label1";
			this->Label1->Size = System::Drawing::Size(8, 16);
			this->Label1->TabIndex = 21;
			this->Label1->Text = L":";
			// 
			// Label5
			// 
			this->Label5->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->Label5->Location = System::Drawing::Point(237, 31);
			this->Label5->Name = L"Label5";
			this->Label5->Size = System::Drawing::Size(8, 16);
			this->Label5->TabIndex = 22;
			this->Label5->Text = L":";
			// 
			// Label2
			// 
			this->Label2->Font = (gcnew System::Drawing::Font(L"Arial", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->Label2->Location = System::Drawing::Point(85, 15);
			this->Label2->Name = L"Label2";
			this->Label2->Size = System::Drawing::Size(72, 16);
			this->Label2->TabIndex = 33;
			this->Label2->Text = L"Interface";
			// 
			// Button1
			// 
			this->Button1->Location = System::Drawing::Point(13, 31);
			this->Button1->Name = L"Button1";
			this->Button1->Size = System::Drawing::Size(56, 24);
			this->Button1->TabIndex = 20;
			this->Button1->Text = L"OPEN";
			this->Button1->Click += gcnew System::EventHandler(this, &LW_Access::Button1_Click);
			// 
			// Button7
			// 
			this->Button7->Enabled = false;
			this->Button7->Location = System::Drawing::Point(18, 145);
			this->Button7->Name = L"Button7";
			this->Button7->Size = System::Drawing::Size(56, 24);
			this->Button7->TabIndex = 36;
			this->Button7->Text = L"READ";
			this->Button7->Click += gcnew System::EventHandler(this, &LW_Access::Button7_Click);
			// 
			// GroupBox3
			// 
			this->GroupBox3->Controls->Add(this->Button5);
			this->GroupBox3->Controls->Add(this->Button4);
			this->GroupBox3->Controls->Add(this->Button3);
			this->GroupBox3->Controls->Add(this->Button6);
			this->GroupBox3->Location = System::Drawing::Point(98, 73);
			this->GroupBox3->Name = L"GroupBox3";
			this->GroupBox3->Size = System::Drawing::Size(232, 48);
			this->GroupBox3->TabIndex = 34;
			this->GroupBox3->TabStop = false;
			this->GroupBox3->Text = L"  Preset     ";
			// 
			// Button5
			// 
			this->Button5->Enabled = false;
			this->Button5->Location = System::Drawing::Point(120, 16);
			this->Button5->Name = L"Button5";
			this->Button5->Size = System::Drawing::Size(48, 24);
			this->Button5->TabIndex = 18;
			this->Button5->Text = L"3";
			this->Button5->Click += gcnew System::EventHandler(this, &LW_Access::Button5_Click);
			// 
			// Button4
			// 
			this->Button4->Enabled = false;
			this->Button4->Location = System::Drawing::Point(64, 16);
			this->Button4->Name = L"Button4";
			this->Button4->Size = System::Drawing::Size(48, 24);
			this->Button4->TabIndex = 17;
			this->Button4->Text = L"2";
			this->Button4->Click += gcnew System::EventHandler(this, &LW_Access::Button4_Click);
			// 
			// Button3
			// 
			this->Button3->Enabled = false;
			this->Button3->Location = System::Drawing::Point(8, 16);
			this->Button3->Name = L"Button3";
			this->Button3->Size = System::Drawing::Size(48, 24);
			this->Button3->TabIndex = 16;
			this->Button3->Text = L"1";
			this->Button3->Click += gcnew System::EventHandler(this, &LW_Access::Button3_Click);
			// 
			// Button6
			// 
			this->Button6->Enabled = false;
			this->Button6->Location = System::Drawing::Point(176, 16);
			this->Button6->Name = L"Button6";
			this->Button6->Size = System::Drawing::Size(48, 24);
			this->Button6->TabIndex = 12;
			this->Button6->Text = L"4";
			this->Button6->Click += gcnew System::EventHandler(this, &LW_Access::Button6_Click);
			// 
			// Button2
			// 
			this->Button2->BackColor = System::Drawing::SystemColors::Control;
			this->Button2->Enabled = false;
			this->Button2->Location = System::Drawing::Point(18, 89);
			this->Button2->Name = L"Button2";
			this->Button2->Size = System::Drawing::Size(56, 24);
			this->Button2->TabIndex = 31;
			this->Button2->Text = L"ON";
			this->Button2->UseVisualStyleBackColor = false;
			this->Button2->Click += gcnew System::EventHandler(this, &LW_Access::Button2_Click);
			// 
			// GroupBox2
			// 
			this->GroupBox2->Location = System::Drawing::Point(2, 73);
			this->GroupBox2->Name = L"GroupBox2";
			this->GroupBox2->Size = System::Drawing::Size(88, 48);
			this->GroupBox2->TabIndex = 33;
			this->GroupBox2->TabStop = false;
			this->GroupBox2->Text = L" Input  ";
			// 
			// LW_Access
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(333, 198);
			this->Controls->Add(this->TextBox1);
			this->Controls->Add(this->GroupBox1);
			this->Controls->Add(this->Button7);
			this->Controls->Add(this->GroupBox3);
			this->Controls->Add(this->Button2);
			this->Controls->Add(this->GroupBox2);
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
			this->Name = L"LW_Access";
			this->Text = L"LW_Access";
			this->Load += gcnew System::EventHandler(this, &LW_Access::LW_Access_Load);
			this->GroupBox1->ResumeLayout(false);
			this->GroupBox3->ResumeLayout(false);
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	
	public: int DeviceId;

	// ロード
	private: System::Void LW_Access_Load(System::Object^  sender, System::EventArgs^  e)
	{
        int index;

		// USB GP-IB(ボード0,1)を選択可能にする。
		ComboBox1->Items->Add("USB");
        ComboBox1->Items->Add("GPIB0");
        ComboBox1->Items->Add("GPIB1");

        for (index = 1; index < 30; index++)
        {
            ComboBox2->Items->Add(index.ToString());
            ComboBox3->Items->Add(index.ToString());
        }
	}

	// Open/Close
	private: System::Void Button1_Click(System::Object^  sender, System::EventArgs^  e)
	{
        int IF_Name = 0;
        int BDADDR = 0;
        int PCADDR = 0;
        int SYSADDR = 0;

        if(Button1->Text == "OPEN")       //device OPEN
        {
            if(ComboBox1->Text == "USB")
            {
                IF_Name = 2;
                BDADDR = 0;
            }
            else if(ComboBox1->Text == "GPIB0")
            {
                IF_Name = 1;
                BDADDR = 0;
            }
            else if(ComboBox1->Text == "GPIB1")
            {
                IF_Name = 1;
                BDADDR = 1;
            }

			PCADDR = Int32::Parse(ComboBox2->Text);
			SYSADDR = Int32::Parse(ComboBox3->Text);

			// デバイスオープン
			DeviceId = IF_60::LW_DeviceOpen(IF_Name, BDADDR, PCADDR, SYSADDR);
            if(DeviceId > 0)
            {
				// メインインプット OFF
                IF_60::LW_SetMainInput(DeviceId, 0);

				// Ch-A インプット ON
                IF_60::LW_SetInputSelect(DeviceId, 1, 1);

				// Ch-Aをディスプレイに表示
                IF_60::LW_SetDisplaySelect(DeviceId, 1);

				// 画面表示
                Button1->Text = "CLOSE";
                Button2->Enabled = true;
                Button2->Text = "ON";
                Button3->Enabled = true;
                Button4->Enabled = true;
                Button5->Enabled = true;
                Button6->Enabled = true;
                Button7->Enabled = true;
                TextBox1->Text = "";
            }
            else
            {
                TextBox1->Text = " Device Open ERR";
            }
        }
        else                                //device close
        {
			// メインインプット OFF
            IF_60::LW_SetMainInput(DeviceId, 0);

			// ローカル設定に戻す
            IF_60::LW_SetLocal(DeviceId);

			// デバイスクローズ
            IF_60::LW_DeviceClose(DeviceId);

			// 画面表示
            Button2->Text = "ON";
			Button2->BackColor = System::Drawing::SystemColors::Control;
            Button1->Text = "OPEN";
            Button2->Enabled = false;
            Button3->Enabled = false;
            Button4->Enabled = false;
            Button5->Enabled = false;
            Button6->Enabled = false;
            Button7->Enabled = false;
            TextBox1->Text = "";
        }
	}

    // Main Input
	private: System::Void Button2_Click(System::Object^  sender, System::EventArgs^  e)
	{
        if(Button2->Text == "ON")
        {
			// メインインプット ON
            IF_60::LW_SetMainInput(DeviceId, 1);

            Button2->Text = "OFF";
			Button2->BackColor = System::Drawing::Color::Red;
        }
        else
        {
			// メインインプット OFF
            IF_60::LW_SetMainInput(DeviceId, 0);

            Button2->Text = "ON";
			Button2->BackColor = System::Drawing::SystemColors::Control;
        }
	}

	// Preset 1
	private: System::Void Button3_Click(System::Object^  sender, System::EventArgs^  e)
	{
		IF_60::LW_SetPresetNumber(DeviceId, 1);
	}

	// Preset 2
	private: System::Void Button4_Click(System::Object^  sender, System::EventArgs^  e)
	{
		IF_60::LW_SetPresetNumber(DeviceId, 2);
	}

	// Preset 3
	private: System::Void Button5_Click(System::Object^  sender, System::EventArgs^  e)
	{
		IF_60::LW_SetPresetNumber(DeviceId, 3);
	}

	// Preset 4
	private: System::Void Button6_Click(System::Object^  sender, System::EventArgs^  e)
	{
		IF_60::LW_SetPresetNumber(DeviceId, 4);
	}

	// READ
	private: System::Void Button7_Click(System::Object^  sender, System::EventArgs^  e)
	{
        IF_60::MONITOR_DATA Monitor;

		Button7->Enabled = false;
		{
			// モニタリード
			IF_60::LW_GetMonitor(DeviceId, 1, Monitor);

			// 入力電流値、入力電圧値、入力電力値を画面表示
			StringBuilder^ sb = gcnew StringBuilder();
			sb->Append("V : ");
			sb->Append(Monitor.Voltage.ToString("#00.000"));
			sb->AppendLine(" V");
			sb->Append("C : ");
			sb->Append(Monitor.Current.ToString("#00.000"));
			sb->AppendLine(" A");
			sb->Append("P : ");
			sb->Append(Monitor.Wattage.ToString("#00.000"));
			sb->AppendLine(" W");
			TextBox1->Text = sb->ToString();
			System::Windows::Forms::Application::DoEvents();
			System::Threading::Thread::Sleep(50);
		}
		Button7->Enabled = true;
	}

	// 各APIサンプル
	private: void API_test()
    {
        double Data;
        int LData;
        int IData;
        int res;
        IF_60::MONITOR_DATA Monitor;
        IF_60::MODE_DATA ModeData;
        IF_60::TIME_DATA Time;
        IF_60::TRACK_DATA Track;
        IF_60::ALARM_DATA Alarm;
        IF_60::LIMIT_DATA Limit;
        IF_60::CH_DATA ChData; 


        res = IF_60::LW_DeviceRefresh(DeviceId);
        res = IF_60::LW_SetTimeOut(DeviceId, 1);
        res = IF_60::LW_SetMainInput(DeviceId, IF_60::XON);
        res = IF_60::LW_GetMainInput(DeviceId);
        res = IF_60::LW_SetInputSelect(DeviceId, IF_60::Ch_A, IF_60::XON);
        res = IF_60::LW_GetInputSelect(DeviceId, IF_60::Ch_A);
        res = IF_60::LW_SetPresetNumber(DeviceId, IF_60::PR_1);
        res = IF_60::LW_GetPresetNumber(DeviceId);
        res = IF_60::LW_SavePreset(DeviceId, IF_60::PR_1, IF_60::PR_2);
        res = IF_60::LW_GetMonitor(DeviceId, IF_60::Ch_A, Monitor);
        res = IF_60::LW_SetMonitorSelect(DeviceId, IF_60::WATT);
        res = IF_60::LW_GetMonitorSelect(DeviceId);
        res = IF_60::LW_SetDisplaySelect(DeviceId, IF_60::Ch_A);
        res = IF_60::LW_GetDisplaySelect(DeviceId);
        res = IF_60::LW_SetLoadMode(DeviceId, IF_60::PR_1, IF_60::Ch_A, IF_60::M_CCL, IF_60::REF_IN);
        res = IF_60::LW_GetLoadMode(DeviceId, IF_60::PR_1, IF_60::Ch_A, ModeData);
        res = IF_60::LW_SetLoadValue(DeviceId, IF_60::PR_1, IF_60::Ch_A, 1.1);
        res = IF_60::LW_GetLoadValue(DeviceId, IF_60::PR_1, IF_60::Ch_A, Data);

		res = IF_60::LW_SetMainInput(DeviceId, IF_60::XOFF);
        res = IF_60::LW_SetInputSelect(DeviceId, IF_60::Ch_A, IF_60::XOFF);
		res = IF_60::LW_SetLoadMode(DeviceId, IF_60::PR_1, IF_60::Ch_A, IF_60::M_CRH, IF_60::REF_IN);
		res = IF_60::LW_SetSiemensValue(DeviceId, IF_60::PR_1, IF_60::Ch_A, 30000);
        res = IF_60::LW_GetSiemensValue(DeviceId, IF_60::PR_1, IF_60::Ch_A, LData);
        res = IF_60::LW_SetCurrentLimit(DeviceId, IF_60::PR_1, IF_60::Ch_A, 1.2);
        res = IF_60::LW_GetCurrentLimit(DeviceId, IF_60::PR_1, IF_60::Ch_A, Data);
        res = IF_60::LW_SetLoadMode(DeviceId, IF_60::PR_1, IF_60::Ch_A, IF_60::M_CCL, IF_60::REF_IN);
		res = IF_60::LW_SetMainInput(DeviceId, IF_60::XON);
        res = IF_60::LW_SetInputSelect(DeviceId, IF_60::Ch_A, IF_60::XON);
		
		res = IF_60::LW_SaveLoadValue(DeviceId, IF_60::PR_1, IF_60::Ch_A);
        res = IF_60::LW_SaveCurrentLimit(DeviceId, IF_60::PR_1, IF_60::Ch_A);
        res = IF_60::LW_SaveMemoryData(DeviceId, IF_60::OBJ_TAB);
        res = IF_60::LW_SetSwSelect(DeviceId, IF_60::Ch_A, IF_60::XOFF);
        res = IF_60::LW_GetSwSelect(DeviceId, IF_60::Ch_A);
        res = IF_60::LW_SetSwFreq(DeviceId, 100);
        res = IF_60::LW_GetSwFreq(DeviceId, IData);
        res = IF_60::LW_SetSwDuty(DeviceId, 56);
        res = IF_60::LW_GetSwDuty(DeviceId, IData);
        res = IF_60::LW_SetSwTime(DeviceId, 400.1, 300.1);
        res = IF_60::LW_GetSwTime(DeviceId, Time);
        res = IF_60::LW_SetSwMethod(DeviceId, IF_60::SW_FREQ);
        res = IF_60::LW_GetSwMethod(DeviceId);
        res = IF_60::LW_SetDelayFunction(DeviceId, IF_60::XOFF);
        res = IF_60::LW_GetDelayFunction(DeviceId);
        res = IF_60::LW_SetDelayTime(DeviceId, IF_60::Ch_A, 2.1);
        res = IF_60::LW_GetDelayTime(DeviceId, IF_60::Ch_A, Data);
        res = IF_60::LW_SetTrackFunction(DeviceId, IF_60::XOFF);
        res = IF_60::LW_GetTrackFunction(DeviceId);
        res = IF_60::LW_SetTrackDirection(DeviceId, IF_60::TRC_PLUS, IF_60::TRC_MINUS, IF_60::TRC_NO, IF_60::TRC_NO);
        res = IF_60::LW_GetTrackDirection(DeviceId, Track);
        res = IF_60::LW_SetTrackMode(DeviceId, IF_60::TRC_PERCENT);
        res = IF_60::LW_GetTrackMode(DeviceId);
        res = IF_60::LW_SetTrackValue(DeviceId, 110.0);
        res = IF_60::LW_GetTrackValue(DeviceId, Data);
        res = IF_60::LW_ResetAlarm(DeviceId);
        res = IF_60::LW_GetAlarm(DeviceId, Alarm);
        res = IF_60::LW_GetLimit(DeviceId, Limit);
        res = IF_60::LW_SetOperationTimeOut(DeviceId, 5);
        res = IF_60::LW_GetOperationTimeOut(DeviceId);
        res = IF_60::LW_SetLocalLockOut(DeviceId, IF_60::LOCK_FREE);
        res = IF_60::LW_GetLocalLockOut(DeviceId);
        res = IF_60::LW_GetIdNumber(DeviceId);
        res = IF_60::LW_GetChExist(DeviceId, ChData);

        res = IF_60::LW_SetMainInput(DeviceId, IF_60::XOFF);
        res = IF_60::LW_SetLocal(DeviceId);

    }
};
}

