RobotStudio event

Sharing global variable between multiple tasks

Options
Hello to all, I would need some help regarding rapid programming. If we have two or more tasks how can we share some bool variable between them, where to declare them, since they are visible only in task in which they are created. Thanks in advance.

Comments

  • DanLars
    Options
    Hi Pacijent,

    I think if you declare it like:

    PERS BOOL yourName := FALSE;

    In your main task and like:

    PERS BOOL yourName;

    In all the other task, it should be the same value across all tasks.

    Hope it will work :)

    Regards, Lars
    Lars Glud
    Danrob A/S
  • pacijent
    Options
    Thanks a lot Lars, that works :).
  • ljung
    Options
    It does not seems to work with a clock.
  • ashu
    Options
    Persistent declaration is not allowed in routine"error
  • daguilar
    Options
    You need to declare PERS out of the routine, as a global, in all the tasks you want to share with. That works fine. 


    Un saludokind regards,


    Daniel Aguilar

    Automation Engineering