RobotStudio event

makeing and using external classes in SM

Options
Hi Wink

I'd like to ask you a question about makeing and using external classes in SM.

Generally I don't know how to prepare file. Should it be compiled as Class Library in Visual Studio? Please post a simple file, where the structure of the source file will be shown.

There is more: I'd like to make some classes that can exchange data between a SM genereted data. How to get to Application Variables defined in SM? What should I do to see my own methods in window Events Panel -> Add Action -> Advanced -> Call .NET Method?

I appreciate any help.
Thanks,

Wojciech Wlodarski
PLABB

Comments

  • carlosmtz2000
    Options

    Hi again ..<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    This is another way of extend SM :)

     

    SM allows you to call static methods of public classes defined in another DLL. This DLL is usually a class library or a control library. Some of the limitations are:

     

    -       DLL's references must be in the same directory in order to load the DLL

    -       SM only will provide access to the static methods which contains basic data types: string, int, double, boolean, object)

     

    Then ..

     

    1 - Create a SM project

    2 - Access the properties of the SM project. Go to the Advanced Tab page

    3 - Select the DLL that you want SM to look for static .NET methods

    4 - Now, go back to the designer of your screen and add an action "Call .NET Method". SM will list all the public static methods of public classes

    5 - Select the method / function  you are interested on

    6 - For each parameter, you can either type a value or access an application variable. In case you selected a function, you need to select an application variable in the Return value. If the parameter is defined as an out or ref parameter, the value must be an application variable in order to put the return value inside the application variable

     

    Hope this quick steps help..

     

    BR/Carlos

     

     
    Carlos Martinez
    ABB