AdvancedHMI Software

General Category => Support Questions => Topic started by: calimero100582 on December 15, 2015, 10:40:58 AM

Title: Compact Logix - Tags with custom type
Post by: calimero100582 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
Title: Re: Compact Logix - Tags with custom type
Post by: Archie 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.
Title: Re: Compact Logix - Tags with custom type
Post by: calimero100582 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.
Title: Re: Compact Logix - Tags with custom type
Post by: Archie 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.
Title: Re: Compact Logix - Tags with custom type
Post by: aquilmustafa 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.
Title: Re: Compact Logix - Tags with custom type
Post by: calimero100582 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