AdvancedHMI Software
General Category => Support Questions => Topic started by: bachphi on January 14, 2021, 05:26:42 PM
-
I have two basic labels. The first label display data (more than what it actually has) but not the second label, not sure why??
As you see in the first pic, Print_TxtArray[0] has a length=6 and Print_TxtArray[2] has length=25
BasicLabel1.PLCAddressValue = Print_TxtArray[0]
BasicLabel2.PLCAddressValue = Print_TxtArray[2] '[1] is too long
(https://i.postimg.cc/MHgNzy3D/Print-Txt-Array.png)
(https://i.postimg.cc/zBy15XXq/Basic-Label-Str462.png)
The textbox grab the lengthy data from BasicLabel1.
-
Archie posted a patch for your issue:
https://www.advancedhmi.com/forum/index.php?topic=2840.msg16916#new
You seem to be trying to read in custom length string.
-
The patch is probably to resolve your issue of 2nd label not reading but is still not showing the string as readable text.
You can always do some additional testing with the following:
- Modiified BasicLabel that can read custom strings:
https://www.advancedhmi.com/forum/index.php?topic=2619.msg15725#msg15725
- Reply #6 has the app that can read custom strings as well:
https://www.advancedhmi.com/forum/index.php?topic=2563.msg16237#msg16237
Just by looking at your strings, if something doesn't show properly then you might need to change encoding in the code of the modified BasicLabel and/or the app I mentioned.
-
There seemed to be a simpler way to read Any custom string without too much complicating extraction:
Public Class UDTStringCustom
Dim s1 As String
End Class
....
Dim MyUDT As UDTStringCustom = PLC.ReadUDT(Of UDTStringCustom)("LastBatch")
-
That's a manual way of getting the value.
If you think that you could possibly make it a part of the BasicLabel to automate the reads, that would be nice.
-
Since there already is a
PLC.WriteCustomString()
function, one can expect and hope that Archie is soon to have PLC.ReadCustomString()
to complete the set. ;)