├── .gitignore ├── LICENSE ├── README.md ├── images └── session-concept.png └── pages ├── accessing-project-nodes.md ├── advanced-svg.md ├── alarming.md ├── async-tasks.md ├── audit-signature.md ├── colors.md ├── companion-specs.md ├── creating-objects.md ├── database-interaction.md ├── datagrids.md ├── dialog-boxes.md ├── dispatch-events.md ├── dynamic-links.md ├── events.md ├── execute-command.md ├── good-practices.md ├── information-model.md ├── log-output.md ├── managing-aliases.md ├── netlogic-overview.md ├── opcua.md ├── plc-tags.md ├── random-generation.md ├── regex.md ├── register-observers.md ├── reports.md ├── resource-uri.md ├── runtime-tags-import.md ├── sessions.md ├── system-node.md ├── template-library.md ├── translations.md ├── trends.md ├── ui-animations.md ├── users-groups.md ├── variables-formatting.md ├── variables-interaction.md └── variables-properties.md /.gitignore: -------------------------------------------------------------------------------- 1 | **.pdf 2 | **.doc* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 ASEM S.r.l 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FT Optix cheat sheet 2 | 3 | Collection of C# snippets ready for copy-paste 4 | 5 | ## Disclaimer 6 | 7 | Rockwell Automation maintains these repositories as a convenience to you and other users. Although Rockwell Automation reserves the right at any time and for any reason to refuse access to edit or remove content from this Repository, you acknowledge and agree to accept sole responsibility and liability for any Repository content posted, transmitted, downloaded, or used by you. Rockwell Automation has no obligation to monitor or update Repository content 8 | 9 | The examples provided are to be used as a reference for building your application and should not be used in production as-is. It is recommended to adapt the example for the purpose, of observing the highest safety standards. 10 | 11 | > [!IMPORTANT] 12 | > This guide does not replace the official FT Optix documentation, it is just a place some code snippets with a brief explanation. 13 | 14 | > [!WARNING] 15 | > These snippets *may* use some non-public APIs that may be subject to changes, please refer to official documentation to access the publicly available APIs which are guaranteed to be maintained. 16 | 17 | > [!WARNING] 18 | > Some of the snippets from this repository may irremediably break your project, use them at your own risk. Make sure to implement proper error handling and testing before deploying them to a production environment. 19 | 20 | > [!WARNING] 21 | > Usage of the version control features of the FactoryTalk Optix IDE is hightly recommended to avoid any data loss. Make sure to commit your changes regularly to recover from any potential issue. 22 | 23 | ## Sections 24 | 25 | ### Introduction 26 | 27 | - [The InformationModel](./pages/information-model.md) 28 | - [NetLogic overview](./pages/netlogic-overview.md) 29 | - [Accessing project nodes](./pages/accessing-project-nodes.md) 30 | - [General FT Optix good practices](./pages/good-practices.md) 31 | 32 | ### General NetLogic tips and tricks 33 | 34 | - [Objects, types and instances](./pages/creating-objects.md) 35 | - [Sessions](./pages/sessions.md) 36 | - [Asynchronous tasks](./pages/async-tasks.md) 37 | 38 | ### Variables 39 | 40 | - [Managing aliases](./pages/managing-aliases.md) 41 | - [Resource URI](./pages/resource-uri.md) 42 | - [Variables formatting](./pages/variables-formatting.md) 43 | - [Variables properties](./pages/variables-properties.md) 44 | - [RegEx](./pages/regex.md) 45 | - [Variables Interaction](./pages/variables-interaction.md) 46 | - [Runtime tags import](./pages/runtime-tags-import.md) 47 | - [Dynamic Links](./pages/dynamic-links.md) 48 | - [PLC Tags](./pages/plc-tags.md) 49 | - [Audit signature](./pages/audit-signature.md) 50 | 51 | ### OPC/UA 52 | 53 | - [OPC/UA](./pages/opcua.md) 54 | - [Companion Specifications](./pages/companion-specs.md) 55 | 56 | ### UI 57 | 58 | - [DialogBox](./pages/dialog-boxes.md) 59 | - [Events handling](./pages/events.md) 60 | - [Colors](./pages/colors.md) 61 | - [Advanced SVG](./pages/advanced-svg.md) 62 | - [DataGrid](./pages/datagrids.md) 63 | - [Animations](./pages/ui-animations.md) 64 | - [Trends](./pages/trends.md) 65 | 66 | ### Others 67 | 68 | - [Log output](./pages/log-output.md) 69 | - [Database interaction (queries)](./pages/database-interaction.md) 70 | - [Random generation](./pages/random-generation.md) 71 | - [Execute commands](./pages/execute-command.md) 72 | - [Locales and Translations](./pages/translations.md) 73 | - [Users and groups](./pages/users-groups.md) 74 | - [Alarms](./pages/alarming.md) 75 | - [System Node](./pages/system-node.md) 76 | - [Template Library](./pages/template-library.md) (starting from FactoryTalk Optix 1.6.X) 77 | - [Reports](./pages/reports.md) 78 | 79 | ### Advanced 80 | 81 | > [!WARNING] 82 | > The following topics are very advanced and potentially dangerous, think twice before implementing them as they could lead to unexpected results 83 | 84 | - [Register OPC/UA observers](./pages/register-observers.md) 85 | - [Dispatch OPC/UA events](./pages/dispatch-events.md) 86 | -------------------------------------------------------------------------------- /images/session-concept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FactoryTalk-Optix/NetLogic_CheatSheet/d5b670ac7a85728feffddd3412b6afc1d3950aa5/images/session-concept.png -------------------------------------------------------------------------------- /pages/accessing-project-nodes.md: -------------------------------------------------------------------------------- 1 | # Accessing project nodes 2 | 3 | Before reading this page, please make sure to have the concept of [InformationModel and Session](./information-model.md). 4 | 5 | ## Navigating to a node 6 | 7 | ### The `Node.Get` syntax 8 | 9 | The `Get` method is used to fetch nodes from the current project, it can retrieve both session and global objects (nodes), this method also accepts a type that will be passed to the variable type 10 | - Example: 11 | - `var myButton = … .Get