Hello,
I have one more interpreter (called nfTasks.sub) running besides SPS.sub.
My goal is to keep nfTasks.sub constantly running. In case nfTasks.sub stops, try to revive it through a function reviveNf that is running in the main loop of SPS.
I am aware that one interpreter can start stop or reset another one (but not itself), but so far, I couldn't make it work.
My initial idea was to retrieve the state of nfTasks from $PROG_INFO[3].State. If state is #P_reset or #P_end, then restart the submit with CWRITE ($CMD, STAT, MODE, "START 3")(.
I have the following questions:
- Is it possible to have nfTasks start on boot by defining it somewhere else than under $PRO_I_O_PROC_
- CWRITE doesn't seem to run if not the command STOP 3. Is there any other way to start a submit?
Code
C_interpreterNum[] = "3"
T_nfTaskSubmitInter = $PROG_INFO[3]
B_isBgTask = STRCOMP(T_nfTaskSubmitInter.SEL_NAME[], " ", (#NOT_CASE_SENS))
IF B_isBgTask THEN
SWITCH T_nfTaskSubmitInter.P_STATE
CASE #P_FREE
; Find a way to launch nfTask if not set in custom.dat
CASE #P_RESET
; CWRITE($CMD,T_state,T_mode, "START 3")
CASE #P_STOP
CASE #P_ACTIVE
CONTINUE
CASE #P_END
SWRITE(C_command[], T_swriteState, I_offset, "%s %s", ("START"), (C_interpreterNum[]) )
CWRITE($CMD,T_state,T_mode, C_command[])
CASE #P_STOP_BP
ENDSWITCH
ENDIF
Display More
Robot: KUKA KR60-3
KR C (V8.5.7_Build0453)
KS V8.5.453