mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Added missing async write methods
- refactoring
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user