diff --git a/src/libplctag/NativeTagWrapper.cs b/src/libplctag/NativeTagWrapper.cs index 5cb7427..c34350d 100644 --- a/src/libplctag/NativeTagWrapper.cs +++ b/src/libplctag/NativeTagWrapper.cs @@ -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() @@ -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 = "&"; diff --git a/src/libplctag/Tag.cs b/src/libplctag/Tag.cs index 35bd9f5..d2a8ac2 100644 --- a/src/libplctag/Tag.cs +++ b/src/libplctag/Tag.cs @@ -318,6 +318,21 @@ public uint? StringTotalLength set => _tag.StringTotalLength = value; } + /// + /// Optional. The Modbus specification allows devices to queue up to 16 requests at once. + /// + /// + /// + /// 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. + /// + public uint? MaxRequestsInFlight + { + get => _tag.MaxRequestsInFlight; + set => _tag.MaxRequestsInFlight = value; + } + /// /// Creates the underlying data structures and references required before tag operations. /// diff --git a/src/libplctag/TagOfT.cs b/src/libplctag/TagOfT.cs index abd7df2..8839046 100644 --- a/src/libplctag/TagOfT.cs +++ b/src/libplctag/TagOfT.cs @@ -134,6 +134,13 @@ public DebugLevel DebugLevel set => _tag.DebugLevel = value; } + /// + public uint? MaxRequestsInFlight + { + get => _tag.MaxRequestsInFlight; + set => _tag.MaxRequestsInFlight = value; + } + /// /// Dimensions of Value if it is an array /// Ex. {2, 10} for a 2 column, 10 row array