private bool ProcessInitial()
    {
        FailCnt = 0; FinishFlg = false;
        if (Device.ModuleType == "Adam6017")
        {
            Ref_IO_Mod     = new ADAM_IO_Model(Device.ModuleType);
            OutAO_Slot_Idx = 1;
        }
        else
        {
            eLog(this, new LogEventArgs("ADAM_AutoIO_AI_RangeCode.exe", "Module is not support."));
            ProcessStep = "Module is not support.";
            return(false);
        }

        _ref_ai_num    = Ref_IO_Mod.AI_num;
        lenTxtbox.Text = OutAO_Ch_Len = _ref_ai_num.ToString();
        //var rng = RangeLoad();//get AI range code
        //
        if (ChSelIdx > 0)
        {
            Ref_IO_Mod.Ch = ChSelIdx - 1;
        }
        else
        {
            Ref_IO_Mod.Ch = 0;
        }
        //
        VerInit();
        return(true);
    }
示例#2
0
    private bool ProcessInitial()
    {
        FailCnt = 0; FinishFlg = false;
        if (Device.ModuleType == "Adam6050" || Device.ModuleType == "Adam6051" || Device.ModuleType == "Adam6052" ||
            Device.ModuleType == "Adam6060" || Device.ModuleType == "Adam6066" || Device.ModuleType == "Adam6022" ||
            Device.ModuleType == "Adam6024")
        {
            Ref_IO_Mod = new ADAM_IO_Model(Device.ModuleType);
            if (Device.ModuleType == "Adam6050")
            {
                _apaxDIslot_idx = 129;
                _apaxDOslot_idx = 1;
            }
            if (Device.ModuleType == "Adam6051")
            {
                //OutDOcnt_Slot_Idx = 87
                _apaxDIslot_idx = 135;
                _apaxDOslot_idx = 13;
            }
            if (Device.ModuleType == "Adam6060")
            {
                _apaxDIslot_idx = 141;
                _apaxDOslot_idx = 65;
            }
            if (Device.ModuleType == "Adam6066")
            {
                _apaxDIslot_idx = 147;
                _apaxDOslot_idx = 71;
            }
            if (Device.ModuleType == "Adam6052")
            {
                _apaxDIslot_idx = 193;
                _apaxDOslot_idx = 77;
            }
            if (Device.ModuleType == "Adam6022")
            {
                _apaxDIslot_idx = 137;
                _apaxDOslot_idx = 85;
            }
            if (Device.ModuleType == "Adam6024")
            {
                _apaxAIslot_idx = 193; //4x
                _apaxAOslot_idx = 161; //4x
                _apaxDIslot_idx = 139;
                _apaxDOslot_idx = 85;
            }
            if (Device.ModuleType == "Adam6017")
            {
                _apaxAOslot_idx = 129; //4x
                _apaxDIslot_idx = 205;
            }
            if (Device.ModuleType == "Adam6018")
            {
                _apaxDIslot_idx = 207;
            }
            idxTxtbox.Text = _apaxDOslot_idx.ToString();
            lenTxtbox.Text = Device.DiTotal.ToString();
        }
        else
        {
            eLog(this, new LogEventArgs("ADAM_AutoIO_LtoH_Latch.exe", "Module is not support."));
            ProcessStep = "Module is not support.";
            return(false);
        }

        //_ref_ai_num = Ref_IO_Mod.AI_num;
        //lenTxtbox.Text = OutAO_Ch_Len = _ref_ai_num.ToString();
        //var rng = RangeLoad();//get AI range code
        //
        if (ChSelIdx > 0)
        {
            Ref_IO_Mod.Ch = ChSelIdx - 1;
        }
        else
        {
            Ref_IO_Mod.Ch = 0;
        }
        //
        VerInit();
        return(true);
    }
