Author Topic: Tag Structures to get the best performance for AB CompactLogix  (Read 1674 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Tag Structures to get the best performance for AB CompactLogix
« on: October 16, 2015, 03:13:42 PM »
I am starting a new application and and thinking about how to define my tags to keep the HMI responsive.   There will be many pushbuttons and discrete indicators with some integer and floating point value indicators.  I am supposing that rather than having a bunch of unique names for the tags, it would be better to group them into arrays.  Or am I overthinking this thing?

For instance, for the property PLCAddressHighLight, we might use a Tag: HMI_ButtonHighlight[0].0
so for 64 buttons, all the highlights could be handled by a 4 dint tag array, HMI_ButtonHighlight[0] ..  HMI_ButtonHighlight[3]
These are tags that are read are the polling rate, correct?

So in the case of tags that are written, is it relevant?  When Advanced HMI writes to a bit of a dint in the PLC, is it addressing the dint bit directly, or writing the whole Dint?

thanks for the great support!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Tag Structures to get the best performance for AB CompactLogix
« Reply #1 on: October 16, 2015, 04:31:53 PM »
You are on the right track. Arrays are grouped together and read in a single packet as long as the span between elements is not too great. However, it does get a little more complex and smarter. There is a multi-service request that can also group non-array items into the same packet as long as the packet doesn't exceed 500 bytes. In other words, you can have 5 unrelated DINTs that can update just as fast a 5 DINTs in a consecutive array.

But your idea of using bits in DINTs that are in an array is probably the most efficient.

As for writing, it doesn't really matter because writes are sent on demand. A write to a bit within in DINT is about the same as writing a full DINT. When writing bits in larger elements, a masked bit write is used that will send a value for ANDing then a value for ORing.

The CLX driver is extremely efficient with handling communications. If your total data is less than 500 bytes, then it will most likely get it within a single packet no matter what types of data it is. Wireshark is a very useful tool for seeing this. In Wireshark, look for a request packet, then go through the list until you see the same tags requested again, then you can count how many requests it took to make a round trip update.

If you are looking for maximum response time, set the PollRateOverride to 0 and the driver will update as fast as the PLC and network will let it. On my test setup I can get updates in as fast as 5ms.