Script your Documentation

Infusion
2015-03-13
2016-04-07
  • Infusion - 2015-03-13

    Hello,

    I wanted to test the "Script your Documentation".

    But in the first step (getting the json File) I get an Error.
    My Setup:
    - V3.5 SP5 Patch 2+
    - PATH entry C:\Program Files (x86)\3S CODESYS\SP5Patch2\CODESYS\DocScripting\3.5.5.0
    - PATH entry C:\Program Files (x86)\3S CODESYS\SP5Patch2\CODESYS\Common

    The library Project MyFirstLibrary.library is under
    D:\Projects\MyFirstLibrary.library

    In the command window I get an error, that CODESYS.exe could not be found

    Traceback (most recent call last):
    File "<string>", line 126, in <module>
    File "<string>", line 121, in main
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\libdoc.export", line 29, in export
    libdoc.exceptions.CodesysError: Not able to find a CODESYS.EXE</string></module></string>

    The strange thing is, that there is no such directory:
    D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\libdoc.export

    How should the export call look like ? With the global PATH?
    Or is there a failure with the installation of the codesys
    Or do I have to configure the libdoc in the command line ?

    Thanks for your answer.

     
  • mkeller - 2015-03-13

    Hi.

    Because you installed your CODESYS at a different location you have to set the environment variable LIBDOC_CODESYS. In your case it should be the following value:

    C:\Program Files (x86)\3S CODESYS\SP5Patch2\CODESYS\Common\CODESYS.exe" --Profile="V3.5 SP5 Patch 2"

    There is a note in the documentation for this problem.

    BR
    Martin

     
  • Infusion - 2015-03-17

    Hello,

    now its running, but only to the next Error.

    I searched for "LIBDOC_CODESYS" in my Help, but htere was no search result.
    Is it possible that the note for this Problem is in a newer version of the Help-System ?

    Library: D:\VehicleProjects\VehicleI\Engine.library

    D:\VehicleProjects\VehicleI>libdoc execute Engine.library
    Export <lib> to <content> using <codesys>
    <lib> = D:\VehicleProjects\VehicleI\Engine.library
    <content> = D:\VehicleProjects\VehicleI\Engine.json
    <codesys> = C:\Program Files (x86)\3S CODESYS\SP5Patch2\CODESYS\Common\CODESYS.exe" --Profile="V3.5 SP5 Patch 2"
    calling: C:\Program Files (x86)\3S CODESYS\SP5Patch2\CODESYS\Common\CODESYS.exe" --Profile="V3.5 SP5 Patch 2" --noUI --docexport="D:\VehicleProjects\VehicleI\Engine.library|D:\VehicleProjects\VehicleI\Engine.json
    "
    ...</codesys></content></lib></codesys></content></lib>

    Now I get the following Error:

    Traceback (most recent call last):
    File "<string>", line 126, in <module>
    File "<string>", line 121, in main
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\libdoc.export", line 56, in export
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\subprocess", line 524, in call
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\subprocess", line 711, in init
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\subprocess", line 948, in _execute_child
    WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden</string></module></string>

    Is it possible that I have to add another SystemVariable ?

     
  • mkeller - 2015-03-17

    Hi Infusion.

    Sorry, I used an invalid profile name. It should be "CODESYS V3.5 SP5 Patch 2".

    BR
    Martin

     
  • Infusion - 2015-03-17

    Hello,

    also the absence of the quotes at the beginning of the string is producing an ERROR.

    So the steps are:

    -> Adding the environment variable LIBDOC_CODESYS

    -> with the correct Path of your installation of Codesys an the corresponding Profile

    Example:
    "C:\Program Files (x86)\3S CODESYS\SP5Patch2\CODESYS\Common\CODESYS.exe" --Profile="CODESYS V3.5 SP5 Patch 2"

    Template:
    "(absolute Path of the Codesys installation)" --Profile="(the corresponding Profile)"

    Now it is working, thanks a lot !

    I thougt, that a environment variable is missing (or something like that), but i haven't thought of a wrong spelling of the Profile

     
  • Infusion - 2015-03-18

    I wodered about the use of {attribute 'libdoc_include'}

    At my programm it is written above the restructuredText in the declaration area of the FB.
    But also it does not work, I alwas get the whole Library Project exported as an .json File.

    I do not really know where to search for my failure.
    Do I have to write the attribute into the reST text area ?

     
  • mkeller - 2015-03-18

    Hi Infusion.

    The attribute 'libdoc_include' is deprecated.

    Use the following methods to exclude the parts which you don't want in your documentation:
    - Attribute 'hide'
    - Attribute 'conditional_show'
    - Access specifier PRIVATE
    - Access specifier INTERNAL

    BR
    Martin

     
  • Infusion - 2015-03-24

    Hello,

    I will try the attributes as soon as possible.

    Thanks

     
  • Infusion - 2015-03-24

    Another failure occured

    when I want to merge my Content and my Frame.
    In the command line I type this:
    libdoc merge %JsonFilePath% Frame Source

    so I change my directory to the folder I work in and there I search for the .json File
    --> JsonFilePath

    also the Frame nad the Source folder are in this Path.

    But I get the followinf Error message:

    Traceback (most recent call last):
    File "<string>", line 126, in <module>
    File "<string>", line 121, in main
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\libdoc.merge",
    line 75, in merge
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\libdoc.merge",
    line 127, in _merge_file
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\jinja2.environ
    ment", line 969, in render
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\jinja2.environ
    ment", line 742, in handle_exception
    File "<template>", line 22, in top-level template code
    File "D:\Development\Python\LibDoc-3\build\libdoc\out00-PYZ.pyz\jinja2.environ
    ment", line 397, in getattr
    jinja2.exceptions.UndefinedError: 'particle' is undefined
    DrΓΌcken Sie eine beliebige Taste . . .</template></string></module></string>

     
  • mkeller - 2015-03-25

    Hello Infusion.

    It seems there is some inconsistency between the files. We need to have a look at the files to find your problem.

    Could you send an eMail with the problem description, the library and the generated content to the CODESYS support?

    BR
    Martin

     
  • Infusion - 2015-03-27

    Hello,

    I will send the files in a few days. Until now the merge process isn't this important for me.

    At the moment I'm working on the template .rst files in DocScripting/3.5.5.0/templates.

    The template folder.rst lists the actual toctree with the code:

    {% if toc %}
    .. toctree::
    :maxdepth: 1

    {% for t in toc %}
    {{ t }}

    {% endif %}

    My target is to sort the items in the toc after their type.
    Something like

    FBs

    Eintrag_1
    Eintrag_2

    Folders

    Folder_1
    Folder_2

    Is that possible ?

    Is there a dokumentation for the properties of the different objekts ?
    Like:
    <libdoc.content.fparticle object="" at="" 0x032d0a30="">
    <libdoc.content.content 0x03276190="" object="" at=""></libdoc.content.content></libdoc.content.fparticle>

     
  • Infusion - 2015-04-22

    M.Keller hat geschrieben:

    Hello,

    perhaps it is a stupid question, but I am not familiar with attributes and access specifier.
    Is there any Dokument or Tutorial for the use of the attributes?

    I know that i can use compiler defines as an attribute.
    So i tell (write a keyword in the project -> properties -> compiler definitions) the Programm which attributes to use.
    And in the Code there i use {IF defined(compiler definition)}.

    But how does it work with the restructured Text ? And where do I specify which attribute I want to use ?

    Yours sincerely
    Florian

     
  • Infusion - 2015-04-22

    I found the answer to most of my questions myself

    So I have to specify the attributes which should be cleaned in the clean.conf
    xyz.json from doc-export
    "libdoc clean" command in the command line (specification with the "clean.conf" file)
    xyz_cleaned.json will be created
    "libdoc generate" command to get the Frame

    One question is left.
    I s it possible to define some parts of the rst with different attributes ?

    {attribute 'hide_on_zzz'}
    /// clean this section if zzz is the attribute
    {attribute 'hide_on_yyy'}
    /// clean this section if yyy is the attribute
    ///
    /// | This text should always show up in the documentation:
    /// | prog prog prog
    /// | tock tock tock and so on

     
  • Anonymous - 2015-12-27

    Originally created by: OW_RPi

    Hi,

    I followed the instruction of "Script your Documentation" and generated the documetation files.

    How to add my documentation to the context-sensitive help now?

    Thank you!

    Best regards,
    Oleg

     
  • r.evbatyrov - 2016-04-07

    Hi Oleg,

    it is theoretically possible, but somewhat complicated.

    First, your documentation should be compiled to CHM format.
    In your installation Folder there is a \CODESYS\Online Help\Extensions\$PROFILE$ folder with structure and urlmapping files in XML format. Your CHM files has to be in some Language folder and the structure file has to be modifed in that way to point to specific entries in the CHM files. That is called merging and is what some OEMs do.

    Regards,
    Roman

     

Log in to post a comment.