Skip to content
Merged
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
19 changes: 19 additions & 0 deletions src/libplctag/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public sealed class Tag : IDisposable
private int? _elementCount;
private bool? _useConnectedMessaging;
private bool? _allowPacking;
private bool? _allowFieldResize;
private int? _readCacheMillisecondDuration;
private uint? _maxRequestsInFlight;
private TimeSpan _timeout = defaultTimeout;
Expand Down Expand Up @@ -266,6 +267,23 @@ public bool? AllowPacking
set => SetField(ref _allowPacking, value);
}

/// <summary>
/// [OPTIONAL]
/// True = Allow data functions to change the tag’s buffer size.
/// False = Prevent functions like plc_tag_set_string() from changing the tag’s buffer size.
/// </summary>
/// <remarks>
/// When set allows the library to resize a tag’s data buffer when a field within it changes size.
/// This is the case when a string is set to a different size than it was when first read.
/// When a resize happens, the buffer is split at the site of the field and the part before the field is not changed.
/// The part after the field does not have changed contents, but the location of that contents will shift.
/// </remarks>
public bool? AllowFieldResize
{
get => GetField(ref _allowFieldResize);
set => SetField(ref _allowFieldResize, value);
}

/// <summary>
/// [OPTIONAL]
/// Use this attribute to cause the tag read operations to cache data the requested number of milliseconds.
Expand Down Expand Up @@ -1169,6 +1187,7 @@ string FormatTimeSpan(TimeSpan? timespan)
{ "str_pad_bytes", StringPadBytes?.ToString() },
{ "str_total_length", StringTotalLength?.ToString() },
{ "max_requests_in_flight", MaxRequestsInFlight?.ToString() },
{ "allow_field_resize", FormatNullableBoolean(AllowFieldResize) },
};

string separator = "&";
Expand Down
Loading