Collection of C# snippets ready for copy-paste
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
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.
Important
This guide does not replace the official FT Optix documentation, it is just a place some code snippets with a brief explanation.
Warning
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.
Warning
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.
Warning
Usage of the version control features of the FactoryTalk Optix IDE is highly recommended to avoid any data loss. Make sure to commit your changes regularly to recover from any potential issue.
Warning
This service is provided by GitMCP (Website | GitHub) and is not affiliated with Rockwell Automation.
You can configure your GitHub Copilot (or any AI agent supporting MCP) to use this repository as a custom cheat sheet for FactoryTalk Optix NetLogic with GitMCP, just follow these steps:
- Open your AI agent settings
- Locate the MCP server configuration section
- Add the following URL as a new MCP server:
https://gitmcp.io/FactoryTalk-Optix/NetLogic_CheatSheetand set the type tosse - Save the settings and restart your AI agent if necessary
This can significantly improve the quality of the code suggestions related to FactoryTalk Optix NetLogic when using your AI agent (for example GitHub Copilot in both Visual Studio and Visual Studio Code).
Tip
Browse to this link to see additional configuration instructions for your AI agent or software.
- Managing aliases
- Resource URI
- Variables formatting
- Variables properties
- RegEx
- Variables Interaction
- Dynamic Links
- Audit signature
- Log output
- Random generation
- Execute commands
- Locales and Translations
- Users and groups
- Alarms
- System Node
- Template Library (starting from FactoryTalk Optix 1.6.X)
- Reports
- Recipes
- Serial port
- PLC Tags
- Runtime tags import
- Designtime tags import (starting from FactoryTalk Optix 1.7.X)
Warning
The following topics are very advanced and potentially dangerous, make sure you know what you're doing before implementing them as they could lead to unexpected results or even break your project.
Tip
These snippets are not directly involved with FactoryTalk Optix C# APIs but can be useful in some scenarios
- FactoryTalk Optix Studio CLI (starting from FactoryTalk Optix 1.6.X)
- Debugging tips