Adding a background task to an S4 / S4C / S4CPlus
Suitability and pre-requisites.
A Computer.
A text editor.
Familiarity with the ABB Rapid programming environment.
Familiarity with editing system parameters.
Background.
You will want to use a routine in the background to control some aspect of the job. Routines live in Modules, Modules live in Tasks and Tasks live in the robot memory.
To see how this works we can inspect the contents of the SYS.CFG file in the robot system parameters.
The task definition.
under the section:
CAB_EXEC_HOOKS:
We see the definition.
CAB_TASKS:
-Name "MAIN" -Type "NORMAL"
Now or the module definition.
-File "ram1disk:system/project/myMain.prg" -ModName "myMain"
-Task "MAIN"
So here we see that the module is called myMain .prg. Note that this module must hold a main routine.
Also note that the module path "ram1disk:system/project/myMain.prg" is the actual location of the module on the ramdisk. This is so the module can be loaded and located at boot-up.
Now lets insert our new task
Step by step.
- Choose a name for the task.
- Choose a name for the module.
- Ensure that the module contains a main routine.
- Add the necessary declarations to the SYS.CFG.
- Load the module into the correct path on the ramdisk.
- Re-Load the modified SYS.CFG
- Make a restart
- Make a P-Start (press 2-5-8 on the TPU)
The P-Start will load all tasks and modules dictated by the SYS.CFG.
Assuming our modules have no errors then all is well.
Lets add a task called myBackTask and a module called myBackMod.
The resulting SYS.CFG should look something like:-
In
CAB_TASKS:
- Name "myBackTask" -Prog 1 -Task_in_forground "MAIN" - TrustLevel "None"
Now for the module declaration
As always ensure that you make a back up and resort to the correct ABB documentation and/or attend an ABB training course.
|