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

                return(m_Adapter.Read16S((ushort)NodeID, (ushort)Address));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }
Beispiel #2
0
        internal short Read16S(ushort Node, ushort Address)
        {
            short res = 0;

            if (m_IsAdapterEmulation)
            {
                return(res);
            }

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

            return(res);
        }