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.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace DataBlockHelper.DBHelpers
|
|
|
|
|
{
|
|
|
|
|
public class DB137WriterHelper
|
|
|
|
|
{
|
|
|
|
|
public static void AddSpeed(List<float> ls)
|
|
|
|
|
{
|
|
|
|
|
var siemensS7Net = PlcConnect.Instance;
|
|
|
|
|
int start = 2;
|
|
|
|
|
|
|
|
|
|
foreach (var item in ls)
|
|
|
|
|
{
|
|
|
|
|
string db = $"DB137.{start}.0";
|
|
|
|
|
siemensS7Net.Write(db,item);
|
|
|
|
|
start=start+4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class DB91WriterHelper
|
|
|
|
|
{
|
|
|
|
|
public static void AddSpeed(List<float> ls)
|
|
|
|
|
{
|
|
|
|
|
var siemensS7Net = PlcConnect.Instance;
|
|
|
|
|
int start = 40;
|
|
|
|
|
|
|
|
|
|
foreach (var item in ls)
|
|
|
|
|
{
|
|
|
|
|
string db = $"DB91.{start}.0";
|
|
|
|
|
siemensS7Net.Write(db, item);
|
|
|
|
|
start = start +14;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void AddSpeed(float a,float m)
|
|
|
|
|
{
|
|
|
|
|
var siemensS7Net = PlcConnect.Instance;
|
|
|
|
|
siemensS7Net.Write("DB91.78.0", a);
|
|
|
|
|
siemensS7Net.Write("DB91.82.0", m);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|