RobotStudio event

Call By String ???

Options

Hello everybody!

I have a S4C controller and because of the small amount of memory left in the system i would like to load and unload modules from a floppy disc in automatic mode. The problem is that offcourse the system dont accept that i have "procalls" to routines that is not yet loaded in the system. I want to have specific names on my routines and therefore i cant use the CallByVar instruction. Is there any way to like "call a routine by a stringarray"?

Thanks in advance!

// Lars-?ke Fredholm, Sweden

 

Comments

  • Hi
    Here is a way to call a routine by a string.

     %"Palle"+NumToStr(nCurrentPalle,0)%;

    If nCurrentPalle is for example 5 the routine
    Palle5 will be called. 

     

    Per Svensson
    Company Specialist
    ABB Automation Technology Products
  • Thanks for the reply Per!

    Here is how i solved the problem.

    MODULE LARSA
      ! nArtikel f?r olika v?rden beroende p? val i en meny
      PERS num nArtikel_1:=2;
     
      ! stMod inneh?ller namnen p? mina moduler p? disketten
      CONST string stMod{2}:=["RF.MOD","RF_Z.MOD"];

     ! stProc inneh?ller namnen p? rutinerna som finns i modulen jag just laddat
      CONST string stProc_1{2}:=["RamfKpl_1","RamfKplZ_1"];

      PROC main()
        ! Laddar vald modul fr?n diskett
        Load flp1File:=stMod{nArtikel_1};
        ! K?r vald rutin
        %stProc_1{nArtikel_1}%;
      ENDPROC
    ENDMODULE