Forum Migration Notice
Update (2026-01-21): The user forums are now in read-only mode pending the data migration.

Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.

We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.

First cycle flag in Rapid

dragolollo
edited January 2023 in RobotStudio
Hello,

Is there a flag in RAPID that states if it is the first cycle after controller power on?
Thank you!
Tagged:

Comments

  • Did you ever find anything to do with first cycle? I have a few things I need to do in first cycle only too.
  • Try an event routine for Power On to run a one instruction routine that sets a PERS boolean, e.g. bFirstCycleOnly, variable TRUE.

    PROC rPowerON
    !
    bFirstCycleOnly: =TRUE;
    !
    ENDPROC

    Be sure to change state of the PERS to FALSE in your production code.

    As an idea in production code 

    PROC rFirstCycle()
    !
    IF bFirstCycleOnly THEN
    Stuff
    bFirstCycleOnly: =FALSE ;
    ELSE
    Return;
    ENDIF
    !
    ENDPROC