diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 9e5511d..a883408 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -26,7 +26,7 @@ PlcTask Outputs MAIN.bOutput1 - + BOOL diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index cfde607..e11ab1f 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -3,45 +3,36 @@ if busy then continue with PLC cycle and check again next time. - // If fbReadEncRefSys not started then go back a step. + // If aFbReadEncRefSys not started then go back a step. // If any axes result in an error the code will get stuck here, this happens if gvl_app.nAXIS_NUM is not set correctly FOR i:=1 TO gvl_app.nAXIS_NUM DO - IF fbReadEncRefSys[i].Valid = FALSE THEN - IF fbReadEncRefSys[i].Busy = TRUE THEN + IF aFbReadEncRefSys[i].Valid = FALSE THEN + IF aFbReadEncRefSys[i].Busy = TRUE THEN // Exit MAIN.STARTUP Action and wait till next cycle, needs to cycle through whole program in order for data to update RETURN; ELSE - // Sometimes the code gets here and the fbReadEncRefSys[i] misses the rising edge. If the code gets here it means + // Sometimes the code gets here and the aFbReadEncRefSys[i] misses the rising edge. If the code gets here it means // .valid=FALSE and .busy=FALSE which indicateds the FB probably hasn't started and thus needs to see a rising edge. // Set execute to low, Exit MAIN.STARTUP and go back a step in the CASE statement. bExecuteReadEncRefSys:=FALSE; - eStartUp:=ReadAxisFeedbackType; - iRetry:=iRetry+1; // counter used for troubleshooting to see how many cycles it takes before fbReadEncRefSys function blocks are read correctly + eStartUp:=eReadAxisFeedbackType; + nRetry:=nRetry+1; // counter used for troubleshooting to see how many cycles it takes before aFbReadEncRefSys function blocks are read correctly RETURN; END_IF END_IF END_FOR // If the code gets here all axes either have .valid=TRUE for all axes - eStartUp:= ExecuteRestore; + eStartUp:= eExecuteRestore; - ExecuteRestore: - // Execute position restore by setting fbRestorePosition.execute = TRUE + eExecuteRestore: + // Execute position restore by setting aFbRestorePosition.execute = TRUE FOR i:=1 TO gvl_app.nAXIS_NUM DO - IF fbReadEncRefSys[i].Valid = TRUE AND fbReadEncRefSys[i].Value = 0 AND NOT(axesPersistent[i].bMovingAtShutdown) THEN + IF aFbReadEncRefSys[i].Valid = TRUE AND aFbReadEncRefSys[i].Value = 0 AND NOT(axesPersistent[i].bMovingAtShutdown) THEN IF GVL.axes[i].config.eRestorePosition = RestorePosition.RestoreWithoutHome THEN - fbRestorePosition[i].Execute:=TRUE; + aFbRestorePosition[i].Execute:=TRUE; END_IF END_IF END_FOR - eStartUp:= CheckRestore; + eStartUp:= eCheckRestore; - CheckRestore: + eCheckRestore: // Check the set position fbs are finished // Nothing actually happens if the restore is not done, the code just returns from here each cycle and the // bPositionRestoreDone will never get set to TRUE and will take up cycle time FOR i:=1 TO gvl_app.nAXIS_NUM DO - IF fbReadEncRefSys[i].Valid = TRUE AND fbReadEncRefSys[i].Value = 0 AND NOT(axesPersistent[i].bMovingAtShutdown) THEN + IF aFbReadEncRefSys[i].Valid = TRUE AND aFbReadEncRefSys[i].Value = 0 AND NOT(axesPersistent[i].bMovingAtShutdown) THEN IF GVL.axes[i].config.eRestorePosition = RestorePosition.RestoreWithoutHome THEN - IF NOT fbRestorePosition[i].Done THEN + IF NOT aFbRestorePosition[i].Done THEN RETURN; END_IF END_IF @@ -195,9 +186,9 @@ IF bRestoreExecute AND NOT bPositionRestoreDone THEN eStartUp:= FinishRestore; FinishRestore: - // Remove execute = TRUE for fbRestorePosition + // Remove execute = TRUE for aFbRestorePosition FOR i:=1 TO gvl_app.nAXIS_NUM DO - fbRestorePosition[i].Execute:=FALSE; + aFbRestorePosition[i].Execute:=FALSE; END_FOR bPositionRestoreDone:=TRUE; bRestoreExecute:=FALSE; diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index de9fc97..1b8def1 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit de9fc973bc5fbf3fca4b2f10580df4e738dcd91e +Subproject commit 1b8def1012d4825ee0a7df1936895092f4608385