How to make a procedure run in the background in robotstudio.

Robero
Robero Mölndal
Hi,

I need help to understand how to create a procedure to run in the background.
I have been trying to find step by step on how to make a background task, reading manuals but I just don't get it. Is there anyone out there who can make a step by step guide on how to make it?
 Just to make it easy, just use TPwrite ''ok''; while another program is ongoing.
I would be so greteful for this.
Thanks!!

Comments

  • graemepaulin
    graemepaulin New Zealand mod
    First you will need the option MultiTasking - do you have that on your system?
  • Maxim Riabichev
    Maxim Riabichev Sweden admin
    Here's the quick and dirty guide:

    1. Create a station with a VC.
    2. Go to Controller tab.
    3. Open up the Configuration of the controller, and find the Controller section.
    4. In the Controller section, select Task.
    5. Right-click on the right-side (where you see T_ROB1), and select New Task...
    6. Name it whatever you like, and select Type (either Static or Semistatic for a BG-task)
    A STATIC task gets restarted at the current position of the robot when the system was powered off.
    A SEMISTATIC task gets restarted from the beginning whenever the power is turned on.
    A SEMISTATIC task will also initiate the restart sequence, reload modules specified in the system parameters if the module file is newer than the loaded module.

    7. Set TrustLevel to No Safety, or as your needs specify.
    (Background tasks of type Static and Semistatic with the TrustLevel set to NoSafety only can be started and stopped. For detailed information about the different TrustLevel values, see the Technical reference manual - system parameters.)

    8. Warmstart the controller.

    That should do it.

    Maxim Riabichev
    PC Software Support Engineer
  • Robero
    Robero Mölndal
    Thank you so much for the answer. graemepaulin yes we have that option.
    Maxim Riabichev thanks again for your reply. How can I link my code to the task that should run in the background?

  • Maxim Riabichev
    Maxim Riabichev Sweden admin
    The background task would have its own RAPID modules:





    Maxim Riabichev
    PC Software Support Engineer
  • Robero
    Robero Mölndal
    Ahh it showed up after I restarted the controller. I had no idea that it would behave like that. You learn something new everyday. Many thanks.
  • lemster68
    lemster68 United States ✭✭✭
    You could also make the task Normal as you begin, it makes debugging easier.  Then change the task type to one of the others when you are satisfied that your code is robust enough.
    Lee Justice
  • Robero
    Robero Mölndal
    lemster68 thanks for the hint.