RobotStudio event

what is the delay time of an alias signal

I have an alias signal, that I set in rapid.
I needs to be sure, that the signal is set, so another task can response to it, before continue in the current task.

What is the delaytime, before the other task can read the value of the signal and can I use:
            Set sdoBlockMag;
            WaitDO sdoBlockMag,1;    
            bLidReady{MagNo}:=FALSE;
and be sure, that "bLidReady{MagNo}:=FALSE;" is not executed, before another task can see the updated value of sdoBlockMag?
Tagged:

Answers

  • lemster68
    lemster68 ✭✭✭
    Have the other task set a signal acknowledging that it sees the change of state.  Or use TestAndSet function for boolean flag.
    Lee Justice
  • I would perhaps use traps in the other task to monitor sdoBlockMag and set a bool variable that is shared between task:

    TASK 1:
      PERS bool bBlockMag; ! This is the shared variable between tasks

      PROC rMyProc
        bBlockMag:=FALSE; ! Reset shared var to ensure fresh update from TASK 2
        Set sdoBlockMag;
        WaitUntil bBlockMag;
        bLidReady{MagNo}:=FALSE;
        bBlockMag:=FALSE; ! Reset shared var to avoid wrong logic going forward
      ENDPROC



    TASK 2:
        LOCAL VAR intnum iMonitorBlockMag;
        PERS bool bBlockMag:=FALSE; ! This is the shared variable between tasks
        
        
        PROC rConnectTrap()
            IDelete iMonitorBlockMag;
            CONNECT iMonitorBlockMag WITH tBlockMag;
            ISignalDO sdoBlockMag,1,iMonitorBlockMag;
        ENDPROC
        
        TRAP tBlockMag
            ! ..............
            ! Do your logic here
            ! .................

            bBlockMag:=TRUE;
        ENDTRAP