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/DB2108HelperWriteNew.cs

80 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBlockHelper.DBHelpers
{
public class DB2108HelperWriteNew
{
private static readonly string DbName = "DB2108";
public static void Inser(Time2108 time)
{
var siemensS7Net = PlcConnect.Instance;
int start = 26;
siemensS7Net.Write($"{DbName}.{start}.0", time.VibSiloOn);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.VibSiloOff);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.VibDaybinOn);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.VibDaybinOff);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.VibHopperOn);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.VibHopperOff);
//38
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.PlsSiloOn);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.PlsSiloOff);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.PlsDaybinOn);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.PlsDaybinOff);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.PlsHopperOn);
start += 2;
siemensS7Net.Write($"{DbName}.{start}.0", time.PlsHopperOff);
}
public static void WriteA(bool b)
{
var siemensS7Net = PlcConnect.Instance;
siemensS7Net.Write($"{DbName}.72.0", b);
}
public static void WriteB(bool b)
{
var siemensS7Net = PlcConnect.Instance;
siemensS7Net.Write($"{DbName}.74.0", b);
}
public static void WriteC(bool b)
{
var siemensS7Net = PlcConnect.Instance;
siemensS7Net.Write($"{DbName}.76.0", b);
}
public static void WriteD(bool b)
{
var siemensS7Net = PlcConnect.Instance;
siemensS7Net.Write($"{DbName}.78.0", b);
}
}
}