You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs

61 lines
1.5 KiB
C#

1 year ago
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);
}
}
}