Author Topic: CLX/CpLX Array Size  (Read 1897 times)

Phrog30

  • Guest
CLX/CpLX Array Size
« on: July 15, 2016, 10:59:42 PM »
Is it possible to grab an array size, either "standard" DINT, or UDT?  I know I can get the size within the PLC and send it to the app if necessary, just wondering if there is a fancy way to cut out the middle man.  Basically, I am writing some value to the PLC and want to ensure I'm within the boundaries.

Thanks,
James

Phrog30

  • Guest
Re: CLX/CpLX Array Size
« Reply #1 on: July 18, 2016, 08:17:29 PM »
Bueller....

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 214
    • View Profile
Re: CLX/CpLX Array Size
« Reply #2 on: July 18, 2016, 11:21:40 PM »
There isn't a way to give the driver a tag name and get the array size in return.

bachphi

  • Hero Member
  • *****
  • Posts: 674
    • View Profile
Re: CLX/CpLX Array Size
« Reply #3 on: July 19, 2016, 02:04:48 PM »
And how do you get the size within the PLC?
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 214
    • View Profile
Re: CLX/CpLX Array Size
« Reply #4 on: July 19, 2016, 02:25:47 PM »
There is an instruction called SIZE that will return an array size

Phrog30

  • Guest
Re: CLX/CpLX Array Size
« Reply #5 on: July 19, 2016, 07:54:12 PM »
Thank you for the reply.

bachphi

  • Hero Member
  • *****
  • Posts: 674
    • View Profile
Re: CLX/CpLX Array Size
« Reply #6 on: July 20, 2016, 07:50:00 AM »
No WAY!



Thanks.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

bachphi

  • Hero Member
  • *****
  • Posts: 674
    • View Profile
Re: CLX/CpLX Array Size
« Reply #7 on: July 20, 2016, 08:51:22 AM »
I've developed it a little further, now not only we can find the size of array, but also how much is occupied in that array. The cmdSend is a string and contain 'HELLO'.  Using FSC instruction, you can find  that there are 5 letters occupied that array.

===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 214
    • View Profile
Re: CLX/CpLX Array Size
« Reply #8 on: July 20, 2016, 11:41:37 AM »
If you want to know how many letters are in a string, just look a the .LEN property. cmdSend.LEN should = 5.

bachphi

  • Hero Member
  • *****
  • Posts: 674
    • View Profile
Re: CLX/CpLX Array Size
« Reply #9 on: July 20, 2016, 12:45:14 PM »
It's only a simple example to demonstrate the point. You can not really use LEN to find out in a case of UDT:  PalletData[STA_1_PAL].Fail_Code[FSC.POS]>0
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================