RobotStudio event

RAPID programming

I would like to use record data type in my program. I read manual, done steps according to it and rapid writes errors. Has anyone experience with aliaces and records? Could you write me the way to do this?

Comments

  • If you're programming an S4C+ controller, you will need the "Developer's Functions" option (or an option including it). On IRC5+ you probably need the "Advanced RAPID", but I'm not 100% sure.
    If you don't have it, the controller will give you a syntax or sematic error.
    Check the options you installed when you load the system.

    If everything is ok, definition of new records is straightforward:

    MODULE MyModule
     RECORD MyRecord
        bool bField1;
        num nField2;
     ENDRECORD
     VAR MyRecord MyVariable

     PROC Main()
       MyVariable.bField1:=TRUE;
       MyVariable.nField2:=5;
     ENDPROC

    ENDMODULE
  • Thank you very much claudio! Now it's OK. My problem was that I defined RECORD below VAR. If it is above VAR so that is correctly.