KAREL Frage

  • Hallo zusammen
    ich programmieren seit einigen Jahren ABB, nun haben wir eine FNAUC-Roboter und würde mich gerne mit KAREL
    ausseinander setzten.
    Kann mir jemand einen Ansatz geben wie ich mit Karel ein TP Programm


    kopiere - umbenne - lösche - speichere


    Hab selbst getestet:


    PROGRAM TP_delete
    ------------------------------------------------------------------------


    ------------------------------------------------------------------------
    %NOLOCKGROUP


    %NOPAUSE = ERROR + COMMAND + TPENABLE


    %NOABORT = ERROR + COMMAND + TPENABLE


    %NOBUSYLAMP
    VAR
    prog_name : STRING[12] -- The program name to save
    STATUS : INTEGER -- The status returned from the built-in calls


    -----------------------------------------------------------------------


    BEGIN


    ------------------------------------------------------------------------
    prog_name = 'ABSAUGUNG.tp'


    WRITE (CHR(128),CHR(137))
    DELETE_FILE(prog_name, FALSE,STATUS)
    WRITE TPDISPLAY ('Ich lösche eine TP.',CR)
    WRITE TPDISPLAY (CR,CR,CR)


    END TP_delete


    WAS passt hier nicht ?


    Grüsse
    Bruster

    Einmal editiert, zuletzt von bruster ()

  • ANZEIGE
  • ein TP-Programm namens prog_name.tp wird gelöscht, ABER nur, wenn es aborted ist und nicht gerade in einem EDIT-Bildschirm aktiv ist.

    Wolfram (Cat) Henkel

    never forget Asimov's Laws at the programming of robots...

    "Safety is an integral part of function. No safety, no production. I don't buy a car without brakes."


    Messages und Mails mit Anfragen wie "Wie geht das..." werden nicht beantwortet.

    Diese Fragen und die Antworten interessieren jeden hier im Forum.


    Messages and Mails with questions like "how to do..." will not be answered.

    These questions and the answers are interesting for everyone here in the forum.

  • danke
    aber irgenwie funtzt das nicht
    ein TP wird kopiert, umbenannt und dann gestartet aber die alte nicht gelöscht


    A_3 kopieren in A_3_1 ( funktioniert)
    A_3 löschen ( funktioinier nicht)




    PROGRAM TP_COPY
    ------------------------------------------------------------------------


    ------------------------------------------------------------------------
    VAR
    prog_name : STRING[12] -- The program name to save
    STATUS : INTEGER -- The status returned from the built-in calls
    prog_index : INTEGER
    -----------------------------------------------------------------------


    BEGIN


    ------------------------------------------------------------------------
    prog_name='A_3'


    COPY_TPE(prog_name,prog_name +'_1',TRUE, STATUS)


    FORCE_SPMENU(TP_PANEL,SPI_TPUSER,1) -- USER Anzeige an TECHPAD nach vorne


    WRITE TPDISPLAY (CHR(128),CHR(137)) -- USER Anzeige an TECHPAD leeren


    WRITE TPDISPLAY (prog_name + '_1 wird geladen',CR)


    CALL_PROG(prog_name + '_1', prog_index) -- Programm aufrufen und starten
    -- Im PROG muss am Anfang eine PAUSE
    -- sonst startet es automatisch


    DELETE_FILE(prog_name, FALSE,STATUS)


    END TP_COPY

    Einmal editiert, zuletzt von bruster ()

  • HAllo
    tschuldigung das ich mich erst jetzt melde, hatte leider keine Zeit.
    Im Augenblick bin ich soweit das alles funktioniert, nur noch ne Frage.


    Kann ich Register von Roboter mit Karel abfragen und wie:
    ein kleines Beispiel würde helfen.


    Gruß
    Bruster

  • Hier mal vollständig:


    GET_REG Built-In Procedure
    Purpose: Gets an INTEGER or REAL value from the specified register Syntax :
    GET_REG(register_no, real_flag, int_value, real_value, status)
    Input/Output Parameters:
    [in] register_no :INTEGER [out] real_flag :BOOLEAN [out] int_value :INTEGER [out] real_value :REAL
    [out] status :INTEGER
    %ENVIRONMENT Group :REGOPE
    Details:
    • register_no specifies the register to get.
    • real_flag is set to TRUE and real_value to the register content if the specified register has a
    real value. Otherwise, real_flag is set to FALSE and int_value is set to the contents of the
    register.
    • status explains the status of the attempted operation. If not equal to 0, then an error
    occurred.



  • prog_name='A_3'


    welcher TYP? .LS .TP ?


    prog_name='A_3.TP'


    Dann sollte es klappen


    Gruß


    Steffen

Erstelle ein Benutzerkonto oder melde dich an um zu kommentieren

Du musst ein Benutzerkonto haben um einen Kommentar hinterlassen zu können

Benutzerkonto erstellen
Neues Benutzerkonto für unsere Community erstellen. Geht einfach!
Neues Benutzerkonto erstellen
Anmelden
Du hast bereits ein Benutzerkonto? Melde dich hier an.
Jetzt anmelden