Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed max_requests_in_flight on Tag and Tag<M,T> #385

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading