Author Topic: Reading array of UDT's  (Read 1222 times)

cmullis

  • Newbie
  • *
  • Posts: 3
    • View Profile
Reading array of UDT's
« on: November 25, 2015, 08:46:35 PM »
I have an array (10000) of UDT's. The udt has 4 DINT's and 1 string in the structure. What is the fastest way to read this type of structure? Using a For Loop will take about 18 minutes based on my calculations. I am trying to pull a bunch of data out of the PLC so that I can parse it and build some reports with it.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Reading array of UDT's
« Reply #1 on: November 26, 2015, 07:01:51 AM »
Your best chance may be to use BeginReadMultiple to read each UDT element at a time. Even this will take 10,000 reads. Any way you go about it, reading almost 1Mb of data is going to take some time.

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Reading array of UDT's
« Reply #2 on: November 26, 2015, 09:18:05 AM »
This is a strong case for storing it to a database.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================