Skip to content

Commit

Permalink
Exposed max_requests_in_flight on Tag and Tag<M,T>
Browse files Browse the repository at this point in the history
  • Loading branch information
timyhac committed Jun 22, 2024
1 parent 746c258 commit 018ad50
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libplctag/NativeTagWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ public uint? StringTotalLength
}


private uint? _maxRequetsInFlight;
public uint? MaxRequestsInFlight
{
get => GetField (ref _maxRequetsInFlight);
set => SetField(ref _maxRequetsInFlight, value);
}



public void Dispose()
Expand Down Expand Up @@ -728,6 +735,7 @@ string FormatPlcType(PlcType? type)
{ "str_max_capacity", StringMaxCapacity?.ToString() },
{ "str_pad_bytes", StringPadBytes?.ToString() },
{ "str_total_length", StringTotalLength?.ToString() },
{ "max_requests_in_flight", MaxRequestsInFlight?.ToString() },
};

string separator = "&";
Expand Down
15 changes: 15 additions & 0 deletions src/libplctag/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,21 @@ public uint? StringTotalLength
set => _tag.StringTotalLength = value;
}

/// <summary>
/// Optional. The Modbus specification allows devices to queue up to 16 requests at once.
/// </summary>
///
/// <remarks>
/// The default is 1 and the maximum is 16.
/// This allows the host to send multiple requests without waiting for the device to respond.
/// Not all devices support up to 16 requests in flight.
/// </remarks>
public uint? MaxRequestsInFlight
{
get => _tag.MaxRequestsInFlight;
set => _tag.MaxRequestsInFlight = value;
}

/// <summary>
/// Creates the underlying data structures and references required before tag operations.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions src/libplctag/TagOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ public DebugLevel DebugLevel
set => _tag.DebugLevel = value;
}

/// <inheritdoc cref="Tag.MaxRequestsInFlight"/>
public uint? MaxRequestsInFlight
{
get => _tag.MaxRequestsInFlight;
set => _tag.MaxRequestsInFlight = value;
}

/// <summary>
/// Dimensions of Value if it is an array
/// Ex. {2, 10} for a 2 column, 10 row array
Expand Down

0 comments on commit 018ad50

Please sign in to comment.