Karel-Hilfsprogramchen

  • @ heini0707
    sooo schlecht ist das handbuch nun auch wieder nicht.
    schau mal nach OPEN FILE und READ.
    Wollte ja dein prog nicht kritisieren, sollte nur ein denkanstoß sein.
    Dachte du hast spass an karel und willst dein prog weiterentwickeln.

  • ANZEIGE


  • Hallo,
    ist zwar schon etwas länger her, aber weiss jemand wie ich mit der Funktion "SET_PORT_CMT"auch GIN und GOUT ansprechen kann?
    in der Doku habe ich nur folgendes gefunden:

    Code
    port_type specifies the code for the type of port whose comment is being returned. Codes are
    defined in FR:KLIOTYPS.KL.


    Hat jemand eine Auflistung von port_type, bzw. wo finde ich diese KLIOTYPS Datei?


    Gruß Chili1886

  • Hallo Chilli,


    gefunden hatte ich diese Auflistung schon mal. Nur leider gerade nicht mehr greifbar.
    Für eine andere Anwendung habe ich die GI bzw GO mal so abgefragt


    if (IOType = io_gpin) then ...
    bzw.
    if (IOType = io_gpout) then ...


    wobei IOType als Integer deklariert ist.
    Probiere es doch einfach mal damit und suche mit dem Variablennamen io_gpin in der Doku ob da eine Tabelle zu finden ist.



    Gruß und schönes Wochenende
    Thilbi

  • --
    -- This material is the joint property of FANUC Robotics North America and
    -- FANUC LTD Japan, and must be returned to either FANUC Robotics North
    -- America or FANUC LTD Japan immediately upon request. This material and
    -- the information illustrated or contained herein may not be reproduced,
    -- copied, used, or transmitted in whole or in part in any way without the
    -- prior written consent of both FANUC Robotics North America and FANUC LTD
    -- Japan.
    --
    -- All Rights Reserved
    -- Copyright (C) 1993
    -- FANUC Robotics North America
    -- FANUC LTD Japan
    --
    -- +
    -- Include File: kliotyps - Constants defining I/O types (IOSETUP.KE)
    --
    -- Dependancies: Based on IOTYPDEF.HC
    --
    -- Language: KAREL
    --
    -- Source File: kliotyps.kl 13-JAN-92 02:31PM
    --
    -- Author: BRYCETK
    -- FANUC Robotics North America
    -- 2000 South Adams Road
    -- Auburn Hills, Michigan 48326-2800
    --
    -- Modification history:
    --




    CONST
    io_all = 0 -- Any I/O type
    io_din = 1 -- Digital input
    io_dout = 2 -- Digital output
    io_anin = 3 -- Analog input
    io_anout = 4 -- Analog output
    io_tool = 5 -- Tool output
    io_plcin = 6 -- PLC input
    io_plcout = 7 -- PLC output
    io_rdi = 8 -- Robot digital input
    io_rdo = 9 -- Robot digital output
    io_brake_out = 10 -- Brake output
    io_opin = 11 -- operator panels input
    io_opout = 12 -- operator panels output
    io_sopin = 11 -- Same as io_opin
    io_sopout = 12 -- Same as io_sopout
    io_estop = 13 -- Emergency stop
    io_tpin = 14 -- Teach pendant digital input
    io_tpout = 15 -- Teach pendant digital output
    io_wdi = 16 -- weld inputs
    io_wdo = 17 -- weld outputs
    io_gpin = 18 -- Grouped inputs
    io_gpout = 19 -- Grouped outputs
    io_uopin = 20 -- User operator's panel input
    io_uopout = 21 -- User operator's panel output
    io_ldin = 22 -- laser DIN
    io_ldout = 23 -- laser DOUT
    io_lain = 24 -- laser AIN
    io_laout = 25 -- laser AOUT
    io_wstk_in = 26 -- weld stick input
    io_wstk_out = 27 -- weld stick output
    max_log_port = 27


    -- physical only
    io_mem_boo = 28 -- memory image boolean's
    io_mem_num = 29 -- memory image din's
    io_dummy_boo = 30 -- dummy boolean port type
    io_dummy_num = 31 -- dummy numeric port type
    max_phy_port = 31


    io_min_type = 1 -- same as io_din
    io_max_type = 27 -- same as max_log_port

    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.

  • im Karel-Paket von 1998....

    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.

  • hier mal die aktuelle version:


    --
    -- This material is the joint property of FANUC Robotics North America and
    -- FANUC LTD Japan, and must be returned to either FANUC Robotics North
    -- America or FANUC LTD Japan immediately upon request. This material and
    -- the information illustrated or contained herein may not be reproduced,
    -- copied, used, or transmitted in whole or in part in any way without the
    -- prior written consent of both FANUC Robotics North America and FANUC LTD
    -- Japan.
    --
    -- All Rights Reserved
    -- Copyright (C) 1993
    -- FANUC Robotics North America
    -- FANUC LTD Japan
    --
    -- +
    -- Include File: kliotyps - Constants defining I/O types (IOSETUP.KE)
    --
    -- Dependancies: Based on IOTYPDEF.HC
    --
    -- Language: KAREL
    --
    -- Source File: kliotyps.kl 13-JAN-92 02:31PM
    --
    -- Author: BRYCETK
    -- FANUC Robotics North America
    -- 2000 South Adams Road
    -- Auburn Hills, Michigan 48326-2800
    --
    -- Modification history:
    --




    CONST
    io_all = 0 -- Any I/O type
    io_din = 1 -- Digital input
    io_dout = 2 -- Digital output
    io_anin = 3 -- Analog input
    io_anout = 4 -- Analog output
    io_tool = 5 -- Tool output
    io_plcin = 6 -- PLC input
    io_plcout = 7 -- PLC output
    io_rdi = 8 -- Robot digital input
    io_rdo = 9 -- Robot digital output
    io_brake_out = 10 -- Brake output
    io_opin = 11 -- operator panels input
    io_opout = 12 -- operator panels output
    io_sopin = 11 -- Same as io_opin
    io_sopout = 12 -- Same as io_sopout
    io_estop = 13 -- Emergency stop
    io_tpin = 14 -- Teach pendant digital input
    io_tpout = 15 -- Teach pendant digital output
    io_wdi = 16 -- weld inputs
    io_wdo = 17 -- weld outputs
    io_gpin = 18 -- Grouped inputs
    io_gpout = 19 -- Grouped outputs
    io_uopin = 20 -- User operator's panel input
    io_uopout = 21 -- User operator's panel output
    io_ldin = 22 -- laser DIN
    io_ldout = 23 -- laser DOUT
    io_lain = 24 -- laser AIN
    io_laout = 25 -- laser AOUT
    io_wstk_in = 26 -- weld stick input
    io_wstk_out = 27 -- weld stick output
    io_mem_boo = 28 -- memory image boolean's
    io_mem_num = 29 -- memory image din's
    io_dummy_boo = 30 -- dummy boolean port type
    io_dummy_num = 31 -- dummy numeric port type
    io_proc_axes = 32
    io_iopin = 33 -- Internal operator's panel input
    io_iopout = 34 -- Internal operator's panel output
    io_flag = 35 -- Flag (F[ ])
    io_marker = 36 -- Marker (M[ ])


    max_log_port = 36


    -- physical only
    io_keep_rly = 41 -- Backuped internal relay
    io_rly = 42 -- No backuped internal relay
    io_keep_reg = 43 -- Backuped internal register
    io_reg = 44 -- No backuped internal register


    max_phy_port = 44


    io_min_type = 1 -- same as io_din
    io_max_type = 44 -- same as max_log_port



  • Nur leider geht der Roboter damit nicht in Störung :(


    Hat da jemand ne Idee :huh: :denk:

  • PROGRAM ALARMA
    %NOLOCKGROUP


    VAR
    param_no,
    par_typ,
    par_int,
    part_no,
    status : INTEGER
    par_real : REAL
    par_str,
    screen_ : STRING[80]


    BEGIN


    status=0
    param_no=1
    -- Variablen vom Aufruf lesen
    get_tpe_prm(param_no,par_typ,par_int,par_real,par_str,status)
    IF (par_typ=1) AND (status=0) THEN --INTEGER
    WRITE TPERROR(par_int,CR)
    ENDIF
    IF (par_typ=2) AND (status=0) THEN --REAL
    WRITE TPERROR(par_real,CR)
    ENDIF
    IF (par_typ=3) AND (status=0) THEN --STRING
    WRITE TPERROR(par_str,CR)
    ENDIF
    PAUSE --unterbricht das Programm bis start wieder kommt
    --alternativ warte auf INPUT(Stoerquittung) oder was auch immer...
    END ALARMA

    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 Wolfhenk,


    Oh man(n) wie einfach :wallbash:


    Kann man die Error Lampe auf dem Kontroller auch noch ansteuern :huh:


    oder gibt es einen Befehl der den Roboter anhält als wenn er einen ERROR hätte also Lampe an und Störausganggesetzt??


    Gruß
    Dirk

  • -- ==========================================================================
    -- UoP-Eingänge
    -- ==========================================================================


    uop_estop = 16 -- Not Aus (IMSTP)
    uop_hold = 17 -- Roboter Stop/halt (Hold)
    uop_sfspd = 18 -- Safety Fence Schutzzaun geschlossen
    uop_abort = 19 -- Programmabbruch (C_Stop)
    uop_reset = 20 -- Stoerungsquittung (Fault Reset)
    uop_cstart = 21 -- Programmstart (Cycle Start)
    uop_home = 22 -- Roboter fährt auf die Home-Position
    uop_remote = 23 -- Remote Control enabled (Enbl)


    -- ==========================================================================
    -- UoP-Ausgänge
    -- ==========================================================================


    uop_cmdenbl = 16 -- Command Enable -> Remote Control
    uop_ready = 17 -- System Ready Signal
    uop_progrun = 18 -- Programm laeuft
    uop_pause = 19 -- Programm im Pausezustand
    uop_held = 20 -- Roboter mit Hold gestoppt
    uop_fault = 21 -- Robotersammelfehler
    uop_atperch = 22 -- nicht aktiv (Shell)
    uop_tp_on = 23 -- Teach Pendant eingeschaltet

    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.

    Einmal editiert, zuletzt von WolfHenk ()

  • Danke,


    aber wie binde ich das ein???


    Auch über SET_PORT_VAL( ???


    Finde nix in meiner Doku und die ist von 2003 (MARAIKLRF06031E REV A)


    Gibt es da etwas neueres????


    Gruß
    Dirk

  • Sieh mal unter UOP und Ausgänge schalten...


    OPOUT[uop_fault] = ON


    kann aber sein, dass du das net nehmen kannst weil das system den immer gleich wieder wegnimmt... musst du mal testen

    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.

    Einmal editiert, zuletzt von WolfHenk ()

  • Stimmt das System nimmt den Direkt wieder weg, zumindest in Roboguide.


    Und seinen SET Befehl habe ich nicht gefunden.


    Habe dann mal den ganz normalen DO gesetzt und das geht. Aber wie bekomme ich die Lampen an????? :denk:

  • welche lampen?

    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.

  • diese Lampen haben Ausgangsbezeichnungen wie UOPOUT oder SOPOUT. Schau mal in Deinen IOs nach (menu,5,typ)

    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.

  • Hi,


    zu dem Helferchen Trigonomie-Funktionen (SIN,...) das angeführt ist:


    Hier können nur REAL als Input gegeben werden! Also nur Kommarzahlen.


    Sollte es mal eine Ganzzahl sein (INT), dann hast du als Rückgabewert nur 0 oder 1.


    Ich hab mir erlaubt er zu erweitern, damit es bei beiden eine Rückgabewert gibt (Ganzzahl oder Kommarzahl).


    PROGRAM tri_sin
    %ALPHABETIZE
    %COMMENT = 'Ausrechnen SINUS'
    %NOLOCKGROUP


    VAR
    r_WINKEL_int : INTEGER --Winkel vom HP
    r_WINKEL_rea : REAL --Winkel vom HP
    i_WERTPAR : INTEGER --Parameternummer vom HP,
    --wo der ausgerechneter Wert abgespeichet werden soll
    r_WERT : REAL --ausgerechneter Wert


    test : BOOLEAN
    data_type : INTEGER -- Datatype
    int_value : INTEGER -- Rueckgabe des Integerwert in Register
    real_value : REAL -- Rueckgabe des Realwertes in Register
    status : INTEGER -- Statusvariable von Build In Routinen
    string_value : STRING[80] -- Stringwert


    BEGIN


    -- tri_sin(r_WINKEL,i_WERTPAR)


    -- get parameter 1 int, Ganzzahl
    GET_TPE_PRM(1, data_type, r_WINKEL_int, real_value, string_value, status)

    -- get parameter 1 real, Kommarzahl
    GET_TPE_PRM(1, data_type, int_value, r_WINKEL_rea, string_value, status)

    -- get parameter 2
    GET_TPE_PRM(2, data_type, i_WERTPAR, real_value, string_value, status)


    r_WERT = SIN(r_WINKEL_int) -- Wert ausrechnen

    IF r_wert = 0 THEN

    r_WERT = SIN(r_WINKEL_rea) -- Wert ausrechnen

    ENDIF


    IF r_wert = 1 THEN

    r_WERT = SIN(r_WINKEL_rea) -- Wert ausrechnen

    ENDIF

    SET_REAL_REG(i_WERTPAR, r_WERT, status) -- Setzen in Register... den ausgerechneten Wert


    END tri_sin


    Viel Spass damit.

  • Hallo,


    Ich schalte beim Umschalten von Automatik <-> Manuell den Stepmodus aus/ein


    ---------------------------------------------------------------------------------------------------------------
    ROUTINE setStepMode(state : BOOLEAN)
    VAR
    nValue : INTEGER
    BEGIN
    IF(state)THEN
    nValue = 1 -- StepModus ausschalten
    ELSE
    nValue = 0 -- StepModus einschalten
    ENDIF
    $SSR.$SINGLESTEP = nValue -- StepMode ein/aus
    SET_PORT_VAL(io_tpout, 3, nValue, STATUS) -- Oberfläche Signalisierung Step anpassen
    IF (STATUS <> SUCCESS) THEN
    logMsg('')
    ENDIF
    END setStepMode
    ---------------------------------------------------------------------------------------------------------------


    Um die Signallampen der Statusleiste manipulieren den Befehl


    SET_PORT_VAL(io_tpout, nLampe, nVal, STATUS)


    bemühen
    !!!! es sind nur die Lampen !!!!


    welche Lampe zu welcher nLampe werden muss ist reine Probierarbeit.
    die 3 ist wie oben im Beispiel die STEP Lampe
    Viel Spaß

    Der Besitz der Weltherrschaft wird überbewertet.

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