+ Reply to Thread
Results 1 to 1 of 1

Thread: How to use Notepad++ for iMOTION scripts?

  1. #1
    Administrator Huixian is on a distinguished road
    Join Date
    Apr 2017
    Posts
    7

    How to use Notepad++ for iMOTION scripts?

    The script engine integrated in the MCE has proven to be very useful particularly for the IMC100/IMM100 series. Unfortunately the editor integrated in the MCEWizard is a rather simply version and the new ecosystem is still some way ahead.
    This thread will introduce how to use Notepad++ (npp in the following) as an alternative. We configured it specifically for iMOTION script and would like to share this configuration with you.

    If analog or digital pins are used for scripting, the resp. configuration has to be done in the MCEWizard.

    The description below gives the configuration of npp for the following steps:
    1) syntax highlighting
    2) auto completion
    3) script compilation

    ________________________________________
    1) syntax highlighting

    npp comes with syntax highlighting for a lot of predefined languages but also allows the definition of ‘user defined languages’.
    The attached file “iMOTION Script udl.xml” contains the keyword definitions for iMOTION script based of MCE rev. 1.3.1.
    Importing into npp works as follows:
    - from the ‘language’ menu select ‘User Defined Language’ => ‘Define your language’
    Click image for larger version

Name:	defineLanguage.png
Views:	1
Size:	11.2 KB
ID:	5090

    - Import the xml file

    This will give you the keyword groups as well as the operator definitions etc.
    Click image for larger version

Name:	operatorDefinitions.png
Views:	0
Size:	25.1 KB
ID:	5091


    The actual highlighting style is a rather subjective thing - fell free to adapt it to your personal preference via the Styler buttons.

    Documentation for the udl can be found here:
    https://ivan-radic.github.io/udl-documentation/

    ________________________________________
    2) auto completion
    Since it’s hard to memorize all the parameter names etc., we defined an auto completion file which contains the parameters as well as the symbols, functions etc.
    Installation is done by simply copying the file ‘iMOTION Script.xml’ into the subfolder ‘autoCompletion’ in the npp installation (program) directory.
    This requires admin rights.

    Auto completion is enabled and configured in the preferences.
    Depending on the setting npp will make suggestions right while typing or after hitting STRG+SPACE.
    Click image for larger version

Name:	STRGSPACE.png
Views:	0
Size:	8.3 KB
ID:	5092


    For functions on entering the opening bracket there is a short description plus the parameter list, which will be highlighted while typing.

    ________________________________________
    3) script compilation
    npp provides run commands that can be used to run the iMOTION script compiler.
    Since the compiler call requires the specific type, we had to define individual compile commands for them:
    - IMC101T compile
    - IMC102T compile
    etc

    The command line we use for the actual call looks like this: (be aware of the quotation marks!)
    cmd /c ""%MCEScript21%\iMotion_Script.exe" "$(FULL_CURRENT_PATH)" "$(CURRENT_DIRECTORY)\$(NAME_PART).ldf" "$(CURRENT_DIRECTORY)\$(NAME_PART).map" "IMC101T" & "$(NPP_FULL_FILE_PATH)" "$(CURRENT_DIRECTORY)\$(NAME_PART).ldf""

    This opens a cmd window, calls the script compiler in the MCEWizard directory which generates *.map and *.ldf.
    The resulting *.ldf is then opened showing the success or any potential errors very similar to the usage of MCEWizard.

    Definition of these run commands is done as follows:
    - click on Run => Run

    - copy the command line into the window (correct the specific type if needed)
    Click image for larger version

Name:	copy.png
Views:	0
Size:	5.1 KB
ID:	5093

    - click save and give it a name
    - the new run commands will show up in the run menu
    Click image for larger version

Name:	RunMenu.png
Views:	0
Size:	3.5 KB
ID:	5094

    These commands are stored in the file ‘shortcuts.xml’ in the folder ‘%appdata%/Notepad++’.
    Since npp overwrites the file on closing, it is not possible to edit it with npp itself, but with another test editor.

    Further documentation for the auto completion can be found here:
    https://npp-user-manual.org/docs/auto-completion/

    ________________________________________
    ?????
    Last edited by Huixian; Oct 1st, 2020 at 01:53 AM.

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.