RobotStudio event

Wont load Modules Automatically

Asloan
Asloan
edited September 2023 in Developer Tools
ABB IRC5 is the controller i'm running. Having to use Vulcan software to Program, But the issue I'm having is that I loaded all these recipes into my HMI and the robot is supposed to call for them.
I start the main and send in the part but it will keep loading the same program instead of the one I want it to load. Any answers will help.


PROC LoadInitModule()
LoadModuleA;
ELSE
LoadModuleB;
Endif
EndPROC 
Post edited by Asloan on

Answers

  • I see an ELSE and ENDIF but no IF THEN.  This should cause syntax errors.  Have you posted ALL the code?
    Lee Justice
  • This is what I got back from the Company that built the station 

    (ME)  I noticed in the ProgramXFR.TXT it only has 2 modules in that which is the 2 that it will only run. I wonder if I must add the other grind modules into it? 



    (VULCAN Engineering) That file is written by the HMI. It should only ever have two lines in it. The first line is the module for side A and the second line is the module for side B. That is how the HMI tells the robot which program(s) to run.

     

    I suspect that the HMI is not able to write to that file for some reason. That would explain why the robot is always running the same module.


  • PROC LoadInitModule()

        !load module for the first time

        IF bNoPartSideA=FALSE THEN

          LoadModuleA;

        ELSE

          LoadModuleB;

        ENDIF

      ENDPROC

     

      PROC LoadModuleA()

        !Load module for Side A

        UnLoad ""\File:=ModuleNameA;

        UnLoad ""\File:=ModuleNameB;

        UnLoad ""\File:=CurrentMod;

        Load ""\File:=ModuleNameA;

        CurrentMod:=ModuleNameA;

      ERROR

        IF ERRNO=ERR_UNLOAD THEN

          TRYNEXT;

        ELSE

          TPWrite "Error In LoadModuleA Routine";

          TPWrite "Error Loading Module to Robot";

          TPWrite "Program Ended";

          Stop;

        ENDIF

      ENDPROC

     

      PROC LoadModuleB()

        !Load module for Side B

        UnLoad ""\File:=ModuleNameA;

        UnLoad ""\File:=ModuleNameB;

        UnLoad ""\File:=CurrentMod;

        Load ""\File:=ModuleNameB;

        CurrentMod:=ModuleNameB;

      ERROR

        IF ERRNO=ERR_UNLOAD THEN

          TRYNEXT;

        ELSE

          TPWrite "Error In LoadModuleA Routine";

          TPWrite "Error Loading Module to Robot";

          TPWrite "Program Ended";

          Stop;

        ENDIF

      ENDPROC

     

      PROC SpindleWarmUp()

        Get_Tool_3;

        PulseDO\PLength:=0.5,DO51_WarmUpReq;

        EXIT;

      ENDPROC


  • Now I see more of your code. There is a bit of unloading that is unnecessary. All you really need it UnLoad CurrentMod. I don't see any code in which the actual decision making is going on to load which module. I suppose in your main program?
    Lee Justice
  • This is the Main Module. Its supposed to read the module from the HMI, From the A side and the B side 
    Just cant figure out why its loading the same module no matter what I do. 


      PulseDO\PLength:=0.2,DO27_StartMain;

      ReadModuleNames;

      TPWrite"ModuleNameA:"+ModuleNameA;

      TPWrite"ModuleNameB:"+ModuleNameB;

      Stop;

      !Load Module for side A

      LoadInitModule;

      WHILE Di14_CycleRun=1 OR DOutput(DO07_Auto_ON)=0 DO

          IF DI14_CycleRun=1 THEN

            !Run the main Grind procedure

            !from the loaded module

            IF DI25_StaBinCell=1 AND bNoPartSideA=FALSE THEN

              StationToGrind:=1;

              IndexMainTable;

              !process side A

              Reset DO26_GrindingPrt;

              CallByVar "MainGrindProc",GrindNumber;

              !PulseDO\PLength:=1,DO26_GrindingPrt;

              Set DO26_GrindingPrt;

              IF bNoPartSideB=TRUE THEN

                !Index main table if there is no part

                !entered for side B

                WaitUntil DI35_LgtCrtnOK=1;

                IndexMainTable;

              ENDIF

            ELSEIF DI24_StaAinCell=1 AND bNoPartSideB=FALSE THEN

              StationToGrind:=2;

              IndexMainTable;

              !process Side B

              Reset DO26_GrindingPrt;

              CallByVar "MainGrindProc",GrindNumber;

              Set DO26_GrindingPrt;

              !PulseDO\PLength:=1,DO26_GrindingPrt;

              IF bNoPartSideA=TRUE THEN

                !Index main table if there is no part

                !entered for side A

                WaitUntil DI35_LgtCrtnOK=1;

                IndexMainTable;

              ENDIF

            ELSE

              !The station outside the cell must be no part

              !Index the table and wait for part ready

              IndexMainTable;

            ENDIF

          ENDIF

          Reset DO21_TbltoA;

          Reset DO22_TbltoB;

        ENDWHILE

  • This procedure call, ReadModuleNames; must have the logic for which module gets loaded by LoadInitModule.
    Lee Justice
  • Okay I will check out the PLC Program and go from there I just needed to know where to start at this point. 
  • Hello,
    Take a look at bNoPartSideA values.
    And, what is wrote with:
    TPWrite"ModuleNameB:"+ModuleNameB;
    TPWrite"ModuleNameA:"+ModuleNameA;
    



  • What are you meaning by this. I don't have many years of programming. We use this main module that was written by the company. I just build Grind modules. 
  • You should see text in FlexPendant "ModuleNameB:XXXXXXX".

  • Main Module had no file source to unload the program out of the robot and to load the system. 

    Old Coding

     

    PROC LoadModuleA()

        !Load module for Side A

        UnLoad ""\File:=ModuleNameA;

        UnLoad ""\File:=ModuleNameB;

        UnLoad ""\File:=CurrentMod;

        Load ""\File:=ModuleNameA;

        CurrentMod:=ModuleNameA;

      ERROR

        IF ERRNO=ERR_UNLOAD THEN

          TRYNEXT;

        ELSE

          TPWrite "Error In LoadModuleA Routine";

          TPWrite "Error Loading Module to Robot";

          TPWrite "Program Ended";

          Stop;

        ENDIF

      ENDPROC

     

      PROC LoadModuleB()

        !Load module for Side B

        UnLoad ""\File:=ModuleNameA;

        UnLoad ""\File:=ModuleNameB;

        UnLoad ""\File:=CurrentMod;

        Load ""\File:=ModuleNameB;

        CurrentMod:=ModuleNameB;

      ERROR

        IF ERRNO=ERR_UNLOAD THEN

          TRYNEXT;

        ELSE

          TPWrite "Error In LoadModuleA Routine";

          TPWrite "Error Loading Module to Robot";

          TPWrite "Program Ended";

          Stop;

        ENDIF

      ENDPROC

     

     

    PROC LoadModuleA()

        !Load module for Side A

        UnLoad "Home:"\File:=ModuleNameA;

        UnLoad "Home:"\File:=ModuleNameB;

        UnLoad "Home:"\File:=CurrentMod;

        Load "Home:"\File:=ModuleNameA;

        CurrentMod:=ModuleNameA;

      ERROR

        IF ERRNO=ERR_UNLOAD THEN

          TRYNEXT;

        ELSE

          TPWrite "Error In LoadModuleA Routine";

          TPWrite "Error Loading Module to Robot";

          TPWrite "Program Ended";

          Stop;

        ENDIF

      ENDPROC

     

      PROC LoadModuleB()

        !Load module for Side B

        UnLoad "Home:"\File:=ModuleNameA;

        UnLoad "Home:"\File:=ModuleNameB;

        UnLoad "Home:"\File:=CurrentMod;

        Load "Home:"\File:=ModuleNameB;

        CurrentMod:=ModuleNameB;

      ERROR

        IF ERRNO=ERR_UNLOAD THEN

          TRYNEXT;

        ELSE

          TPWrite "Error In LoadModuleA Routine";

          TPWrite "Error Loading Module to Robot";

          TPWrite "Program Ended";

          Stop;

        ENDIF

      ENDPROC