feat(twincat): BOOL-within-word writes via driver-level parent-word RMW

This commit is contained in:
Joseph Doherty
2026-06-17 11:55:44 -04:00
parent 5c6b7cd6f9
commit a73e20fb28
3 changed files with 127 additions and 5 deletions
@@ -175,7 +175,9 @@ internal sealed class AdsTwinCATClient : ITwinCATClient
/// </summary>
/// <param name="symbolPath">The ADS symbol path to write to.</param>
/// <param name="type">The TwinCAT data type.</param>
/// <param name="bitIndex">Optional bit index for BOOL values (not supported for writes).</param>
/// <param name="bitIndex">Optional bit index for BOOL values. BOOL-within-word writes are handled
/// upstream by <see cref="TwinCATDriver.WriteAsync"/> as a parent-word read-modify-write, so a
/// bit index does not reach this method on the write path.</param>
/// <param name="value">The value to write.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The OPC UA status code of the write operation.</returns>
@@ -186,10 +188,6 @@ internal sealed class AdsTwinCATClient : ITwinCATClient
object? value,
CancellationToken cancellationToken)
{
if (bitIndex is int && type == TwinCATDataType.Bool)
throw new NotSupportedException(
"BOOL-within-word writes require read-modify-write; tracked in task #181.");
try
{
var converted = ConvertForWrite(type, value);