Magneto Studio® is a fully integrated tool that integrates the compilation tools needed to generate the program that runs on your embedded board. The code produced during the development of your HMI can be totally invisible to the user (who, remember, does not necessarily have any knowledge of software development). However, it is possible to naturally include your own developments or open sources directly in the heart of your project.

Import your source code

Tutorial: importing code into a Magneto Studio project

To import your own developments (in C language), just drag and drop your files (source codes or binary libraries) anywhere in the « Workspace » tab (area 1). The code must be in C language.

Information : If you are importing your own code, all functions, procedures and variables must be present in C files (user.c in the example below). Variables must be declared as global variables in this file.

Example : 

File tree :

  • user.c
  • user.h
  • src :
    • weather.c
    • weather.h

user.c :

Example of main.c content

user.h

Example of main.h content

weather.c

Example of weather.c content

weather.h

Example of weather.h content

Once your code is imported, you can use event variables (SysEvent) or simple variables to access functions/methods/variables in your code or simply by assigning your code to an action (Actions).

To see a concrete example please look at the application examples.