Author Topic: reading a UDT  (Read 1200 times)

stenej

  • Newbie
  • *
  • Posts: 1
    • View Profile
reading a UDT
« on: February 13, 2016, 06:25:41 PM »
I just downloaded this product today and am trying to figure things out...
I have a UDT consisting of:
            Int32 SId;
            Single xL;
            Single yL;
            Single turn;

I have been able to read and write to the UDT using these methods (c#);

private AdvancedHMIDrivers.EthernetIPforCLXCom m_Plc;
m_Plc = new AdvancedHMIDrivers.EthernetIPforCLXCom();
m_Plc.IPAddress = "1.3.8.17";
m_Plc.ProcessorSlot = 0;

string [] sVal = new string [1];
sVal = m_Plc.Read("DyComplete[0].Sd", 1);

Then i go through the rest of them, reading the individual UDT member

And then the same for writing to the UDT.  I need to write the individual UDT member.

My question is I was hoping/thinking I could read the entire UDT with a single read.  Something like;
string [] sVal = new string [1];
sVal = m_Plc.Read("DyComplete[0]", 4);
But when I do that, i get errors.

Is that not possible?
Again, I just started working with this today, but could not find alot of help in the forums on UDTs

Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: reading a UDT
« Reply #1 on: February 13, 2016, 06:32:51 PM »
The driver only supports atomic data types and cannot read a full UDT. The main reason is because the drivers were originally intended to support the visual controls which can only display the basic data types.