|
|
|
@ -0,0 +1,32 @@
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using HslCommunication;
|
|
|
|
|
|
|
|
|
|
namespace DataBlockHelper.DBHelpers
|
|
|
|
|
{
|
|
|
|
|
public class Db3000Helper
|
|
|
|
|
{
|
|
|
|
|
public static List<bool> ReadDb()
|
|
|
|
|
{
|
|
|
|
|
List<bool> ls = new List<bool>();
|
|
|
|
|
var operateResult = PlcConnect.Instance.Read("DB3000.0.0",1);
|
|
|
|
|
if (operateResult.IsSuccess)
|
|
|
|
|
{
|
|
|
|
|
var context = operateResult.Content;
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < 6; i++)
|
|
|
|
|
{
|
|
|
|
|
var bo= context.GetBoolByIndex(i);
|
|
|
|
|
ls.Add(bo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ls;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|