Author Topic: EthernetIP Read Array of Strings  (Read 2520 times)

FuzyDragon

  • Newbie
  • *
  • Posts: 19
    • View Profile
EthernetIP Read Array of Strings
« 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

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: EthernetIP Read Array of Strings
« Reply #1 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?

FuzyDragon

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: EthernetIP Read Array of Strings
« Reply #2 on: February 04, 2016, 01:09:17 PM »
I am using a standard string data with the PLC

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: EthernetIP Read Array of Strings
« Reply #3 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.


FuzyDragon

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: EthernetIP Read Array of Strings
« Reply #4 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

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: EthernetIP Read Array of Strings
« Reply #5 on: February 04, 2016, 02:43:32 PM »
Ah I see.  The driver returns strings.  Glad it's working now!