Exemplo n.º 1
0
 /// <summary>
 /// Get Channel information "Range" column
 /// </summary>
 /// <returns></returns>
 private bool RefreshRanges()
 {
     try
     {
         int iChannelTotal = this.m_aConf.HwIoTotal[m_tmpidx];
         if (m_adamCtl.Configuration().GetModuleConfig(m_idxID, out m_aConf))
         {
             m_usRanges = m_aConf.wChRange;
             m_uiChMask = m_aConf.dwChMask;
             for (int i = 0; i < this.m_bChMask.Length; i++)
             {
                 m_bChMask[i] = ((m_uiChMask & (0x01 << i)) > 0);
             }
             for (int i = 0; i < iChannelTotal; i++)
             {
                 listViewChInfo.Items[i].SubItems[4].Text = AnalogInput.GetRangeName(m_usRanges[i]).ToString();
             }
         }
         else
         {
             StatusBar_IO.Text += "GetModuleConfig(Error:" + m_adamCtl.Configuration().ApiLastError.ToString() + ") Failed! ";
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// When user select specific item of channel information, you should update channel range
 /// </summary>
 /// <param name="idxSel"></param>
 private void LvChInfo_SelectedIndexChanged(int idxSel)
 {
     this.cbxRange.SelectedIndex = GetChannelRangeIdx(AnalogInput.GetRangeName(m_usRanges[idxSel]));
     this.btnMaskEnable.Enabled  = true;
     this.btnMaskDisable.Enabled = true;
     if ((m_usRanges[idxSel] <= (ushort)ApaxUnknown_InputRange.Btype_200To1820C && m_usRanges[idxSel] >= (ushort)ApaxUnknown_InputRange.Jtype_Neg210To1200C) ||  //0x0401~0x04C1
         (m_usRanges[idxSel] <= (ushort)ApaxUnknown_InputRange.Ni518_0To100 && m_usRanges[idxSel] >= (ushort)ApaxUnknown_InputRange.Pt100_3851_Neg200To850))     //0x0200~0x0321
     {
         this.chkBurnoutFcn.Enabled = true;
         this.btnBurnoutFcn.Enabled = true;
     }
     else
     {
         this.chkBurnoutFcn.Enabled = false;
         this.btnBurnoutFcn.Enabled = false;
     }
     //refresh burnout mask
     if (((m_uiBurnoutMask >> idxSel) & 0x1) > 0)
     {
         chkBurnoutFcn.Checked = true;
     }
     else
     {
         chkBurnoutFcn.Checked = false;
     }
 }
Exemplo n.º 3
0
        private void btnSetSafetyValue_Click(object sender, EventArgs e)
        {
            if (!CheckControllable())
            {
                return;
            }

            timer1.Enabled = false;
            int iChannelTotal = this.m_aConf.HwIoTotal[m_tmpidx];

            float[] fAOSafetyVals = new float[iChannelTotal];

            for (int i = 0; i < iChannelTotal; i++)
            {
                fAOSafetyVals[i] = AnalogOutput.GetScaledValue(m_usRanges[i], m_usAOSafetyVals[i]);
            }

            string[] szRanges = new string[iChannelTotal];

            for (int idx = 0; idx < szRanges.Length; idx++)
            {
                szRanges[idx] = AnalogInput.GetRangeName(m_usRanges[idx]);
            }

            FormSafetySetting formSafety = new FormSafetySetting(iChannelTotal, fAOSafetyVals, szRanges);

            formSafety.ApplySafetyValueClick += new FormSafetySetting.EventHandler_ApplySafetyValueClick(formSafety_ApplySafetyValueClick);

            formSafety.ShowDialog();
            formSafety.Dispose();
            formSafety = null;

            timer1.Enabled = true;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Get Channel information "Range" column
 /// </summary>
 /// <returns></returns>
 private bool RefreshRanges()
 {
     try
     {
         int iChannelTotal = this.m_aConf.HwIoTotal[m_tmpidx];
         if (m_adamSocket.Configuration().GetModuleConfig(m_idxID, out m_aConf))
         {
             m_adamSocket.Configuration().GetModuleCurrentRange(Convert.ToInt32(m_idxID), m_aConf);
             m_usRanges = m_aConf.wChRange;
             m_adamSocket.Configuration().GetModuleCurrentChMsk(Convert.ToInt32(m_idxID), m_aConf);
             m_uiChMask = m_aConf.dwChMask;
             for (int i = 0; i < this.m_bChMask.Length; i++)
             {
                 m_bChMask[i] = ((m_uiChMask & (0x01 << i)) > 0);
             }
             for (int i = 0; i < iChannelTotal; i++)
             {
                 listViewChInfo.Items[i].SubItems[5].Text = AnalogInput.GetRangeName(m_usRanges[i]).ToString();
             }
         }
         else
             StatusBar_IO.Text += "GetModuleConfig(Error:" + m_adamSocket.Modbus().LastError.ToString() + ") Failed! ";
         return true;
     }
     catch
     {
         return false;
     }
 }
Exemplo n.º 5
0
        private void RefreshAdam5000Information()
        {
            int  iIdx;
            byte byCode;

            Adam5000Type adamType;

            adamType = (Adam5000Type)cbxModuleType.SelectedItem;
            // AI information
            txtAITotal.Text = AnalogInput.GetChannelTotal(adamType).ToString();
            listViewAI.Items.Clear();
            for (iIdx = 0; iIdx < AnalogInput.GetRangeTotal(adamType); iIdx++)
            {
                byCode = AnalogInput.GetRangeCode(adamType, iIdx);
                listViewAI.Items.Add(new ListViewItem("0x" + byCode.ToString("X02")));           // range code
                listViewAI.Items[iIdx].SubItems.Add(AnalogInput.GetRangeName(adamType, byCode)); // range name
                listViewAI.Items[iIdx].SubItems.Add(AnalogInput.GetUnitName(adamType, byCode));  // range name
            }
            // AO information
            txtAOTotal.Text = AnalogOutput.GetChannelTotal(adamType).ToString();
            listViewAO.Items.Clear();
            for (iIdx = 0; iIdx < AnalogOutput.GetRangeTotal(adamType); iIdx++)
            {
                byCode = AnalogOutput.GetRangeCode(adamType, iIdx);
                listViewAO.Items.Add(new ListViewItem("0x" + byCode.ToString("X02")));                  // range code
                listViewAO.Items[iIdx].SubItems.Add(AnalogOutput.GetRangeName(adamType, byCode));       // range name
                listViewAO.Items[iIdx].SubItems.Add(AnalogOutput.GetUnitName(adamType, byCode));        // range name
            }
            // DIO
            txtDITotal.Text = DigitalInput.GetChannelTotal(adamType).ToString();
            txtDOTotal.Text = DigitalOutput.GetChannelTotal(adamType).ToString();
            // counter
            txtCounterTotal.Text = Counter.GetChannelTotal(adamType).ToString();
            listViewCounter.Items.Clear();
            if (Counter.GetModeTotal(adamType) > 0)
            {
                listViewCounter.Items.Add(new ListViewItem(Counter.GetModeName(adamType, (byte)Adam5080_CounterMode.Bi_Direction)));    // mode name
                listViewCounter.Items[0].SubItems.Add(Counter.GetUnitName(adamType, (byte)Adam5080_CounterMode.Bi_Direction));          // unit name
                listViewCounter.Items.Add(new ListViewItem(Counter.GetModeName(adamType, (byte)Adam5080_CounterMode.Up_Down)));         // mode name
                listViewCounter.Items[1].SubItems.Add(Counter.GetUnitName(adamType, (byte)Adam5080_CounterMode.Up_Down));               // unit name
                listViewCounter.Items.Add(new ListViewItem(Counter.GetModeName(adamType, (byte)Adam5080_CounterMode.Frequency)));       // mode name
                listViewCounter.Items[2].SubItems.Add(Counter.GetUnitName(adamType, (byte)Adam5080_CounterMode.Frequency));             // unit name
            }
            // alarm
            listViewAlarm.Items.Clear();
            for (iIdx = 0; iIdx < Alarm.GetModeTotal(adamType); iIdx++)
            {
                byCode = Alarm.GetModeCode(adamType, iIdx);
                listViewAlarm.Items.Add(new ListViewItem(Alarm.GetModeName(adamType, byCode))); // mode name
            }
        }
Exemplo n.º 6
0
        private void RefreshSingleChannelWithAiStatus(int i_iIndex, ref TextBox i_txtCh, float i_fValue, ushort i_usAiStatus)
        {
            string szFormat;
            string szRange;
            string szErrorMsg = string.Empty;
            string szComma    = " , ";

            szRange = AnalogInput.GetRangeName(m_Adam6000Type, m_usRange[i_iIndex]);

            if (m_bChEnabled[i_iIndex])
            {
                if (i_usAiStatus == (ushort)Adam_AiStatus_LowAddress.No_Fault_Detected)
                {
                    szErrorMsg   = string.Empty;
                    szFormat     = AnalogInput.GetFloatFormat(m_Adam6000Type, m_usRange[i_iIndex]);
                    i_txtCh.Text = i_fValue.ToString(szFormat) + " " + AnalogInput.GetUnitName(m_Adam6000Type, m_usRange[i_iIndex]);
                }
                else
                {
                    if ((i_usAiStatus & (ushort)Adam_AiStatus_LowAddress.FailToProvideAiValueUartTimeout) == (ushort)Adam_AiStatus_LowAddress.FailToProvideAiValueUartTimeout)
                    {
                        szErrorMsg = "Fail to provide AI value (UART timeout)";
                    }
                    else if ((i_usAiStatus & (ushort)Adam_AiStatus_LowAddress.Over_Range) == (ushort)Adam_AiStatus_LowAddress.Over_Range)
                    {
                        szErrorMsg = (szErrorMsg == string.Empty) ? ("Over Range") : (szErrorMsg + szComma + "Over Range");
                    }
                    else if ((i_usAiStatus & (ushort)Adam_AiStatus_LowAddress.Under_Range) == (ushort)Adam_AiStatus_LowAddress.Under_Range)
                    {
                        szErrorMsg = (szErrorMsg == string.Empty) ? ("Under Range") : (szErrorMsg + szComma + "Under Range");
                    }
                    else if ((i_usAiStatus & (ushort)Adam_AiStatus_LowAddress.Open_Circuit_Burnout) == (ushort)Adam_AiStatus_LowAddress.Open_Circuit_Burnout)
                    {
                        szErrorMsg = (szErrorMsg == string.Empty) ? ("Open Circuit (Burnout)") : (szErrorMsg + szComma + "Open Circuit (Burnout)");
                    }
                    else if ((i_usAiStatus & (ushort)Adam_AiStatus_LowAddress.Zero_Span_CalibrationError) == (ushort)Adam_AiStatus_LowAddress.Zero_Span_CalibrationError)
                    {
                        szErrorMsg = (szErrorMsg == string.Empty) ? ("Zero/Span Calibration Error") : (szErrorMsg + szComma + "Zero/Span Calibration Error");
                    }
                    i_txtCh.Text = szErrorMsg;
                }
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// When user select specific item of channel information, you should update channel range
 /// </summary>
 /// <param name="idxSel"></param>
 private void LvChInfo_SelectedIndexChanged(int idxSel)
 {
     this.cbxRange.SelectedIndex = GetChannelRangeIdx(AnalogInput.GetRangeName(m_usRanges[idxSel]));
     this.btnMaskEnable.Enabled  = true;
     this.btnMaskDisable.Enabled = true;
 }
Exemplo n.º 8
0
        /// <summary>
        /// Init Channel Information
        /// </summary>
        /// <param name="m_aConf">apax 5000 device object</param>
        private void InitialDataTabPages()
        {
            int          i = 0, idx = 0;
            byte         type = (byte)_HardwareIOType.AI; //APAX-5017 is AI module
            ListViewItem lvItem;

            string[] strRanges;
            ushort[] m_usRanges_supAI;

            for (i = 0; i < m_aConf.HwIoType.Length; i++)
            {
                if (m_aConf.HwIoType[i] == type)
                {
                    idx = i;
                }
            }
            m_tmpidx = idx;

            //init range combobox
            if (m_tmpidx == 0)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_0_Range;
            }
            else if (m_tmpidx == 1)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_1_Range;
            }
            else if (m_tmpidx == 2)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_2_Range;
            }
            else if (m_tmpidx == 3)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_3_Range;
            }
            else
            {
                m_usRanges_supAI = m_aConf.wHwIoType_4_Range;
            }
            //Get combobox items of Range
            strRanges = new string[m_aConf.HwIoType_TotalRange[m_tmpidx]];
            for (i = 0; i < strRanges.Length; i++)
            {
                strRanges[i] = AnalogInput.GetRangeName(m_usRanges_supAI[i]);
            }
            SetRangeComboBox(strRanges);
            //Get combobox items of Integration Time
            SetIntegrationComboBox(new string[] { AnalogInput.GetIntegrationName(AdamType.Apax5000, (byte)Apax_Integration.Auto) });
            //Get combobox items of Burnout Detect Mode
            SetBurnoutFcnValueComboBox(new string[] { "Down Scale", "Up Scale" });
            //Get combobox items of Sampling rate (Hz/Ch)
            SetSampleRateComboBox(new string[] { "1", "10" });
            //init channel information
            listViewChInfo.BeginUpdate();
            listViewChInfo.Items.Clear();
            for (i = 0; i < m_aConf.HwIoTotal[m_tmpidx]; i++)
            {
                lvItem = new ListViewItem(_HardwareIOType.AI.ToString()); //type
                lvItem.SubItems.Add(i.ToString());                        //Ch
                lvItem.SubItems.Add("*****");                             //Value
                lvItem.SubItems.Add("*****");                             //Ch Status
                lvItem.SubItems.Add("*****");                             //Range
                listViewChInfo.Items.Add(lvItem);
            }
            listViewChInfo.EndUpdate();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Init Channel Information
        /// </summary>
        /// <param name="aConf">apax 5000 device object</param>
        private void InitialDataTabPages()
        {
            int          i = 0, idx = 0;
            byte         type = (byte)_HardwareIOType.AI; //APAX-5018 is AI module
            ListViewItem lvItem;

            string[] strRanges;
            ushort[] m_usRanges_supAI;

            for (i = 0; i < m_aConf.HwIoType.Length; i++)
            {
                if (m_aConf.HwIoType[i] == type)
                {
                    idx = i;
                }
            }
            m_tmpidx = idx;

            //init range combobox
            if (m_tmpidx == 0)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 0);
                m_usRanges_supAI = m_aConf.wHwIoType_0_Range;
            }
            else if (m_tmpidx == 1)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 1);
                m_usRanges_supAI = m_aConf.wHwIoType_1_Range;
            }
            else if (m_tmpidx == 2)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 2);
                m_usRanges_supAI = m_aConf.wHwIoType_2_Range;
            }
            else if (m_tmpidx == 3)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 3);
                m_usRanges_supAI = m_aConf.wHwIoType_3_Range;
            }
            else
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 4);
                m_usRanges_supAI = m_aConf.wHwIoType_4_Range;
            }
            //Get combobox items of Range
            strRanges = new string[m_aConf.HwIoType_TotalRange[m_tmpidx]];
            for (i = 0; i < strRanges.Length; i++)
            {
                strRanges[i] = AnalogInput.GetRangeName(m_usRanges_supAI[i]);
            }
            SetRangeComboBox(strRanges);
            cbxRange.SelectedIndex = GetChannelRangeIdx(AnalogInput.GetRangeName(m_usRanges[0]));  //get the first channel range
            //Get combobox items of Integration Time
            SetIntegrationComboBox(new string[] { AnalogInput.GetIntegrationName(AdamType.Apax5000, (byte)Apax_Integration.Auto) });
            //Get combobox items of Burnout Detect Mode
            SetBurnoutFcnValueComboBox(new string[] { "Down Scale", "Up Scale" });
            //init channel information
            listViewChInfo.BeginUpdate();
            listViewChInfo.Items.Clear();
            for (i = 0; i < m_aConf.HwIoTotal[m_tmpidx]; i++)
            {
                lvItem = new ListViewItem(_HardwareIOType.AI.ToString()); //type
                lvItem.SubItems.Add(i.ToString());                        //Ch
                if (m_adamType == AdamType.Apax5070)
                {
                    lvItem.SubItems.Add(Convert.ToString(m_usStart + i));     //Modbus address
                }
                else
                {
                    lvItem.SubItems.Add("*****");
                }
                lvItem.SubItems.Add("*****");           //Value
                lvItem.SubItems.Add("*****");           //Ch Status
                lvItem.SubItems.Add("*****");           //Range
                listViewChInfo.Items.Add(lvItem);
            }
            listViewChInfo.EndUpdate();
        }
