RobotStudio event

Reloading of a 'shared' module located in the 'Automatic Loading of Modules'.

Hi!

I've created a background task in which I've programmed a UIMsgBox and UINumEntry Procedure that controls some numerical values that is used as offsets in the main task program.
The numericals are arrays containing 8 different locations.

The data is stored in a program module, loaded from \'system_name'\home, named SysPutData.mod and which is declared as shared in the automatic loading of modules.

But when I change the values in a offline editor, how do get the controller to load the new values so that they are used in the program?
If I change the values, save the module both in the HOME-folder of the backup and in the SYSMOD-folder for Task0 (renamed *.sys) and then restore the system from that backup I don't get the values to change.
The weird thing as that if I then look in the System Directorys HOME-folder and there from open the module, the values has changed. But they ar not used inside the Rapid-program.

Hopefully I have not messed up my description to much. :)

Have a nice evening!

// Jocke.




Answers

  • A P-Start will load the module from the file on disk. It will also erase any modules you have loaded manually, but the controller will create a RECOVERY folder in the robot home directory with any modules that were erased.
  • Micky
    Micky ✭✭✭

    Hi,

    if you define your data array as a persistent in the main and in the background task, you can change your data in the main and in the background task via your UI interface.

    The data declaration in your background task should not have an initial value, so there is no problem which data are used inside your program.

     

    Example:

    MODULE MyTask

      PERS pos myPos{8};

    ENDMODULE

    MODULE MyMainTask

      PERS pos myPos{8}:=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]];

    ENDMODULE

    if you use the persistant you can reload your module after offline changing without any further effort to get the data in both tasks

     

    /BR

    Micky

     

     

  • Thank you, both!

    I've made som changes after your answers and it seems to be working just the way I want it to.

    My best regards.

    // J.