AdvancedHMI Software

General Category => Support Questions => Topic started by: FuzyDragon on February 04, 2016, 08:57:26 AM

Title: EthernetIP Read Array of Strings
Post by: FuzyDragon on February 04, 2016, 08:57:26 AM
Hello All,

I was curious if the EthernetIPforCLXCom1.Read command could read string values stored in arrays inside the PLC. I'm trying to compose different kinds of emails depending on different situations using the read command and the most I'm getting are numbers like 21516. I am currently using AdvancedHMI v 399a. Thanks in advance for any help.


Fuzydragon
Title: Re: EthernetIP Read Array of Strings
Post by: dmroeder on February 04, 2016, 11:05:53 AM
Are you using the standard string data type, or did you make your own string with a custom size?
Title: Re: EthernetIP Read Array of Strings
Post by: FuzyDragon on February 04, 2016, 01:09:17 PM
I am using a standard string data with the PLC
Title: Re: EthernetIP Read Array of Strings
Post by: dmroeder on February 04, 2016, 01:22:20 PM
So yes you can read STRING arrays, you'd do it like this:

Code: [Select]
dim stuff() as string = EthernetIPforCLXCom1.Read("TagName[0]", 5)
stuff() would contain the values of the first 5 strings in the array TagName.

Title: Re: EthernetIP Read Array of Strings
Post by: FuzyDragon on February 04, 2016, 02:08:26 PM
Thanks for the quick response. I see what I was doing wrong, my variables were just strings not string(). It's always the little things. Thanks again
Title: Re: EthernetIP Read Array of Strings
Post by: dmroeder on February 04, 2016, 02:43:32 PM
Ah I see.  The driver returns strings.  Glad it's working now!