# Documentation of code

**URL:** <https://forum.inductiveautomation.com/t/documentation-of-code/67130>\
**Category:** General Discussion\
**Tags:** vision\
**Created:** [December 1, 2022, 12:44pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130 "2022-12-01T12:44:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![majad](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@majad](https://forum.inductiveautomation.com/u/majad)\
**Post date:** [December 1, 2022, 12:44pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/1 "2022-12-01T12:44:29Z")

</div>

Hello all,  
I was wondering if anyone had found any good methods of documenting their Vision applications in Ignition. I’m looking to document tags, windows, templates and scripting.

Right now i am updating a word document, thinking about using doxygen for the scripting.

Is there a better way? Maybe is it even possible to get scripting behind the preview windows which are given in the Designer Mode for the differerent windows so that these could be used in the documentation?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [December 1, 2022, 1:14pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/2 "2022-12-01T13:14:56Z")

</div>

You can drive yourself crazy documenting things with Ignition as it's not a pure code environment like you would have if you programmed everything from scratch.

I think the most straightforward way is to document how certain processes work. How do you add a recipe? Load a recipe? What tags handle that, and what values on those tags mean what semantically(1=Run, 2=Stop, 4=Fault, or whatever it is)?

Anything that your gateway shells out to some other software - definitely document that because even if you don't document everything within Ignition most advanced users can figure out what the intent was, but when you shell out to 3rd party software that may not be well known or have co-workers are less familiar with it, this most definitely needs to be documented.

In terms of documenting windows, I try to just make every window follow a similar setup, and then I document those conventions. Any popup that allows INSERT/UPDATE of a database table should look relatively similar, have some initial data payload that populates the window, and the relatively similar code pattern to run your db actions. Obviously exceptions exist but most CRUD operations end up looking similar (CRUD meaning Create Read Update Delete actions on a database).

For documenting scripts I follow the google style

```auto
def myImportantFunction(arg1, arg2, keyword1=False):
    """
    This function does important stuff!
    Args:
        arg1: int, if 1, then we do x, if 2 we do y, else we throw an error
        arg2: str, the message that populates the header/banner of a GUI while this runs
        keyword1: bool, if False, modifies function behavior by doing A, if true modifies funciton behavior by doing B
    Returns:
        (bool, str) - bool - true if everything was succesfull false if it was not
                          str - None if no error occurred, otherwise an error message
    """
    pass

```

Personally I think when starting a new project you should start in the project script library. Write your business logic functions, document those as I just showed above, and then all your GUI should ever do is gather the arguments that you then feed the functions your wrote. Same thing with any Gateway timer scripts or gateway scoped logic. The project library and scripts in it are the most straightforward thing to document and also happen to be the easiest thing to do version control on since it's plain text, unlike windows etc. An additional benefit is that if you need to call some existing business logic now in a second location, you already are setup to do that, and you don't have to copy and paste a long script from a button into a script library and rework it.

---

<div class="post-metadata">

**Author:** ![Francis\_Lajoie](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@Francis\_Lajoie](https://forum.inductiveautomation.com/u/Francis_Lajoie)\
**Post date:** [December 1, 2022, 1:28pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/3 "2022-12-01T13:28:53Z")

</div>

I also use google doc strings. I don't really know how you would use doxygen. Are the python files accesible outside of the designer?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [December 1, 2022, 1:30pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/4 "2022-12-01T13:30:35Z")

</div>

I have never used doxygen so I cannot give you any pointers on that.

Yes they are, on a Windows gateway you can go to `C:\Program Files\Inductive Automation\Ignition\data\projects\YourProjectNameHere\ignition\script-python` to see your scripts.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [December 1, 2022, 4:32pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/5 "2022-12-01T16:32:00Z")

</div>

I think there are various places to put notes in the designers. But I would not recommend it.

I like to create a document usually in Excel. It is where I document patterns, conventions, etc.. and make sure it is in a place others can access.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [December 1, 2022, 4:36pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/6 "2022-12-01T16:36:00Z")

</div>

Documenting the conventions of the project and then following those conventions consistently (and leaving comments where you don't and why you're not) is the best bang for your buck imo. Most explanatory power for the least amount of administrative work of documenting.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 1, 2022, 4:54pm UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/7 "2022-12-01T16:54:11Z")

</div>

Some thoughts from an IA perspective here:

> [@Project Resource Documentation Feature](https://forum.inductiveautomation.com/t/project-resource-documentation-feature/66010/2):
>
> We have some internal plans to improve the ability to document things - not just a markdown-ey resource file, but perhaps some ability to render those markdown files out into a static webpage to semi-automatically generate an entire reference manual for your project. I don't think you can do things at the level required from a third party module; it would have to be a first-party integration to hook in to these context menus everywhere. If I remember right, the Documentation tool works the way …

This is a loose plan, so any ideas anyone has about how this should or could work are appreciated.

---

<div class="post-metadata">

**Author:** ![Blazenegl\_Alex](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@Blazenegl\_Alex](https://forum.inductiveautomation.com/u/Blazenegl_Alex)\
**Post date:** [April 23, 2024, 11:42am UTC](https://forum.inductiveautomation.com/t/documentation-of-code/67130/8 "2024-04-23T11:42:31Z")

</div>

I stumbled upon your post and found it intriguing. Documenting code is like leaving breadcrumbs in a forest—essential for anyone who might wander into your codebase! It's not just about you; it's about making life easier for your future self and others. As for the ID verification API you mentioned, it sounds like a handy tool for enhancing security and user verification processes, but personally, I use [Identity Verification API - ID Analyzer](https://www.idanalyzer.com/products/id-verification-api.html). Ensuring the safety and integrity of systems is paramount, and such solutions can be invaluable in achieving that goal. I'd love to hear more about your experiences with it.
