Calling a program on the robot via mxAutomation

  • Hello, more of a general question about mxAutomation. I am looking to use mxA in a hybrid capacity, meaning the programs would be made on the teach pendant and called via a PLC. For simple applications I could just use the cell.src file and just call programs that way, but I would like to have more control and visibility from the PLC in this complex application. Looking through the Logix Library manual I do not see a function block that appears to call a program directly, is there a sequence of function blocks that would call programs? Or would I have to implement the cell.src program with this hybrid setup?

  • Thanks panic mode! With mxA installed I imagine we could use most of the other functionality, such as message generation, function block for calling brake tests, calling mastering tests and so on, but still use cell.src to call the programs made on the teach pendant

  • with MXA installed, several things get tied into system behavior. to make it hybrid, one would need to work through code and make changes that allow new behavior. i am afraid you are on your own here.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • There are functions called KRC_writesysvar() within the MxA library, you have to define the index number for this function and then write your own case switching code inside mxa_sysvar.src on you robot controller to call out specific modules.

    Of course, you also need to reset the trigger signal for KRC_writesysvar() on your PLC(or anything else) to make it run after activation.

  • There are functions called KRC_writesysvar() within the MxA library, you have to define the index number for this function and then write your own case switching code inside mxa_sysvar.src on you robot controller to call out specific modules.

    Of course, you also need to reset the trigger signal for KRC_writesysvar() on your PLC(or anything else) to make it run after activation.

    Could you give more details about it? We are also recently need to use this feature. Thank you.

  • I would also like to use MxAutomation PLC functions alongside user-written modules on the robot controller. I realize this is out-of-bounds territory, but like Ben014 is suggesting, I'm thinking of using the KRC_writesysvar PLC function to call the mxA_WriteSysVar() function defined inside mxa_sysvar.src.

    (MxAutomation Version 3.1.1)


    I'm incapable of testing at this moment in time, but I think I could simply add more cases and use the index as my PGNO of sorts.

    Code
    case 2 
          user_prog1()
    case 3
          user_prog2()


    For context, I am still using the KRC_AutomaticExternal and KRC_AutoStart PLC functions like normal and expect this to place the system inside the MxA base routine, in which case the KRC_writesysvar function will be called from time to time to run motion programs. I'm really just bumping the thread hoping someone here has some experience getting this to work reliably. Otherwise, I'll trudge on and share what I find :smiling_face:

  • Update:

    Doing the above didn't work because, vaguely speaking, the current operating state only allows for KRC_writesysvar to use the index "1". Adding more "system variables" is a conversation with KUKA.

    Next, I tried to call a test program in case 1:

    Code
    case 1 ;$ADVANCE
          ;ON_ERROR_PROCEED
          ;nAdvance = Values[1]
          ;$ADVANCE = nAdvance
           test1 ()
       ;FOLD USER WRITESYSVAR
       ;ENDFOLD (USER WRITESYSVAR)


    I run this. The SPS submit goes Red, I get the alarms:
    KSS01425 "Instruction sint() inadmissible (Module: IR_STOPM Line: 22)"
    KSS01388 "$ACC_AXIS variable write-protected in module BAS, line 418"

    In test1.src I removed the INI instruction, splines, and inline forms, going from

    Code
    INI
    SPTP HOME Vel=100 % DEFAULT 
    PTP P1 Vel=100 % PDAT1 Tool[1] Base[0] 
    SPTP HOME Vel=100 % DEFAULT 

    To

    Code
    PTP XHOME
    PTP XP1
    PTP XHOME

    Ran that, submit goes red again and I'm left with just

    KSS01425 "Instruction sint() inadmissible (Module: test1 Line: 2)"

    Does this mean XP1 is not globally initialized? I wish the KRC could speak English.

  • Scratching this concept, is possible to run the cell.src program with KRC_AutomaticExternal PLC function? I find that it actually enters the cell program, but the standard configured signals for PGNO and PGNO_VALID displayed from the SmartPAD don't seem to work, I assume because they're now part of the 2032 digital IO required by MxA.

    Edited once, last by asharpe ().

  • Scratching this concept, is possible to run the cell.src program with KRC_AutomaticExternal PLC function? I find that it actually enters the cell program, but the standard configured signals for PGNO and PGNO_VALID displayed from the SmartPAD don't seem to work, I assume because they're now part of the 2032 digital IO required by MxA.

    The PGNO and PGNO-related signals come with a default setting from the factory, but you always need to configure them. You'll also need to configure PGNO_TYPE, PGNO_REFLECT, PGNO_FBIT, PGNO_LENGTH, PGNO_PARITY... this is all in the Configuration manual. PGNO has a lot of customizable options.


    But, bottom line, you set the various PGNO variables to the same $INs and $OUTs your MxA program is using, and you should be able to set up and use CELL.SRC to call your various production programs.

  • i do not see why would one use mxA to actually run non-mxA programs . but suppose one may want to do that... so, why not use existing concept and just extend it?


    have not looked into mxa in years but supposedly there is mxA_CommandDispatcher that is selected and started when robot is in EXT mode. one step is already solved. and through DoCommandQueue() this calls DoCommand(). commands are enumerated through CmdID and predefined cases are in mxa_Config.dat (MXA_CMD)


    so one could add another case such as mxaRunRobotProg...


    or one could have variable that controls if the mxA_CommandDispatcher is to be selected or some alternative program (which may be Cell.src or something else)



    and that again brings back the question - if you can do this, why bother using MXA at all?

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners