So I'm programming a cell using an older program structure what is not mine (very similar cell so I can use the old prg) I need to send the robot home and restart the process in some cases, but I need to stop background prgs and do the init again.Everything works fine but the operator need to press fnct abort all first, than push the start button...Can I use a sysvar, or is there any way to send "abort all" within a program?
Is there a way to send FNCT --> Abort all programatically?
-
moln4r -
December 13, 2017 at 8:00 PM -
Thread is marked as Resolved.
-
-
The UI signal "cstopi" can be configured to abort all in the system config menu.
Sent from my SM-G930V using Tapatalk
-
Yes, but than the operator needs to push a button again.The idea is I want to decide when abort all needed, and when the robot can continue the process.So the op only needs to press the start button, nothing else.
-
You can map CSTOPI to a flag and then control it from BG logic...
-
with Karel:
Code
Display MorePROGRAM ABORTALL %COMMENT = 'alles abbrechen' %NOLOCKGROUP %NOABORT = ERROR + COMMAND VAR task_name : STRING[32] force_Sw : BOOLEAN cancelm_sw : BOOLEAN STATUS: INTEGER BEGIN task_name = '*ALL*' -- <--ABORT ALL force_Sw = true cancelm_sw = TRUE WRITE (CHR(128)) ABORT_TASK(task_name,force_Sw,cancelm_sw,STATUS) IF (STATUS<>0) THEN FORCE_SPMENU (TP_PANEL, SPI_TPUSER, 1) WRITE (CR,'Error Status:',STATUS, '') WRITE (CR,'Prog konnte nicht') WRITE (CR,'abgebrochen werden') POST_ERR(STATUS,'',0,2) else FORCE_SPMENU (TP_PANEL, SPI_TPUSER, 1) WRITE (CR,'alle Progs abgebrochen') ENDIF SELECT_TPE('MASTER',STATUS) IF (STATUS<>0) THEN FORCE_SPMENU (TP_PANEL, SPI_TPUSER, 1) WRITE (CR,'Error Status:',STATUS, '') WRITE (CR,'Prog konnte gefunden(') WRITE (CR,'angewaehlt werden') POST_ERR(STATUS,'',0,2) else FORCE_SPMENU (TP_PANEL, SPI_TPUSER, 1) WRITE (CR,'Master angewaehlt') ENDIF ABORT END ABORTALL
-
addendum:
if you want to kill an explicit task, even if the task does not "want" it, you have to abort it by calling it by name:Code... task_name = 'VISION_INTERFACE'-- <-- kill VISION_INTERFACE force_Sw = TRUE -- <--force_sw , if true, specifies to abort a task even if the task has the ‘‘ignore abort request’’ set.--> force_sw is ignored if task_name is ’*ALL*’ cancelm_sw = TRUE-- <--cancel_mtn_sw specifies whether motion is canceled for all groups belonging to the specified task. WRITE (CHR(128)) ABORT_TASK(task_name,force_Sw,cancelm_sw,STATUS) ...