Using Copia Copilot
This page of the Copilot documentation contains the following sections:
Best Practices
This section contains a collection of Best Practices when using the Copilot Copilot tool.
Be Specific
The more specific you are with your questions, the better the chatbot can assist you.
Example: Instead of "What's wrong with this code?," try "My code is experiencing unexpected behavior X,Y,Z. Please find what part of the code is causing this behavior and suggest a fix"
Specify your desired programming language in your prompt
The Copilot may choose either Ladder Logic or Structured Text when generating code. If you'd prefer a specific language, specify it in your prompt.
Example: "Using Ladder Logic, generate me an AOI that does X, Y, and Z."
Ask it to try again
If the response that Copia Copilot gives you isn't what you were looking for, sometimes just asking it to "try again" will give a better response
If the response didn't answer your question exactly how you wanted, give Copia Copilot more clarification and ask it to try again
Give focused code snippets
Instead of giving Copia Copilot an entire program to reference, give it smaller chunks of code when possible.
For example: If you are asking the tool to convert an AOI from Ladder Logic to Structured text, only attach the existing AOI export. Attaching the entire project file might result in Copilot over-indexing on other unrelated project items
Ask it to only do small pieces at a time
Define the required input/output parameters
If you are asking Copilot to create a piece of code, clearly specify which inputs and outputs it should expect. If none are specified, Copia Copilot will likely make a best guess at what they should be
Refresh to clear the "memory"
If you find that Copilot is still referencing previous examples of code or responses, it may be that it is "holding on" to the previous context of the chat. In these cases, you can ask it to disregard the previous responses, or you can simply refresh the browser window to completely clear the "memory" of that chat.
Example Prompts
This section contains a collection of tested and well-structured example prompts for each of the three main usage categories: Net-New Code Generation, Code Modification, and Code Interpretation and Q & A.
Net-New Code Generation Examples
These types of questions refer to prompts that ask Copia Copilot for new code that doesn't have any dependencies to existing code. They typically are self-contained, such as AOIs. Some examples are listed below:
Generate an AOI written in Structured Text that takes in an array of 100 strings and counts how many elements have at least one duplicate. The AOI should output an integer that represents the count of duplicates found.
Create a template routine of a basic sequencer written in Ladder Logic. It should include a empty sequence steps as an example. The sequence should start on a specific input and restart automatically after it has finished all steps in the sequence. The sequence should stop immediately if there are any alarms or faults. Only use native instructions.
Code Modification Examples
These types of questions refer to prompts that ask Copia Copilot to refer to existing code (uploaded or attached with the Repo File Selector) and make some sort of modification to it. Modifications may include, but are not limited to:
Adding additional functionality
Fixing bugs
Translating to a different language
Language Translation
Ask Copilot to translate a snippet of code from Ladder Logic to Structured text, or vice versa. For example, you can attach a Ladder Logic AOI file and ask the following:
Convert this AOI from Ladder Logic to Structured Text while still retaining the original behavior and functionality.
Code Simplification
Ask Copilot to simplify code that is overly long or complex.
Simplify this code so it uses fewer lines of code. It should still retain all of the original behavior and functionality.
Code Interpretation and Q & A
Use Copia Copilot to answer questions about a project or portion of a project. You can ask high-level or very specific questions. Some examples are shown below.
Generating Documentation
Use Copilot to interpret a piece of code, such as an AOI, and generate a well-formatted piece of documentation for others to reference.
Generate me user documentation for this AOI using Markdown formatting. The documentation should be targeted to other Controls Engineers who will use this AOI in their own code. It should include information like the expected behavior and purpose of the code, limitations, and requirements for use (such as any required inputs and outputs).
High-Level Overview
Select an entire PLC project or a more-focused piece of the code, such as a Program with its Routines and ask Copilot to give you an overview of what its purpose is. This can be useful when dealing with an unfamiliar project or piece of code.
Give me a high-level overview of this Program and its Routines. Be sure to explain what each Routine is responsible for and how it relates to other Routines in the Program.
Finding Bugs or Areas for Improvement
Ask Copilot to search for any bugs in the code and suggest fixes for them. You can also just ask it to find any areas for improvements.
Analyze this Routine and identify any bugs or logical errors. Explain why it is a bug and suggest potential fixes for any that you identify.
Limitations & Known Issues
The Copia Chat Bot is currently in a Beta stage. This means that we expect there to be issues and missing features/functionality. Here is a list of the current limitations and known issues with the tool.
Rockwell/Allen-Bradley Only
Copia Copilot is only capable of interpreting and generating Rockwell Studio 5000 code. While you might find some success in generating Structured Text code that could be used in other vendors' projects, the Copia Copilot will always attempt to give the results in the Rockwell format.
No Chat History
The current version of Copia Copilot only retains your chat context and history in the current browser session. There is no way for you to access your previous chats at this time. This means that should you refresh or close your browser window, you will lose your current chat history.
File Upload
File attachments have the following limitations:
Files must be < 5 MB
Supported file types are: .L5X, .EDS, .XML, .HTML, .PDF, .TXT, .CSV, .MD, and .JSON
We recommend only uploading the files that are needed for your question. For example, if you are asking the chatbot to modify an AOI, you should only upload the export of the AOI instead of the entire project containing the AOI.
Ladder Logic and Structured Text Only
The current version of Copia Copilot is only capable of generating code that is written in Ladder Diagram (a.k.a. Ladder Logic, LD, or RLL) or Structured Text (a.k.a. ST). Generating or answering questions about other languages such as Sequential Function Chart (SFC) or Continuous Function Chart (CFC) is not yet supported.
Web App Only
The current version of Copia Copilot is only available to access via the web application in a browser.
Input Size Limits
The Copilot has a limited number of "tokens" that can be passed as inputs. Copia employs strategies for reducing this token count, such as "compressing" PLC projects that are selected, but large projects may still exceed the 190k token count limit. If this occurs, you will have to either select a smaller file, upload a more focussed piece of code (such as exporting the specific project item from Studio 5000), or use the Repo File Selector to select specific pieces of your PLC code to reference.
Output Size Limits
LLM's have a limited number of "tokens" that they are able to output as part of the response. This means that in some cases the Copia Copilot may be unable to output a complete response. If you notice that your responses are getting truncated, try to break your question down into smaller parts so the Copilot can output the entirety of the response.
Speed
Given that Copia Copilot is currently in the Beta stage, we are more focused on improving the model's response and abilities than we are on optimizing for speed of responses. Given this, you may experience wait times that are longer than you may expect. More complex questions, such as those with a lot of context (e.g. uploading a full project), may take longer to respond. The average response time that we currently observe is around 25s, but some responses may take as long as 2 minutes.
Downloaded L5X Code may not be Importable
Copia Copilot allows you to download the .L5X file of code that is generated. This is intended to be importable into your Studio 5000 project, but there is currently no validation that guarantees that it will import successfully. If you experience a failure importing the code, we recommend that you try to manually copy/paste into your project.
Submitting Feedback
Getting your feedback on the Copia Copilot is one of our top priorities with the launch of the Copia Copilot Beta. We want to hear what is working well, what isn't working well, and what is missing so we can continue to improve Copia Copilot. There are two ways to submit feedback on the Copia Copilot: in-app and via our Support forms. These are covered below.
In-App Feedback
In-App Feedback is the preferred method for submitting feedback on responses generated by Copilot. At the bottom of every generated response is a Thumbs Up/Down button. Please use this to rate the quality of the generated output as well as specify what was good or bad about the response. You can also optionally select a reason for a Thumbs Down response, as well as type out a free-form response explaining why the Copilot's response did not meet your needs.
Feedback via Support Forms
While the In-App Feedback is the preferred method for submitting feedback on generated responses, you can also via our Copia Support Form at https://www.copia.io/support-requests to submit feedback or requests for additional functionality. Please be sure to mention that you are referring to Copilot in your request.
Last updated