SWITCH command

  • Hello all

    KSS V4.1.5


    In a position robot waits for three different inputs: $IN [2] OR $IN[6] OR $IN[7]


    I defined three inputs like this:

    SIGNAL choiise $IN[2] to $IN[7]


    So after the WAIT command, I wrote this:


    SWITCH choiise

    Case 1

    :

    Case 2

    :

    Case 3

    :

    DEFAULT

    :

    ENDSWITCH


    My problem:


    SWITCH just works for Case 1 related to $IN[2] and for other cases program jumps to the DEFAULT. I think the problem backs to the number of the cases. maybe I must change the number 2 and 3 .


    thanks for any help

    Edited 2 times, last by Robotmei ().

  • those inputs need to be together.. no gap... then it makes sense to create and evaluate mentioned signal.


    now you have signal encompass also inputs 3,4,5 which should not be there. this means you need to consider possible non-zero values at those inputs which complicates things.

    i would suggest two swap inputs 2 and 5, or 2 and 8 so that inputs making up signal are grouped.


    alternatively


    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners