I've tried trim, I narrowed it down to when the dynamic string comes from a PLC string that isn't 82 characters and I run it through this code:
Private Function ExtractString(ByVal s As String) As String
Dim bytes((s.Length / 2) - 1) As Byte
For i = 0 To (s.Length / 2) - 1
bytes(i) = Byte.Parse(s.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber)
Next
Dim StringLength As Integer = BitConverter.ToInt32(bytes, 0)
Dim StringResult As String = System.Text.Encoding.Default.GetString(bytes, 4, bytes.Length - 4)
Return StringResult
End Function
If the dynamic string is full length it works fine.
Also, I'm testing with the console, so autosize isn't relevant. Also, I'm not using any AHMI components, when I see a datachange I'm writing my own code to do what I want.