User defined Variable - Check status/value

  • Hi ALL


    I declared and initialized a BOOL in config.dat as follows:


    BOOL BUSY_STATUS = TRUE


    I want to use this in the SPS as follows:


    IF $IN[1]==TRUE AND BUSY_STATUS THEN ;

    $OUT[1]=TRUE

    ENDIF


    Is it possible to check the value/status of the BOOL ? or is the code wrong ?


    Thanks


    The Robot Info:

    KRC V5.4.11

    Kernel: KS V5.4.83 RTAcc

    Windows Version: Xpe 2006

  • Princip is OK. I would write

    Code
    IF ($IN[1]==TRUE) AND BUSY_STATUS THEN
    
    $OUT[1]=TRUE
    
    ENDIF

    Because I'm too lazy to remember the priorities of = and or....

    May be the "AND" has higher prio than "==".

Advertising from our partners