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/Entity/DB2108Helper.cs

43 lines
902 B
C#

using DataBlockHelper.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBlockHelper.DBHelpers
{
public class DB2108Helper
{
//
public static List<ClickEntity> GetClickEntities()
{
List<ClickEntity> ls = new List<ClickEntity>();
for (int i = 0; i < 8; i++) {
var entity=new ClickEntity();
entity.ClickValue= PlcConnect.Instance.ReadFloat($"DB2108.{(i * 6)+2}.0").Content;
ls.Add(entity);
}
return ls;
}
public static void WriteClick(int no, ClickEntity click)
{
int start=(no * 6) + 2;
var sss= PlcConnect.Instance.Write($"DB2108.{start}.0", click.ClickValue);
}
}
}