|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace DataBlockHelper.DBHelpers
|
|
|
|
|
{
|
|
|
|
|
public class DB2105WriteHelper
|
|
|
|
|
{
|
|
|
|
|
private static readonly string DbName = "DB2105";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH1(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(54, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH2(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(62, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH3(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(70, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH4(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(78, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH5(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(86, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH6(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(86, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH7(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(94, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void WriteSetValueH8(SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
WriteSetValue(102, setValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void WriteSetValue(int start,SetValue setValue)
|
|
|
|
|
{
|
|
|
|
|
var siemensS7Net = PlcConnect.Instance;
|
|
|
|
|
siemensS7Net.Write($"{DbName}:{start}.0", setValue.Value);
|
|
|
|
|
siemensS7Net.Write($"{DbName}:{start+4}.0", setValue.Toterance);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|