Bug summary
The PlcTaskName dropdown in TwinCAT → Settings is empty even when the PLC project has a properly configured PlcTask linked to a Standard PLC Project. The dropdown does not allow free-text entry either. Clicking OK overwrites the saved value in OC.Assistant.xml with an empty string, breaking subsequent Update Project operations.
Environment
- OC.Assistant v1.18.1
- TwinCAT 3.1.4026.22 (TcXaeShell based on Visual Studio 2022)
- Windows 11
- OC_TwinCAT_Core v1.3.1, TcUnit v1.3.1
- .NET Desktop Runtime 10.0.8
- Single Standard PLC Project named
TestPlc with default PlcTask (CycleTime 10 ms, Priority 20)
Reproduction
- Create a fresh TwinCAT XAE solution with one Standard PLC Project (
TestPlc).
- Install OC_Core + TcUnit libraries; reference them in the PLC project.
- Build the solution, activate configuration (7-day trial license active, runtime in Config mode).
- Close TcXaeShell.
- Open the
.sln in OC.Assistant via the open button.
TwinCAT → Settings: PlcName dropdown correctly shows TestPlc. PlcTaskName dropdown is empty with no entries to select and does not accept typed input.
Inspection of project state
The .tsproj has the PLC properly bound (AmsPort=851) with a <Context Name="PlcTask"> linking PLC task to system task. The _Boot\TwinCAT RT (x64)\Plc\Port_851.* files exist. Build succeeds with 0 errors / 0 warnings.
Workaround
Manually editing OC.Assistant.xml to add <PlcProjectName>TestPlc</PlcProjectName> and <PlcTaskName>PlcTask</PlcTaskName> under <Twincat><Settings> works — as long as the Settings dialog is never reopened (clicking OK after that wipes the value).
Source code reference
The actual task lookup at generation time uses a direct name-based GetItem call (see OC.Assistant.Twincat/Automation/TaskGenerator.cs around the tcSysManager.GetItem(...) call), so the XML value alone is sufficient. The bug is purely in the Settings UI population of the dropdown.
Suggested fixes
- Make the
PlcTaskName combo box editable so users can type the name as a fallback.
- Populate the dropdown directly from the
<Plc><Project><Instance><Contexts><Context><Name> entries in .tsproj, which is reliable across build/activation states.
- If the dropdown can't enumerate, preserve the existing XML value rather than clearing it on OK.
Bug summary
The
PlcTaskNamedropdown inTwinCAT → Settingsis empty even when the PLC project has a properly configuredPlcTasklinked to a Standard PLC Project. The dropdown does not allow free-text entry either. Clicking OK overwrites the saved value inOC.Assistant.xmlwith an empty string, breaking subsequentUpdate Projectoperations.Environment
TestPlcwith defaultPlcTask(CycleTime 10 ms, Priority 20)Reproduction
TestPlc)..slnin OC.Assistant via theopenbutton.TwinCAT → Settings:PlcNamedropdown correctly showsTestPlc.PlcTaskNamedropdown is empty with no entries to select and does not accept typed input.Inspection of project state
The
.tsprojhas the PLC properly bound (AmsPort=851) with a<Context Name="PlcTask">linking PLC task to system task. The_Boot\TwinCAT RT (x64)\Plc\Port_851.*files exist. Build succeeds with 0 errors / 0 warnings.Workaround
Manually editing
OC.Assistant.xmlto add<PlcProjectName>TestPlc</PlcProjectName>and<PlcTaskName>PlcTask</PlcTaskName>under<Twincat><Settings>works — as long as the Settings dialog is never reopened (clicking OK after that wipes the value).Source code reference
The actual task lookup at generation time uses a direct name-based
GetItemcall (seeOC.Assistant.Twincat/Automation/TaskGenerator.csaround thetcSysManager.GetItem(...)call), so the XML value alone is sufficient. The bug is purely in the Settings UI population of the dropdown.Suggested fixes
PlcTaskNamecombo box editable so users can type the name as a fallback.<Plc><Project><Instance><Contexts><Context><Name>entries in.tsproj, which is reliable across build/activation states.