Author Topic: Second BasicLabel is not read/function?  (Read 2533 times)

bachphi

  • Hero Member
  • *****
  • Posts: 674
    • View Profile
Second BasicLabel is not read/function?
« 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
Code: [Select]
BasicLabel1.PLCAddressValue = Print_TxtArray[0]
BasicLabel2.PLCAddressValue = Print_TxtArray[2]      '[1] is too long






The textbox grab the lengthy data from BasicLabel1.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Second BasicLabel is not read/function?
« Reply #1 on: January 14, 2021, 08:06:44 PM »
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.

Godra

  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Second BasicLabel is not read/function?
« Reply #2 on: January 14, 2021, 09:16:24 PM »
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.
« Last Edit: January 14, 2021, 10:56:43 PM by Godra »

bachphi

  • Hero Member
  • *****
  • Posts: 674
    • View Profile
Re: Second BasicLabel is not read/function?
« Reply #3 on: January 15, 2021, 08:20:03 PM »
There seemed to be a simpler way to read Any custom string without too much complicating extraction:

Code: [Select]
    Public Class UDTStringCustom
        Dim s1 As String
    End Class

....
Dim MyUDT As UDTStringCustom = PLC.ReadUDT(Of UDTStringCustom)("LastBatch")
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Second BasicLabel is not read/function?
« Reply #4 on: January 16, 2021, 12:52:22 AM »
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.

bachphi

  • Hero Member
  • *****
  • Posts: 674
    • View Profile
Re: Second BasicLabel is not read/function?
« Reply #5 on: January 16, 2021, 08:14:25 AM »
Since there already is a
Code: [Select]
PLC.WriteCustomString() function, one can expect and hope that Archie is soon to have
Code: [Select]
PLC.ReadCustomString() to complete the set.  ;)
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================