Writing directly to the PLC project
When the Write PLC changes directly option is selected under Settings > Common > Miscellaneous (see the General Settings chapter), changes made by the agent to the PLC code are not staged but are written to the PLC project while the tool is running. This setting is disabled by default.
Behavior:
- Every change is recorded in a change log managed by CoAgent for each solution, along with the chat and the request that triggered it. Changes made outside of CoAgent (e.g., in the development environment’s editor) are detected the next time the POU is read or written to and are also logged.
- All chats are based on the same project version. A change made in one chat is immediately visible in other chats.
- The Changeset bar and the Changeset Review display the changes in the chat as usual. Each modified POU forms an entry that is compared against its state before the first change in the chat that has not yet been reviewed. The entries are marked as already applied.
- Instead of Apply and Dismiss, the Changeset Review screen offers Keep and Revert. Keep completes the review without making any changes to the project. Revert undoes the change in the project. Only the lines that this chat has modified are reset. Accept All and Reject All in the Changeset bar, as well as Apply All and Dismiss All in the Changeset Review, apply to all entries accordingly.
- When POUs are modified, individual change blocks can be kept(Keep) or reverted (Revert) in the diff. Newly created and deleted POUs are checked in their entirety.
- If those same lines have been modified in the meantime by another chat or outside of CoAgent, the Revert command will be rejected with a message, and the entry will remain unchanged. Check the current status in the diff and make your decision again.

Other solution files are modified directly in both modes and subsequently reviewed in the changeset.
![]() | In direct editing mode, changes made by the agent take effect immediately in the project, including for compilation and activation.
|