Exemplo n.º 10
0
        //初始化 頻道資訊
        /// <summary>
        /// Init Channel Information
        /// </summary>
        /// <param name="m_aConf">apax 5000 device object</param>
        ///
        private void InitialDataTabPages()
        {
            int          i = 0, idx = 0;
            byte         type = (byte)_HardwareIOType.AI; //APAX-5017H is AI module, Analog input = 3
            ListViewItem lvItem;

            string[] strRanges;
            ushort[] m_usRanges_supAI;

            for (i = 0; i < m_aConf.HwIoType.Length; i++)
            {
                if (m_aConf.HwIoType[i] == type)
                {
                    idx = i;
                }
            }
            m_tmpidx = idx;

            //init range combobox
            if (m_tmpidx == 0)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_0_Range;
            }
            else if (m_tmpidx == 1)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_1_Range;
            }
            else if (m_tmpidx == 2)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_2_Range;
            }
            else if (m_tmpidx == 3)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_3_Range;
            }
            else
            {
                m_usRanges_supAI = m_aConf.wHwIoType_4_Range;
            }
            //Get combobox items of Range
            strRanges = new string[m_aConf.HwIoType_TotalRange[m_tmpidx]];

            //顯示5種不同的電壓與電流範圍, mV和V為電壓; mA為電流
            for (i = 0; i < strRanges.Length; i++)
            {
                strRanges[i] = AnalogInput.GetRangeName(m_usRanges_supAI[i]);
            }
            SetRangeComboBox(strRanges);
            //Get combobox items of Burnout Detect Mode, Burnout代表燒毀, 耗盡體力/燈泡燒壞之意
            SetBurnoutFcnValueComboBox(new string[] { "Down Scale", "Up Scale" });
            //Get combobox items of Sampling rate (Hz/Ch)
            SetSampleRateComboBox(new string[] { "100", "1000" });
            //init channel information
            listViewChInfo.BeginUpdate(); //為了避免ListView因著數值持續改變而不斷重繪己身, 造成畫面閃爍及停頓, 故在開始前使用此函式進行UI控制, 並且在結束時使用EndUpdate(); 令UI資料刷新
            listViewChInfo.Items.Clear();

            //在顯示各Channels的數值之前, 先顯示*號替代之
            for (i = 0; i < m_aConf.HwIoTotal[m_tmpidx]; i++)
            {
                lvItem = new ListViewItem(_HardwareIOType.AI.ToString()); //type
                lvItem.SubItems.Add(i.ToString());                        //Ch, UI顯示從1~11
                lvItem.SubItems.Add("*****");                             //Value
                lvItem.SubItems.Add("*****");                             //Ch Status
                lvItem.SubItems.Add("*****");                             //Range
                listViewChInfo.Items.Add(lvItem);
            }
            listViewChInfo.EndUpdate();
        }
