|
@@ -1209,8 +1209,7 @@ namespace B20UVLog
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
- OperateResult<bool> isLampUse = melsec_net.ReadBool(IOPLC.ReportFlagAddress);
|
|
|
- if (isLampUse.IsSuccess && isLampUse.Content)
|
|
|
+
|
|
|
{
|
|
|
OperateResult<short[]> ioRet = melsec_net.ReadInt16(IOPLC.PlcItemAddressType + IOPLC.PlcItemStartAddress, (ushort)IOPLC.PlcItemAddressLength);
|
|
|
List<PlcItemModel> ioItemLst = DbHelper.Db.Queryable<PlcItemModel>().Where(x => x.PlcItemType == IOPLC.PlcItemType).ToList();
|
|
@@ -1225,20 +1224,12 @@ namespace B20UVLog
|
|
|
|
|
|
//ToDo:把PLC数据插入到数据库中
|
|
|
IOModel axisData = MapPlcItemToObjectProperty<IOModel>(ioItemLst);
|
|
|
-
|
|
|
axisData.RecordTime = DateTime.Now;
|
|
|
DbHelper.Db.Insertable(axisData).ExecuteCommand();
|
|
|
- melsec_net.Write(IOPLC.ReplyFlagAddress, true);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- OperateResult<bool> isJobEventReply = melsec_net.ReadBool(IOPLC.ReplyFlagAddress);
|
|
|
- if (isJobEventReply.IsSuccess && isJobEventReply.Content)
|
|
|
- {
|
|
|
- melsec_net.Write(IOPLC.ReplyFlagAddress, false);
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
- Task.Delay(TaskDelayTime).Wait();
|
|
|
+
|
|
|
+ Task.Delay(500).Wait();
|
|
|
}
|
|
|
}, tokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default));
|
|
|
}
|