|
|
|
@ -70,14 +70,14 @@ public class Worker : BackgroundService
|
|
|
|
|
var ls = new List<EPointDataEntity>();
|
|
|
|
|
foreach (var e in listp)
|
|
|
|
|
{
|
|
|
|
|
var a = await S7.ReadDoubleAsync(e.Point);
|
|
|
|
|
var a = await S7.ReadFloatAsync(e.Point);
|
|
|
|
|
if (a.IsSuccess)
|
|
|
|
|
{
|
|
|
|
|
var listd = new EPointDataEntity();
|
|
|
|
|
listd.ID = Guid.NewGuid().ToString();
|
|
|
|
|
listd.PID = e.ID;
|
|
|
|
|
listd.CreateTime = DateTime.Now;
|
|
|
|
|
listd.Data = a.Content.ToDecimal();
|
|
|
|
|
listd.Data = Math.Round(Convert.ToDecimal(a.Content), 2);
|
|
|
|
|
ls.Add(listd);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|