RobotStudio event

"switch" optional parameters

Options
hello everyone, i am looking for someone to help me with a Rapid program i'm working on. I am using a switch datatype which allows for optional parameter to be on or off. but in my case i'm having trouble with making it work. it says that my proc is an invalid entrypoint saying the reason is because its either local or has parameters but i understand that it has parameters. i am needing these parameters to make my program run the way that I'm needing. is if someone could help it would be most appreciated.

Comments

  • Pavel Riabichev
    edited January 2016
    Options
    Hello RobTech

    Did you try to make another procc (without parameters) the entry point and then call your procc with parameters?
    The entry point is the first thing that will run on startup, so there is nothing before that can set its parameters.

    Example:

    MODULE PROG
        PERS num parameter;

        PROC main()      !Entrypoint

            proccWithParams parameter;

        ENDPROC

        PROC proccWithParams(num parameter)

        ENDPROC

    ENDMODULE

    /Pavel