Correct Syntax Roboguide

  • IF (UO[6]=ON AND UO[8]=OFF), (DO[2]=OFF AND RO[1]=OFF AND RO[2]=OFF AND RO[3]=OFF AND RO[4]=OFF AND RO[5]=OFF AND RO[6]=OFF AND RO[7]=OFF AND RO[8]=OFF)


    What is the correct way of writing this without writing an IF statement for each one.


    Thanks,

    D

  • Provided you're on a newer controller, you could use the IF THEN statement to accomplish this.


    IF (UO[6] AND !UO[8]) THEN ;

    DO[2]=OFF ;

    RO[1]=OFF ;

    RO[2]=OFF ;

    RO[3]=OFF ;

    RO[4]=OFF ;

    RO[5]=OFF ;

    RO[6]=OFF ;

    RO[7]=OFF ;

    RO[8]=OFF ;

    ENDIF ;


    Edit: Added ! in IF clause.

  • another option that should work for older controllers is to call a program that will set all the variables to the desired state.


    IF UO[6]=ON AND UO[8]=OFF, CALL RESET_VARS


    Assign the DO and RO in the RESET_VARS TP program

Advertising from our partners