AdvancedHMI Software
General Category => Open Discussion => Topic started by: M4 on January 26, 2022, 10:50:19 PM
-
Is there a way to read array size? In this case I am expecting 30
-
try this
https://docs.microsoft.com/fr-fr/dotnet/api/microsoft.visualbasic.information.ubound?view=net-6.0
-
Is there a way to read array size? In this case I am expecting 30
Clarification question: Are you wanting to provide a tag name and have the driver tell you what size the array is? I don't think the driver will do that via Read. What I would do is in your PLC, use the SIZE instruction, then read the result tag of the SIZE instruction.
-
It would be nice to have that array length finding in driver. What I did was use a button to start read (index loop) and driver throws tag not found error, where I use that catch exception to index length value to text box
-
It would be nice to have that array length finding in driver. What I did was use a button to start read (index loop) and driver throws tag not found error, where I use that catch exception to index length value to text box
I agree it would be nice, but there isn't a CIP object that is "hey tag, what is your length?". It is possible to get a tags array size when retrieving the tag list. I know Archie had a tag browser tool, not sure if that is baked into the main AdvancedHMI drivers. Archie can comment on that.
-
If you use the GetTagList function, it will return the array of tags and that information contains some properties that can be used to get the information you want:
TagName
NumberOfBytes
ArrayElements1
ArrayElements2
ArrayElements3
NumberOfDimensions