When composing complex and dynamic HMIs, Magneto Studio® allows for non-predefined directives to be integrated in the form of code expressed in C language syntax but used with the same ease as a script. This choice allows for optimal embedded development while remaining within the reach of a non-developer (the general expressions remain as simple as Javascript or Python).
Information (developer): single quotes (') are used to indicate that this is code that will be compiled directly. The included expression can be either a single statement, a sequence of statements or a call to a function declared and instantiated in the user source code. In any case, it must respect the syntax of the C language.
Tip: If the result obtained does not correspond to that expected during development, opening the terminal (area 5) will provide information about errors specific to the program generation stages (compilation and linking phase).
Once you have created your variables, we will see how to assign them to elements of your interface.
To do this :
To assign a function to an action you must either have imported your code into the project (in C Language) and have previously activated the necessary libraries if needed (see the section Importing your source code) or use standard C code.
Once done:
Example of a standard code call:
FREE VERSION of MAGNETO STUDIO on RASPBERRY PI