Author Topic: Compact Logix - Tags with custom type  (Read 1499 times)

calimero100582

  • Newbie
  • *
  • Posts: 11
    • View Profile
Compact Logix - Tags with custom type
« on: December 15, 2015, 10:40:58 AM »
Hi

I have a CompactLogix with a Custom type wich I call CustomTimer containing Delay, and Count, both integer
I also have a CustomTimers array of 10 elements of type CustomTimer

I can read and write using CustomTimers[1].Delay, but when I try to simply read CustomTimers as an array, I got Driver Exception saying "No Response from PLC"

Is there an easy way to read/write such arrays, or I really need to scan all values one by one?

Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Compact Logix - Tags with custom type
« Reply #1 on: December 15, 2015, 01:42:17 PM »
You can only read atomic data types. The driver would not know how to return a UDT.

The next version will let you read UDTs, but they will only be returned as an array of bytes that you would have to write code to reassemble.

calimero100582

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Compact Logix - Tags with custom type
« Reply #2 on: December 15, 2015, 02:55:35 PM »
Thanks, I hope will be able to Write data also.

For my current issue, I'll have to do some check with a newer/current version of ADHMI

With an older version (3.68) I had issue with send queue full when writing large arrays or multiple values at once, and I had to add a Sleep between every Write (see: http://advancedhmi.com/forum/index.php?topic=444.msg1769#msg1769)

I updated AdvancedHMI to 3.99a, but I've not tested performance with it, and I am still using a Thread.Sleep between every Write

As I have a couple of arrays like my CustomTimers, I don't want to wait between every Write. I'll do some test to see if I still need the Sleep, as the Write is my main concern in this case, and for the moment I only have 20 values to write, but I expect to have more than 1000 values to write at once.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Compact Logix - Tags with custom type
« Reply #3 on: December 15, 2015, 07:35:23 PM »
The changes in 3.99a made all writes synchronous so you will not have to use sleeps.

aquilmustafa

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: Compact Logix - Tags with custom type
« Reply #4 on: December 23, 2015, 01:12:30 AM »
Hey Archie,

Even I'm using UDT with 3.99a version Is there a easy way around.

calimero100582

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Compact Logix - Tags with custom type
« Reply #5 on: January 28, 2016, 01:55:31 PM »
My workaround was to use an equivalent class in C# with .net reflection I loop through property and read every property from a base tag