Posts by rankingofficer

    Just for reference, if you want to know how many PR's you currently have you can use the Karel code below. The integer variable 'max_pr_num' will have the number of PR's.


    GET_VAR(entry, '*POSREG*' ,'$MAXPREGNUM', max_pr_num, status)

    -- Set pendant display to three screens:

    -- program select, robot io and current position.


    FORCE_LINK(TP_PANEL,'CONFIG=TRIPLE') -- Set to 3 screens


    -- If currently not triple screen layout, give it time to load.

    IF $UI_CONFIG.$MODE[1]<>6 THEN

    DELAY 300

    ENDIF


    FORCE_LINK(TP_PANEL,'PRIM=MENUPAGE,71,1') -- Select program screen

    FORCE_LINK(TP2_PANEL,'DUAL=IOPAGE,107,1,OUT,4') -- Robot output screen with no. 4 selected

    FORCE_LINK(TP3_PANEL,'TRIPLE=MENUPAGE,33,1') -- Current robot position screen

    FORCE_LINK(TP_PANEL,'FOCUS=PRIM') -- Set focus to left screen,

    Below I show you how to pass arguments from Karel to Karel, not sure if you can pass arguments from Karel to TP.


    In Karel you cannot pass arguments from one Karel program to another Karel program exactly like you do in a TP program eg CALL GET_AREA(2,5);


    The answer is to use the ROUTINE function. This function is surprisingly well explained in the Karel reference manual.


    The examples below show the basic concept:


    Program MATH_LIB

    ROUTINE GET_AREA(length: REAL; width: REAL; area: REAL)

    BEGIN

    area = length * width

    END GET_AREA


    BEGIN

    --Main body of program.

    -- Can be empty

    END MATH_LIB



    Program TEST

    VAR

    area: REAL

    --declare the routine like it is a variable

    ROUTINE GET_AREA(length: REAL; width: REAL; area: REAL) FROM MATH_LIB


    BEGIN

    GET_AREA(2,2,area) -- pass 'area' by reference

    WRITE(’Area = ’, area, CR) -- Print: Area = 4

    END TEST


    Note you can also make the ROUTINE return a value, instead of passing a variable by reference. eg.


    ROUTINE GET_AREA(length: REAL; width: REAL) : REAL

    VAR area: REAL

    BEGIN

    area = length * width

    RETURN (area)

    RETURN (length * width) -- Maybe this works too

    END GET_AREA


    Program TEST2

    VAR

    area: REAL

    ROUTINE GET_AREA(length: REAL; width: REAL) : REAL FROM MATH_LIB


    BEGIN

    area = GET_AREA(2,2) -- Returns a number

    WRITE(’Area = ’, area, CR) -- Print: Area = 4

    END TEST2

    I guess the question i am getting at is, when the robot sees and e-stop, the robot controller does not prevent the robot i/o (ee connector) from toggling. So to keep the gripper safe while in an e-stop condition, the only way i can see to prevent the gripper actuation is to use an interposing safety contact between gripper and the ee connector. But i can't believe this is the way that other provide a safety barrier for the gripper...


    Hey nerd484, did you find a good answer to this question? I am trying to do the same thing. Thanks.

Advertising from our partners