Select and Start program by C++ program.

  • Good afternoon!


    I am developing a aplication with C++ :uglyhammer_2: and I would like to select a program and start the robot with my aplication. Is this possible? Can I use the external automatic mode and write the value in any variable to select and start?


    :grinser043:


    Tiago / Brazil

    Tiago / Brazil

  • Schritt für Schritt zum Roboterprofi!
  • hi Tiago,
    sorry about, but i have to disappoint you. The reason is the safety ( eg. single point of control, ..).
    The nesessary variables (eg. $ext_start, $drives_on,..) to control the ExternalAutomatic interface are write proteced by the kernel system.
    You are able to set these variables only by use real digital inputs.


    LindePaul / Germany

    Wer nach allen Seiten offen ist kann nicht ganz dicht sein

  • Well, your C-program can't run on the Kuka-PC. There are just not enough ports available. But thats OK, because it looks much more complex to have two PCs with two screens on the desk :zwink:


    Then you have to use the soft-SPS which is build into the Kuka to receive RS232 messages, start robot-routines (written in KRL) and response to the second PC via RS232. Just build your own protocol for this, for example:
    Lets assume you only want to start diffwerent routines which do not have a parameter (you can still expand the protocol). Then you can use a message header like 0xFFFF, then a content (the number of the routine to start), which you could send several times for security-reasons (the robot only starts if the numbers are the same) and an "message end" flag, for example 0xFFFE or wahtever.
    So to start routine Nr1 you would send:
    0xFF010101FFFE
    If the three ones reach the robot it would start. If the robot receives something else it would response with an error.
    The robot could answer by cyclic sending its state,
    0x00 for "idle",
    0x01 for "working on a routine",
    0x2 for "error Nr1" etc.


    If you need parameters for the routine you should use a checksum instead of sending the parameters three times, if you need more feedback of the robot (eg actual position, some analog input values or whatever) you can use a bigger response message with header, checksum and end marking.


    Just search the forum a bit, there are a lot of threads about the programming commands which can be used in KRL for this.


    As a hardware you need a special cable, where the wiring is crossed, Tx has to be connected to Rx:
    Kuka PC
    Tx----------Rx
    Rx----------Tx


    Hope that gives enough ideas to start...


    Kai

    If you and DEAD people can read Hex, how many people can read Hex?

  • Something else just got into my mind: You can also use the device-net directly to communicate. Then all error-handling is done for you, you just have to worry about that you cant really controle when which parameter is send over the bus.

    If you and DEAD people can read Hex, how many people can read Hex?

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