public async Task <bool> LogEventSetTest(Behavior behavior) { testConnection = new TestModbusTCPConnection(behavior, "172.19.103.8"); _wtxDevice = new WTXModbus(testConnection, 200, UpdateLogEventSetTest); _wtxDevice.Connect(this.OnConnect, 100); testConnection.IsConnected = true; _data = await testConnection.SyncData(); if (testConnection._logObj.Args.Equals("Read successful: Registers have been read")) { return(true); } else if (testConnection._logObj.Args.Equals("Read failed : Registers have not been read")) { return(false); } else { return(false); } //return _wtxDevice.ApplicationMode; }
public async Task <ushort> ReadTestModbus(Behavior behavior) { testConnection = new TestModbusTCPConnection(behavior, "172.19.103.8"); _wtxDevice = new WTXModbus(testConnection, 200, UpdateReadTest); _wtxDevice.Connect(this.OnConnect, 100); await Task.Run(async() => { ushort[] _data = await testConnection.SyncData(); }); _testValue = (ushort)_wtxDevice.ProcessData.Weight.Net; return(_testValue); }
public async Task <string> testModbus_Unit(Behavior behavior) { TestModbusTCPConnection testConnection = new TestModbusTCPConnection(behavior, "172.19.103.8"); WTXModbus _wtxObj = new WTXModbus(testConnection, 200, update); _wtxObj.Connect(this.OnConnect, 100); await Task.Run(async() => { ushort[] _data = await testConnection.SyncData(); }); return(_wtxObj.ProcessData.Unit); }
public async Task <string> testModbus_NetGrossValueStringComment(Behavior behavior) { TestModbusTCPConnection testConnection = new TestModbusTCPConnection(behavior, "172.19.103.8"); WTXModbus _wtxObj = new WTXModbus(testConnection, 200, update); _wtxObj.Connect(this.OnConnect, 100); await Task.Run(async() => { ushort[] _data = await testConnection.SyncData(); }); string strValue = _wtxObj.PrintableWeight.Net; return(strValue); }
public async Task <string> testModbus_WeightMovingStringComment(Behavior behavior) { TestModbusTCPConnection testConnection = new TestModbusTCPConnection(behavior, "172.19.103.8"); WTXModbus _wtxObj = new WTXModbus(testConnection, 200, update); _wtxObj.Connect(this.OnConnect, 100); await Task.Run(async() => { ushort[] _data = await testConnection.SyncData(); }); if (_wtxObj.WeightStable) { return("0=Weight is not moving."); } else { return("1=Weight is moving"); } }