Howto use EKI_SetFrame with Ethernet KRL package (solution)

  • Hi everyone.
    This is just a solution to "How to send a FRAME with EthernetKRL" which i and also others seem to have stumbled upon.


    E.g. SkyeFire wrote some time ago:

    Quote


    As an aside, as part of this same program, I was trying to send a FRAME variable across, but the EKI_SETFRAME didn't seem to work properly. Even though the variable type in the XML config was Type="FRAME", the EKI_SETFRAME kept failing with an "element not found" error (Status.MSG_NO=16). But when I broke up the Frame into 6 separate Reals, and sent them across using SETREAL and GETREAL, using an identical data structure, everything worked perfectly. Also puzzling.


    After contacting KUKA support it turns out the docs are not complete here. :waffen100:


    The solution:


    (1)
    In the <SEND> <XML> structure in the XML-config file for EthernetKRL connections no TYPE should be given as opposed to the Tags in the <RECEIVE> section, i.e.

    Code
    <ELEMENT Tag="mygroup/myInt" Type="INT"/>


    should read

    Code
    <ELEMENT Tag="mygroup/myInt"/>


    (2)
    When specifying a FRAME one MUST specify XYZABC as attributes:

    Code
    <SEND><XML>
    <ELEMENT Tag="mygroup/myFrame/@X"/>
    <ELEMENT Tag="mygroup/myFrame/@Y"/>
    <ELEMENT Tag="mygroup/myFrame/@Z"/>
    <ELEMENT Tag="mygroup/myFrame/@A"/>
    <ELEMENT Tag="mygroup/myFrame/@B"/>
    <ELEMENT Tag="mygroup/myFrame/@C"/>
    </XML></SEND>


    and THEN

    Code
    EKI_SetFrame("mychannelname", "mygroup/myFrame", {X 1, Y 2, Z 3, A 4, B 5, C 6})


    SetFrame funtion then disassembles the FRAME and distributes its values to the xyzabc buffers...

Advertising from our partners