Thanks for reaching out.
- List out all the tags in a Control/Compact Logix system using the approach in list_tags.c. Then select your tag and create a tag handle to it with the correct size.
- Use an Omron PLC. These return the entire tag regardless of what you set the elem_count to. Internally the code forces elem_count to 1.
Unfortunately, neither of these methods are portable. Neither work on Modbus PLCs. You cannot list tags on a Micro800 series PLC. You can figure out all the data files in PCCC-based PLCs but I have not implemented those protocol features and it is more like listing tags (i.e. all at once, not one tag at a time).
There may be a way to get a tag's size in elements from a Rockwell PLC individually, but I have never found anything documented or even hinted anywhere. It would make a lot of sense to have such a feature, but if it exists, Rockwell is not making it easy to find.
In the future I will be adding some features for *Logix tag listing to make this more complete. If there is sufficient demand, I will look at listing out data files for PCCC PLCs like PLC-5 and MicroLogix.
Most kinds of PLCs do not have any standard way for you to determine what tags are defined. Some have proprietary ways of finding that information.