Ejemplo n.º 1
0
        public async Task <bool> ReadBoolAsync(string variable)
        {
            try
            {
                var value = await PLC.ReadAsync(variable);

                SetErrorMessageOk();
                return((bool)value);
            }
            catch (Exception ex)
            {
                SetErrorMessageBad(ex.Message);
                throw;
            }
        }
Ejemplo n.º 2
0
 public async Task <int> ReadWordIntegerAsync(string variable)
 {
     return((ushort)(await PLC.ReadAsync(variable)));
 }
Ejemplo n.º 3
0
        public async Task <int> ReadDWordIntegerAsync(string variable)
        {
            UInt32 value = (UInt32)(await PLC.ReadAsync(variable));

            return((int)value);
        }
Ejemplo n.º 4
0
        public async Task <double> ReadDWordRealAsync(string variable, int decimalNumbers)
        {
            var value = await PLC.ReadAsync(variable);

            return(Math.Round(((uint)value).ConvertToDouble(), decimalNumbers));
        }