Added missing async write methods

- refactoring
This commit is contained in:
Felix Weiß
2022-06-20 17:09:48 +02:00
parent d0519f2409
commit ba48d97c2b
19 changed files with 314 additions and 180 deletions

View File

@@ -34,8 +34,12 @@ namespace Examples {
Task.Factory.StartNew(async () => {
await Task.Delay(2000);
//inverts the boolean register
interf.SetRegister(nameof(registers.TestBool1), !registers.TestBool1);
await interf.SetRegisterAsync(nameof(registers.TestBool1), !registers.TestBool1);
Console.WriteLine("Testregister was toggled");
//adds 10 each time the plc connects to the PLCs INT regíster
interf.SetRegister(nameof(registers.TestInt16), (short)(registers.TestInt16 + 10));
//adds 1 each time the plc connects to the PLCs DINT regíster

View File

@@ -10,7 +10,7 @@ namespace Examples {
[Register(100, RegisterType.R)]
public bool TestBool1 { get; private set; }
//corresponds to a R100 boolean register in the PLC
//corresponds to a XD input of the PLC
[Register(RegisterType.X, SpecialAddress.D)]
public bool TestBoolInputXD { get; private set; }