• Login
Community
  • Login

Function List for Simatic

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
functionsfunctions listcustomize
20 Posts 2 Posters 12.6k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    Burak Tavukcuoglu
    last edited by Oct 14, 2016, 9:40 PM

    First of all, thanks a lot for your help and time MAPJe71
    I found this document for the syntax. https://support.industry.siemens.com/cs/document/109248664/sinumerik-840d-sl-job-planning?dti=0&pnid=14599&lc=en-WW
    To wrap it up, I wrote down the current state of the function list. It still doesnt work. :(

                <association id="NC_function" userDefinedLangName="NC 840dsl" />
    						<association id="NC_function" ext=".arc" />
                    <parser id="NC_function" displayName="NC 840dsl" commentExpr="(?m-s:;.*?$)">
        <function mainExpr="^%_N_\K[A-Za-z_]\w*" />
    			<functionName>
                <nameExpr expr="\w+"/>
            </functionName>
        </function>
    </parser>
    
    1 Reply Last reply Reply Quote 0
    • M
      MAPJe71
      last edited by Oct 14, 2016, 10:44 PM

      You didn’t correctly copy-paste the parser-node I posted.
      Remove the …

                  <functionName>
                  <nameExpr expr="\w+"/>
              </functionName>
          </function>
      

      part or re-copy/paste so it looks like this …

          <parser id="NC_function" displayName="NC 840dsl" commentExpr="(?m-s:;.*?$)">
              <function mainExpr="^%_N_\K[A-Za-z_]\w*" />
          </parser>
      

      Also check whether or not you edited the right functionList.xml file as there might be more than one on your system:

      1. %ProgramFiles%\Notepad++\functionList.xml;
      2. %ProgramFiles(x86)%\Notepad++\functionList.xml;
      3. %AppData%\Notepad++\functionList.xml

      Furthermore, make sure to restart Notepad++ after you edited and saved the XML-file.

      1 Reply Last reply Reply Quote 0
      • B
        Burak Tavukcuoglu
        last edited by Burak Tavukcuoglu Oct 16, 2016, 7:52 PM Oct 16, 2016, 7:51 PM

        It did work!!
        Thank you!!
        Apperantly I modified the false file. Namely, %APPDATA%\notepad++\functionList.xml as in https://notepad-plus-plus.org/features/function-list.html, and not as you mentioned above: %ProgramFiles(x86)%\Notepad++\functionList.xml.
        Thanks MAPJe71, you really helped me a lot.
        My best regards!

        1 Reply Last reply Reply Quote 0
        • B
          Burak Tavukcuoglu
          last edited by Nov 11, 2016, 10:54 AM

          Hi!
          I recently discovered a bug in the function list feature. (or something I overlooked)
          The function list works great. But when I open certain files, functions are not being listed. However, when I copy the content of my code to a new window, functions are listed just as normal.
          This does not happen with every file. With file names such as: SPF_DIR.arc and MPF_DIR.arc, it happens all the time. Are those file names not permitted in Notepad++?
          Thanks!

          1 Reply Last reply Reply Quote 0
          • M
            MAPJe71
            last edited by Nov 11, 2016, 3:21 PM

            AFAIK there’s no restriction on file names other than the standard Windows restrictions.
            Could you post the files and the Notepad++ Debug Info (you can find it in the ? menu) so I can try to reproduce the problem?

            1 Reply Last reply Reply Quote 0
            • B
              Burak Tavukcuoglu
              last edited by Nov 11, 2016, 9:46 PM

              https://www.dropbox.com/sh/53wxnnxioxmcj8p/AADzd9wMDWoCVTgVrZJdqqL-a?dl=0
              In the shared folder, there is a file which I am trying to display the functions of it and the respective functionlist and the user defined language.
              Due to the copywrite agreements, I can not post the complete code that is why I trimmed the code to the function names. I tried to view the functions, it didnt work.
              Many thanks!

              1 Reply Last reply Reply Quote 0
              • M
                MAPJe71
                last edited by Nov 11, 2016, 9:55 PM

                Due to the copyright agreements, I can not post the complete code …

                I understand and so far the trimmed down code helps, as it does not show any functions on my system either.
                I’ll have a look.

                1 Reply Last reply Reply Quote 0
                • B
                  Burak Tavukcuoglu
                  last edited by Nov 11, 2016, 10:27 PM

                  Thank you for correcting me. I probably typed it really quick. :)
                  I can confirm that the regex file you provided, really did the trick and the function view normally works. It fails to show the functions whenever I try to open a new file
                  Once again thank you so much for your help!

                  1 Reply Last reply Reply Quote 0
                  • M
                    MAPJe71
                    last edited by MAPJe71 Nov 11, 2016, 10:36 PM Nov 11, 2016, 10:35 PM

                    You’re welcome!

                    1. Incomplete parser;
                    2. Known bug with comment following function header.

                    ad.1. Adapt parser to:

                    <parser id="NC_function" displayName="NC 840dsl" commentExpr="(?m-s:;.*?$)">
                    	<function mainExpr="(?m)^%_N_\K[A-Za-z_]\w*" />
                    </parser>
                    

                    ad.2. There have to be at least two characters between the function header and the comment.
                    e.g. a line-break and a space

                    %_N_CH1_BASIC_POS_SPF
                     ;$PATH=/_N_SPF_DIR
                    ;(c)2013 by Linsinger Maschinenbau Ges.m.b.H.
                    

                    or two line-breaks

                    %_N_CH1_BASIC_POS_SPF
                    
                    ;$PATH=/_N_SPF_DIR
                    ;(c)2013 by Linsinger Maschinenbau Ges.m.b.H.
                    

                    or two spaces

                    %_N_CH1_BASIC_POS_SPF  ;$PATH=/_N_SPF_DIR
                    ;(c)2013 by Linsinger Maschinenbau Ges.m.b.H.
                    

                    or a colon and a line-break

                    %_N_CH1_BASIC_POS_SPF:
                    ;$PATH=/_N_SPF_DIR
                    ;(c)2013 by Linsinger Maschinenbau Ges.m.b.H.
                    

                    etc.

                    1 Reply Last reply Reply Quote 0
                    • B
                      Burak Tavukcuoglu
                      last edited by Nov 11, 2016, 10:51 PM

                      It is weird. Because it doesnt happen with other files even though the comment line is right below the function tag.
                      Thanks for your time and help!

                      1 Reply Last reply Reply Quote 0
                      • M
                        MAPJe71
                        last edited by Nov 11, 2016, 11:08 PM

                        Had another look …
                        ad.2. or make sure your line-breaks consist of a carriage-return and a line-feed (i.e. two characters).

                        Your SPF_DIR - Kopie.arc uses line-feeds for line-breaks i.e. only one character between tag and comment.

                        1 Reply Last reply Reply Quote 0
                        • B
                          Burak Tavukcuoglu
                          last edited by Nov 12, 2016, 1:12 PM

                          Is it possible to add an exception into comments section?
                          For example: everything is a comment except when $PATH comes right after ‘;’.

                          1 Reply Last reply Reply Quote 0
                          • M
                            MAPJe71
                            last edited by Nov 13, 2016, 2:33 AM

                            Yes that can work, in your case!
                            Change commentExpr to "(?m-s:;(?!\$PATH).*?$)".

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors