|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace DataBlockHelper.DBHelpers
|
|
|
|
|
{
|
|
|
|
|
public class DB2110WriteHelper
|
|
|
|
|
{
|
|
|
|
|
private static readonly string DbName = "DB2110";
|
|
|
|
|
|
|
|
|
|
public static void WriteA()
|
|
|
|
|
{
|
|
|
|
|
var siemensS7Net = PlcConnect.Instance;
|
|
|
|
|
int start = 3384;
|
|
|
|
|
ushort a = 0;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
siemensS7Net.Write($"{DbName}.3412.0", a);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void WriteB()
|
|
|
|
|
{
|
|
|
|
|
var siemensS7Net = PlcConnect.Instance;
|
|
|
|
|
int start = 3394;
|
|
|
|
|
ushort a = 0;
|
|
|
|
|
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0",a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
start += 2;
|
|
|
|
|
siemensS7Net.Write($"{DbName}.{start}.0", a);
|
|
|
|
|
|
|
|
|
|
siemensS7Net.Write($"{DbName}.3414.0", a);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|