Can Exist 동작 방식 변경
This commit is contained in:
parent
9ce42d24d7
commit
8f82f7256b
@ -142,12 +142,12 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
private double _RotaryEncoderOffset = 0;
|
private double _RotaryEncoderOffset = 0;
|
||||||
private int _WeldingJigNo = -1;
|
private int _WeldingJigNo = -1;
|
||||||
private int _WeldingCount = 0;
|
private int _WeldingCount = 0;
|
||||||
private int _RotaryJigCount = 16;
|
private const int _RotaryJigCount = 16;
|
||||||
|
|
||||||
private double _WeldingStartAngle;
|
private double _WeldingStartAngle;
|
||||||
|
|
||||||
private bool isTheFirstListWrite = true;
|
private bool isTheFirstListWrite = false;
|
||||||
private bool isTheSecondListWrite = true;
|
private bool isTheSecondListWrite = false;
|
||||||
|
|
||||||
private bool isTheFirstListExecute;
|
private bool isTheFirstListExecute;
|
||||||
private int _RecipeNo;
|
private int _RecipeNo;
|
||||||
@ -201,7 +201,7 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
|
|
||||||
sb.AddAction(SEQ_SAVE_RESULT_DATA, SaveResultData); // 해당 공정의 정보를 기록 함.
|
sb.AddAction(SEQ_SAVE_RESULT_DATA, SaveResultData); // 해당 공정의 정보를 기록 함.
|
||||||
|
|
||||||
sb.AddAction(SEQ_APD_DATA_SAVE, SaveCellAPDData); // 용접 완료 시 Cell의 정보를 저장함
|
//sb.AddAction(SEQ_APD_DATA_SAVE, SaveCellAPDData); // 용접 완료 시 Cell의 정보를 저장함
|
||||||
sb.AddAction(SEQ_WRITE_COMPLETION_PLC_BIT, WriteCompletionPLCBit); // 정상적으로 종료 되면, complete bit write
|
sb.AddAction(SEQ_WRITE_COMPLETION_PLC_BIT, WriteCompletionPLCBit); // 정상적으로 종료 되면, complete bit write
|
||||||
sb.AddAction(SEQ_INIT_CONDITION_ERROR, InitConditionError);
|
sb.AddAction(SEQ_INIT_CONDITION_ERROR, InitConditionError);
|
||||||
sb.AddAction(SEQ_COMPLETE, Complete);
|
sb.AddAction(SEQ_COMPLETE, Complete);
|
||||||
@ -213,7 +213,7 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
> sb[SEQ_SET_PARAMS_UPLOAD_WELDING_LIST_SEQ] > sb[SEQ_DO_ID_UPLOAD_WELDING_LIST_SEQ] > sb[SEQ_GET_RESULT_UPLOAD_WELDING_LIST_SEQ]
|
> sb[SEQ_SET_PARAMS_UPLOAD_WELDING_LIST_SEQ] > sb[SEQ_DO_ID_UPLOAD_WELDING_LIST_SEQ] > sb[SEQ_GET_RESULT_UPLOAD_WELDING_LIST_SEQ]
|
||||||
> sb[SEQ_EXECUTE_WELDING] > sb[SEQ_REQUEST_UNLOAD_CELL] > sb[SEQ_CHECK_SCANNER_LIST_COMPLETE]> sb[SEQ_CHECK_CAN_WELDED]
|
> sb[SEQ_EXECUTE_WELDING] > sb[SEQ_REQUEST_UNLOAD_CELL] > sb[SEQ_CHECK_SCANNER_LIST_COMPLETE]> sb[SEQ_CHECK_CAN_WELDED]
|
||||||
> sb[SEQ_SET_PARAMS_REPORT_CELL_RESULT_SEQ] > sb[SEQ_DO_ID_REPORT_CELL_RESULT_SEQ] > sb[SEQ_GET_RESULT_REPORT_CELL_RESULT_SEQ]
|
> sb[SEQ_SET_PARAMS_REPORT_CELL_RESULT_SEQ] > sb[SEQ_DO_ID_REPORT_CELL_RESULT_SEQ] > sb[SEQ_GET_RESULT_REPORT_CELL_RESULT_SEQ]
|
||||||
> sb[SEQ_APD_DATA_SAVE] > sb[SEQ_CHECK_CYCLE_STOP]
|
> sb[SEQ_CHECK_CYCLE_STOP]
|
||||||
> sb[SEQ_SAVE_RESULT_DATA] > sb[SEQ_WRITE_COMPLETION_PLC_BIT] > sb[SEQ_JOIN_ENCODER_MONITOR] > sb[SEQ_COMPLETE]);
|
> sb[SEQ_SAVE_RESULT_DATA] > sb[SEQ_WRITE_COMPLETION_PLC_BIT] > sb[SEQ_JOIN_ENCODER_MONITOR] > sb[SEQ_COMPLETE]);
|
||||||
|
|
||||||
sb.Flows(sb[SEQ_CHECK_CAN_EXIST] > sb[SEQ_EXECUTE_WELDING]);
|
sb.Flows(sb[SEQ_CHECK_CAN_EXIST] > sb[SEQ_EXECUTE_WELDING]);
|
||||||
@ -687,6 +687,7 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
}
|
}
|
||||||
UpdateProductCount(context);
|
UpdateProductCount(context);
|
||||||
UpdateProductInfoForView();
|
UpdateProductInfoForView();
|
||||||
|
SaveCellAPDData();
|
||||||
}
|
}
|
||||||
|
|
||||||
UtilUnit.logUnit.SetLog(LogUnit.eLogType.PRODUCT, MethodBase.GetCurrentMethod().Name, "UPDATE_WELDING_TIME;" + _WeldingSpanTime.TotalMilliseconds);
|
UtilUnit.logUnit.SetLog(LogUnit.eLogType.PRODUCT, MethodBase.GetCurrentMethod().Name, "UPDATE_WELDING_TIME;" + _WeldingSpanTime.TotalMilliseconds);
|
||||||
@ -772,24 +773,26 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
|
|
||||||
// 3개임으로 3으로 작성
|
// 3개임으로 3으로 작성
|
||||||
#region List 입력(용접 좌표 입력)
|
#region List 입력(용접 좌표 입력)
|
||||||
if (_WeldingJigNo == _RotaryJigCount)
|
//if (_WeldingJigNo == _RotaryJigCount)
|
||||||
_WeldingJigNo = 1;
|
// _WeldingJigNo = 1;
|
||||||
else
|
//else
|
||||||
_WeldingJigNo++;
|
// _WeldingJigNo++;
|
||||||
|
|
||||||
bool canExist; // 지그 용접 수행 여부 확인
|
Log.I($"Welding Jig No : {_WeldingJigNo}");
|
||||||
|
|
||||||
if (UsePlcShotThemAll)
|
(bool exist,int targetjigNo) canExist; // 지그 용접 수행 여부 확인
|
||||||
{
|
|
||||||
canExist = true;
|
if (UsePlcShotThemAll) {
|
||||||
|
canExist = (true, _WeldingJigNo);
|
||||||
Log.I("Settings - PLC : Shot Them All Mode");
|
Log.I("Settings - PLC : Shot Them All Mode");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
canExist = GetRotaryCanExist(_WeldingJigNo);
|
canExist = GetRotaryCanExist(_WeldingJigNo);
|
||||||
|
_WeldingJigNo = canExist.targetjigNo;
|
||||||
|
}
|
||||||
|
|
||||||
Log.I("Can Exist : " + canExist.ToString() + ", JigNo " + _WeldingJigNo + " ,CountNo " + _WeldingCount + ", StartAngle(Y) : " + _WeldingStartAngle);
|
Log.I("Can Exist : " + canExist.ToString() + ", JigNo " + _WeldingJigNo + " ,CountNo " + _WeldingCount + ", StartAngle(Y) : " + _WeldingStartAngle);
|
||||||
|
|
||||||
if (canExist)
|
if (canExist.exist)
|
||||||
return SEQ_SET_PARAMS_RECEIVE_CELL_INFO_SEQ;
|
return SEQ_SET_PARAMS_RECEIVE_CELL_INFO_SEQ;
|
||||||
else
|
else
|
||||||
return SEQ_EXECUTE_WELDING;
|
return SEQ_EXECUTE_WELDING;
|
||||||
@ -909,8 +912,18 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
_Scanner.WaitForEncoderRotateRange(encoderAllowedMinDegree, encoderAllowedMaxDegree, sectionStartAngle, sectionEndAngle);
|
_Scanner.WaitForEncoderRotateRange(encoderAllowedMinDegree, encoderAllowedMaxDegree, sectionStartAngle, sectionEndAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetRotaryCanExist(int jigNo)
|
public (bool isExist, int targetJigNo) GetRotaryCanExist(int JigNo)
|
||||||
{
|
{
|
||||||
|
// PLC 용접 대상 비트를 확인한다.
|
||||||
|
for (int offset = 1; offset <= _RotaryJigCount; offset++) {
|
||||||
|
int checkJigNo = (JigNo + offset) % _RotaryJigCount; // 0~15번 비트를 확인하기 위함
|
||||||
|
|
||||||
|
// 비트가 켜져있는 것이 확인이 된다면,
|
||||||
|
if (_PLC.ReadBit((int)eBitInput.PLC_USE_WELD_JIG_1 + checkJigNo).data) {
|
||||||
|
return (true, checkJigNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (false, 0);
|
||||||
#region 지그 16개 요청기록 로그 남기기, 빠져나간 캔에 대한 Complete Bit 초기화
|
#region 지그 16개 요청기록 로그 남기기, 빠져나간 캔에 대한 Complete Bit 초기화
|
||||||
string result = "";
|
string result = "";
|
||||||
|
|
||||||
@ -1169,7 +1182,7 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
// TODO: 한번만 돌도록 설정함, PLC 로 받으면 좋음.
|
// TODO: 한번만 돌도록 설정함, PLC 로 받으면 좋음.
|
||||||
//Jin : cycleStop 명령을 용접 프로그램에서 할 경우가 현재는 없음..
|
//Jin : cycleStop 명령을 용접 프로그램에서 할 경우가 현재는 없음..
|
||||||
// CheckCycleStop 노드와 Complete 노드 사이 다른 노드가 필요하다면 해당 노드를 CheckCycleStop 노드 위로 올리자
|
// CheckCycleStop 노드와 Complete 노드 사이 다른 노드가 필요하다면 해당 노드를 CheckCycleStop 노드 위로 올리자
|
||||||
bool cycleStop = _PLC.ReadBit((int)eBitInput.PLC_MANUAL_REQ).data;
|
bool cycleStop = false;
|
||||||
if (cycleStop || CycleStopTest)
|
if (cycleStop || CycleStopTest)
|
||||||
return SEQ_SAVE_RESULT_DATA;
|
return SEQ_SAVE_RESULT_DATA;
|
||||||
else
|
else
|
||||||
@ -1185,16 +1198,16 @@ namespace ILSOS_ACW_H52A.Sequences
|
|||||||
return SEQ_CHECK_CYCLE_STOP;
|
return SEQ_CHECK_CYCLE_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SequenceActionResult SaveCellAPDData(SequenceContext context, string id, SequenceActionResult param)
|
private void SaveCellAPDData()
|
||||||
{
|
{
|
||||||
if (Status.GetProcessingWeldingData().APD.Count > 0)
|
if (Status.GetProcessingWeldingData().APD.Count > 0)
|
||||||
{
|
{
|
||||||
string directoryPath = "D:\\ILSOSConfig\\APD_History";
|
string directoryPath = "D:\\ILSOSConfig\\APD_History";
|
||||||
string fileName = Status.GetProcessingWeldingData().APD.First().Date.ToString("HHmmss") + "_" + Status.GetProcessingWeldingData().APD.First().CellID;
|
string fileName = DateTime.Now.ToString("HHmmss.fff") + "_" + Status.GetProcessingWeldingData().APD.First().CellID;
|
||||||
string fullPath = Path.Combine(directoryPath, Status.GetProcessingWeldingData().APD.First().Date.ToString("yyyy-MM-dd"), fileName);
|
string fullPath = Path.Combine(directoryPath, Status.GetProcessingWeldingData().APD.First().Date.ToString("yyyy-MM-dd"), fileName);
|
||||||
Status.GetProcessingWeldingData().APD.CreateFiles(fullPath);
|
Status.GetProcessingWeldingData().APD.CreateFiles(fullPath);
|
||||||
|
Log.I($"Save Cell APD Data. File Name : {fileName}");
|
||||||
}
|
}
|
||||||
return SequenceAction.Ok();
|
|
||||||
}
|
}
|
||||||
private SequenceActionResult SaveResultData(SequenceContext context, string id, SequenceActionResult param)
|
private SequenceActionResult SaveResultData(SequenceContext context, string id, SequenceActionResult param)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user