示例#1
0
        public int Read16Silent(int Address)
        {
            try
            {
                if (!m_Adapter.Connected)
                {
                    throw new InvalidOperationException("No connection to device");
                }

                return(m_Adapter.Read16((ushort)NodeID, (ushort)Address));
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        internal ushort Read16(ushort Node, ushort Address)
        {
            ushort res = 0;

            if (m_IsAdapterEmulation)
            {
                return(res);
            }

            try
            {
                res = m_Adapter.Read16(Node, Address);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format(Resources.Error_IOAdapter_Operation_Node_Address_Message, Node, Address,
                                                  ex.Message, @"@Read16"));
            }

            return(res);
        }