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; } }
public async Task <int> ReadWordIntegerAsync(string variable) { return((ushort)(await PLC.ReadAsync(variable))); }
public async Task <int> ReadDWordIntegerAsync(string variable) { UInt32 value = (UInt32)(await PLC.ReadAsync(variable)); return((int)value); }
public async Task <double> ReadDWordRealAsync(string variable, int decimalNumbers) { var value = await PLC.ReadAsync(variable); return(Math.Round(((uint)value).ConvertToDouble(), decimalNumbers)); }