MATLAB: C Code for UniLogic

If you use MATLAB, you can create certain functions, then generate C code, tweak it, and then paste it into UniLogic's C editor.

The MATLAB sites and forums have information on generating C code, for example:

 

Note that the example shown below shows MATLAB version R2015b.

Example: Multiplication function, written in MATLAB

 

  1. Create the function.





  2. Define Input Types.



  3. Generate the code in C.







  4. Open the resulting Header and C code files.







  5. Copy and paste the header and C function code into the UniLogic C editor.

    Note that you must tweak the code to comply with any restrictions that exist in the UniLogic C editor.
    These are generally presented in a colored frame at the top of the editor, as shown below.