Exemplo n.º 1
0
        private void RefreshAOValue()
        {
            float fValue;
            int   iValue;

            if (adamCom.AnalogOutput(m_iAddr).GetCurrentValue((byte)m_adamConfig.Format, out fValue))
            {
                if (m_adamConfig.Format == Adam4000_DataFormat.EngineerUnit)
                {
                    txtAOValue.Text = fValue.ToString("#0.000") + " " + AnalogOutput.GetUnitName(m_Adam4000Type, m_adamConfig.TypeCode);
                }
                else if (m_adamConfig.Format == Adam4000_DataFormat.Percent)
                {
                    txtAOValue.Text = fValue.ToString("#0.000") + " %";
                }
                else
                {
                    iValue          = Convert.ToInt32(fValue);
                    txtAOValue.Text = "0X" + iValue.ToString("X03");
                }
            }
            else
            {
                txtAOValue.Text = "GetCurrentValue() failed";
            }
        }
Exemplo n.º 2
0
        private void RefreshAOValue()
        {
            float fValue;

            if (adamCom.AnalogOutput(m_iAddr).GetExcitationValue(out fValue))
            {
                txtAOValue.Text = fValue.ToString("#0.000") + " V";
            }
            else
            {
                txtAOValue.Text = "GetExcitationValue() failed;";
            }
        }
Exemplo n.º 3
0
        private void RefreshChannelRange()
        {
            byte byRange;
            int  iCh;

            for (iCh = 0; iCh < m_iChTotal; iCh++)
            {
                if (adamCom.AnalogOutput(m_iAddr).GetOutputRange(iCh, out byRange))
                {
                    m_byRange[iCh] = byRange;
                }
            }
        }
Exemplo n.º 4
0
        private bool RefreshRange(int i_iChannel)
        {
            byte byRange, bySlewrate;
            bool bRet;

            if (m_b5000)
            {
                bRet = adamCom.AnalogOutput(m_iAddr).GetConfiguration(m_iSlot, i_iChannel, out byRange, out bySlewrate);
            }
            else
            {
                bRet = adamSocket.AnalogOutput(m_iAddr).GetConfiguration(m_iSlot, i_iChannel, out byRange);
            }
            if (bRet)
            {
                m_byRange[i_iChannel] = byRange;
            }
            return(bRet);
        }