示例#3
0
    private bool ProcessInitial()
    {
        FailCnt = 0; FinishFlg = false;
        if (Device.ModuleType == "Adam6050" || Device.ModuleType == "Adam6051" || Device.ModuleType == "Adam6052" ||
            Device.ModuleType == "Adam6060" || Device.ModuleType == "Adam6066" || Device.ModuleType == "Adam6022" ||
            Device.ModuleType == "Adam6024")
        {
            Ref_IO_Mod = new ADAM_IO_Model(Device.ModuleType);
            //5046 slot 0
            //local test
            //if (Device.ModuleType == "Adam6050") _apaxDOslot_idx = 1;
            if (Device.ModuleType == "Adam6050")
            {
                _apaxDIslot_idx = 129;
                _apaxDOslot_idx = 1;
                CmdStr01        = "$016";    //Read Channel Status when set all false
                ExStr01         = "!01000000";
                CmdStr02        = "$016";    //Read Channel Status when set all true
                ExStr02         = "!01000FFF";
                CmdStr03        = "#01003F"; //Write All ch to true
                CmdStr04        = "#010000"; //Write All ch to false
                //ExStr04 = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6051")
            {
                _apaxDIslot_idx = 135;
                _apaxDOslot_idx = 13;
                CmdStr01        = "$016"; //Read Channel Status when set all false
                ExStr01         = "!01000000";
                CmdStr02        = "$016"; //Read Channel Status when set all true
                ExStr02         = "!0100003F";
                CmdStr03        = "$01F"; //Read Channel Status
                //CmdStr04 = "$01Vd"; //Read GCL Internal
                //ExStr04 = ">010000FFFF\r";
            }
            //5046 slot 1
            if (Device.ModuleType == "Adam6060")
            {
                _apaxDIslot_idx = 141;
                _apaxDOslot_idx = 65;
                CmdStr01        = "$016"; //Read Channel Status when set all false
                ExStr01         = "!01000000";
                CmdStr02        = "$016"; //Read Channel Status when set all true
                ExStr02         = "!0100003F";
                CmdStr03        = "$01F"; //Read Channel Status
                //CmdStr04 = "$01Vd"; //Read GCL Internal
                //ExStr04 = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6066")
            {
                _apaxDIslot_idx = 147;
                _apaxDOslot_idx = 71;
                CmdStr01        = "$016"; //Read Channel Status when set all false
                ExStr01         = "!01000000";
                CmdStr02        = "$016"; //Read Channel Status when set all true
                ExStr02         = "!01000FFF";
                CmdStr03        = "$01F"; //Read Channel Status
                //CmdStr04 = "$01Vd"; //Read GCL Internal
                //ExStr04 = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6052")
            {
                _apaxDIslot_idx = 193;
                _apaxDOslot_idx = 77;
                CmdStr01        = "$016"; //Read Channel Status when set all false
                ExStr01         = "!01000000";
                CmdStr02        = "$016"; //Read Channel Status when set all true
                ExStr02         = "!010000FF";
                CmdStr03        = "$01F"; //Read Channel Status
                //CmdStr04 = "$01Vd"; //Read GCL Internal
                //ExStr04 = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6022")
            {
                _apaxDOslot_idx = 85;
            }
            if (Device.ModuleType == "Adam6024")
            {
                _apaxDOslot_idx = 85;
            }
            if (Device.ModuleType == "Adam6017")
            {
                _apaxDIslot_idx = 205;
            }
            if (Device.ModuleType == "Adam6018")
            {
                _apaxDIslot_idx = 207;
            }
            //if (Device.ModuleType == "Adam6051") OutDOcnt_Slot_Idx = 87
            idxTxtbox.Text = _apaxDOslot_idx.ToString();
            lenTxtbox.Text = Device.DiTotal.ToString();
        }
        else
        {
            eLog(this, new LogEventArgs("ADAM_AutoIO_Di_Value.exe", "Module is not support."));
            ProcessStep = "Module is not support.";
            return(false);
        }

        _ref_ai_num = Ref_IO_Mod.AI_num;
        //lenTxtbox.Text = OutAO_Ch_Len = _ref_ai_num.ToString();
        //var rng = RangeLoad();//get AI range code
        //
        if (ChSelIdx > 0)
        {
            Ref_IO_Mod.Ch = ChSelIdx - 1;
        }
        else
        {
            Ref_IO_Mod.Ch = 0;
        }
        //
        VerInit();
        return(true);
    }
示例#4
0
    private bool ProcessInitial()
    {
        FailCnt = 0; FinishFlg = false;
        if (Device.ModuleType == "Adam6050" || Device.ModuleType == "Adam6051" || Device.ModuleType == "Adam6052" ||
            Device.ModuleType == "Adam6060" || Device.ModuleType == "Adam6066" || Device.ModuleType == "Adam6022" ||
            Device.ModuleType == "Adam6024")
        {
            Ref_IO_Mod = new ADAM_IO_Model(Device.ModuleType);
            //5046 slot 0
            //local test
            //if (Device.ModuleType == "Adam6050") _apaxDOslot_idx = 1;
            if (Device.ModuleType == "Adam6050")
            {
                _apaxDOslot_idx = 1;
                CmdStr01        = "$01M";              //Read Module Name
                ExStr01         = "!016050\r";
                CmdStr02        = "$01F";              //Read Firmware Version
                CmdStr03        = "#01Vd00000000FFFF"; //Write all Values to GCL Internal Flags
                CmdStr04        = "$01Vd";             //Read GCL Internal
                ExStr04         = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6051")
            {
                _apaxDOslot_idx = 13;
                CmdStr01        = "$01M";              //Read Module Name
                ExStr01         = "!016051\r";
                CmdStr02        = "$01F";              //Read Firmware Version
                CmdStr03        = "#01Vd00000000FFFF"; //Write all Values to GCL Internal Flags
                CmdStr04        = "$01Vd";             //Read GCL Internal
                ExStr04         = ">010000FFFF\r";
            }
            //5046 slot 1
            if (Device.ModuleType == "Adam6060")
            {
                _apaxDOslot_idx = 65;
                CmdStr01        = "$01M";              //Read Module Name
                ExStr01         = "!016060\r";
                CmdStr02        = "$01F";              //Read Firmware Version
                CmdStr03        = "#01Vd00000000FFFF"; //Write all Values to GCL Internal Flags
                CmdStr04        = "$01Vd";             //Read GCL Internal
                ExStr04         = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6066")
            {
                _apaxDOslot_idx = 71;
                CmdStr01        = "$01M";              //Read Module Name
                ExStr01         = "!016066\r";
                CmdStr02        = "$01F";              //Read Firmware Version
                CmdStr03        = "#01Vd00000000FFFF"; //Write all Values to GCL Internal Flags
                CmdStr04        = "$01Vd";             //Read GCL Internal
                ExStr04         = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6052")
            {
                _apaxDOslot_idx = 77;
                CmdStr01        = "$01M";              //Read Module Name
                ExStr01         = "!016052\r";
                CmdStr02        = "$01F";              //Read Firmware Version
                CmdStr03        = "#01Vd00000000FFFF"; //Write all Values to GCL Internal Flags
                CmdStr04        = "$01Vd";             //Read GCL Internal
                ExStr04         = ">010000FFFF\r";
            }
            if (Device.ModuleType == "Adam6022")
            {
                _apaxDOslot_idx = 85;
            }
            if (Device.ModuleType == "Adam6024")
            {
                _apaxDOslot_idx = 85;
            }
            if (Device.ModuleType == "Adam6017")
            {
                _apaxDIslot_idx = 205;
            }
            if (Device.ModuleType == "Adam6018")
            {
                _apaxDIslot_idx = 207;
            }
            idxTxtbox.Text = _apaxDOslot_idx.ToString();
            lenTxtbox.Text = Device.DiTotal.ToString();
        }
        else
        {
            eLog(this, new LogEventArgs("ADAM_AutoIO_SystemCmdSet.exe", "Module is not support."));
            ProcessStep = "Module is not support.";
            return(false);
        }

        _ref_ai_num = Ref_IO_Mod.AI_num;
        //lenTxtbox.Text = OutAO_Ch_Len = _ref_ai_num.ToString();
        //var rng = RangeLoad();//get AI range code
        //
        if (ChSelIdx > 0)
        {
            Ref_IO_Mod.Ch = ChSelIdx - 1;
        }
        else
        {
            Ref_IO_Mod.Ch = 0;
        }
        //
        VerInit();
        return(true);
    }