AdvancedHMI Software
General Category => Support Questions => Topic started by: Phrog30 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
-
Bueller....
-
There isn't a way to give the driver a tag name and get the array size in return.
-
And how do you get the size within the PLC?
-
There is an instruction called SIZE that will return an array size
-
Thank you for the reply.
-
No WAY!
(https://s31.postimg.org/skig11p2j/SIZE.png)
Thanks.
-
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.
(https://s32.postimg.org/ltcgeev3p/Size_and_File_Search.png)
-
If you want to know how many letters are in a string, just look a the .LEN property. cmdSend.LEN should = 5.
-
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