Beispiel #1
0
        public void Connected(HMP4040 hmp)
        {
            try
            {
                if (m_hmp != null && hmp == null)
                {
                    m_hmp.SetOutputEnable(m_outputChannel, false);
                    tsOutputEnable.Checked = false;
                }

                if (hmp != null)
                {
                    hmp.GetOutputEnable(m_outputChannel, out bool enable);
                    tsOutputEnable.Checked = enable;
                    lbOnOff.On             = enable;

                    double value;
                    hmp.GetOutputVoltageLevel(m_outputChannel, out value);
                    txtOutputVoltageLevel.Text = value.ToString();
                    ssVoltage.Text             = value.ToString();
                    hmp.GetOverVoltageProtectionLevel(m_outputChannel, out value);
                    txtOverProtectionLevel.Text = value.ToString();
                    hmp.GetOutputCurrentLevel(m_outputChannel, out value);
                    txtOutputCurrentLevel.Text = value.ToString();
                }
                m_hmp = hmp;
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Beispiel #2
0
        public void ReadValues()
        {
            m_hmp.MeasureDCCurrent(m_outputChannel, out double currentValue);
            ssCurrent.Value = currentValue.ToString();

            m_hmp.MeasureDCVoltage(m_outputChannel, out double voltageValue);
            ssMeasureDCVoltage.Value = voltageValue.ToString();

            double value;

            m_hmp.GetOutputVoltageLevel(m_outputChannel, out value);
            ssVoltage.Value = value.ToString();
            m_hmp.GetOverVoltageProtectionLevel(m_outputChannel, out value);
            txtOverProtectionLevel.Text = value.ToString();
            m_hmp.GetOutputCurrentLevel(m_outputChannel, out value);
            txtOutputCurrentLevel.Text = value.ToString();
        }