コード例 #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;
            }
        }
コード例 #2
0
 public async Task <int> ReadWordIntegerAsync(string variable)
 {
     return((ushort)(await PLC.ReadAsync(variable)));
 }
コード例 #3
0
        public async Task <int> ReadDWordIntegerAsync(string variable)
        {
            UInt32 value = (UInt32)(await PLC.ReadAsync(variable));

            return((int)value);
        }
コード例 #4
0
        public async Task <double> ReadDWordRealAsync(string variable, int decimalNumbers)
        {
            var value = await PLC.ReadAsync(variable);

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