Exemplo n.º 11
0
        private void RefreshAdam6000Information()
        {
            byte   byCode;
            ushort usCode;
            int    intAdamType;

            Adam6000Type adamType;

            adamType    = (Adam6000Type)cbxModuleType.SelectedItem;
            intAdamType = (int)adamType;

            // AI information
            txtAITotal.Text = AnalogInput.GetChannelTotal(adamType).ToString();
            listViewAI.Items.Clear();

            if ((intAdamType == 6017) || ((intAdamType >= 6217) && (intAdamType <= 6224)))
            {
                for (int iIdx = 0; iIdx < AnalogInput.GetRangeTotal(adamType, Adam6000_RangeFormat.Ushort); iIdx++)
                {
                    usCode = AnalogInput.GetRangeCode2Byte(adamType, iIdx);
                    listViewAI.Items.Add(new ListViewItem("0x" + usCode.ToString("X04")));              // range code
                    listViewAI.Items[iIdx].SubItems.Add(AnalogInput.GetRangeName(adamType, usCode));    // range name
                    listViewAI.Items[iIdx].SubItems.Add(AnalogInput.GetUnitName(adamType, usCode));     // unit name
                }
            }
            else
            {
                for (int iIdx = 0; iIdx < AnalogInput.GetRangeTotal(adamType, Adam6000_RangeFormat.Byte); iIdx++)
                {
                    byCode = AnalogInput.GetRangeCode(adamType, iIdx);
                    listViewAI.Items.Add(new ListViewItem("0x" + byCode.ToString("X02")));              // range code
                    listViewAI.Items[iIdx].SubItems.Add(AnalogInput.GetRangeName(adamType, byCode));    // range name
                    listViewAI.Items[iIdx].SubItems.Add(AnalogInput.GetUnitName(adamType, byCode));     // unit name
                }
            }

            // AO information
            txtAOTotal.Text = AnalogOutput.GetChannelTotal(adamType).ToString();
            listViewAO.Items.Clear();

            if ((intAdamType >= 6217) && (intAdamType <= 6224))
            {
                for (int iIdx = 0; iIdx < AnalogOutput.GetRangeTotal(adamType, Adam6000_RangeFormat.Ushort); iIdx++)
                {
                    usCode = AnalogOutput.GetRangeCode2Byte(adamType, iIdx);
                    listViewAO.Items.Add(new ListViewItem("0x" + usCode.ToString("X04")));              // range code
                    listViewAO.Items[iIdx].SubItems.Add(AnalogInput.GetRangeName(adamType, usCode));    // range name
                    listViewAO.Items[iIdx].SubItems.Add(AnalogInput.GetUnitName(adamType, usCode));     // unit name
                }
            }
            else
            {
                for (int iIdx = 0; iIdx < AnalogInput.GetRangeTotal(adamType, Adam6000_RangeFormat.Byte); iIdx++)
                {
                    byCode = AnalogOutput.GetRangeCode(adamType, iIdx);
                    listViewAO.Items.Add(new ListViewItem("0x" + byCode.ToString("X02")));              // range code
                    listViewAO.Items[iIdx].SubItems.Add(AnalogOutput.GetRangeName(adamType, byCode));   // range name
                    listViewAO.Items[iIdx].SubItems.Add(AnalogOutput.GetUnitName(adamType, byCode));    // range name
                }
            }

            // DIO
            txtDITotal.Text = DigitalInput.GetChannelTotal(adamType).ToString();
            txtDOTotal.Text = DigitalOutput.GetChannelTotal(adamType).ToString();
            // counter
            txtCounterTotal.Text = Counter.GetChannelTotal(adamType).ToString();
            listViewCounter.Items.Clear();
            if (Counter.GetModeTotal(adamType) > 0)
            {
                listViewCounter.Items.Add(new ListViewItem(Counter.GetModeName(adamType, (byte)Adam6051_CounterMode.Counter)));         // mode name
                listViewCounter.Items[0].SubItems.Add(Counter.GetUnitName(adamType, (byte)Adam6051_CounterMode.Counter));               // unit name
                listViewCounter.Items.Add(new ListViewItem(Counter.GetModeName(adamType, (byte)Adam6051_CounterMode.Frequency)));       // mode name
                listViewCounter.Items[1].SubItems.Add(Counter.GetUnitName(adamType, (byte)Adam6051_CounterMode.Frequency));             // unit name
            }
            // alarm
            listViewAlarm.Items.Clear();
            for (int iIdx = 0; iIdx < Alarm.GetModeTotal(adamType); iIdx++)
            {
                byCode = Alarm.GetModeCode(adamType, iIdx);
                listViewAlarm.Items.Add(new ListViewItem(Alarm.GetModeName(adamType, byCode))); // mode name
            }
        }