Jump to content

Faster way to read Structure and Values (Datatables.dll)


drewh

Recommended Posts

Hi, I'm using the datatables dll to read in datatable information instead of the proposed way in the unitronics documentation. Before(with the old method) it would take a few seconds to read the datatable. With the Datatables dll it takes 10 minutes to read the structure and values.

This is the code I'm running.

DataTables tables = new DataTables(plc, DataTablesReadOptions.StructureAndValues);

If I just specify structure it will read it in a few seconds. With structure and values it takes a very long time.

Thanks for any help.

Link to comment
Share on other sites

Hi,

How big is your DT?

(How many tables. Do you know the total size of the Data Tables including Data on flash?)

using the way mentioned on the documentation, you probably read specific data (specific rows, or specific cells)... Now you are requesting to read the whole thing which in your case, might be big.

You can get only the structure (which you say it is fast for you), and then read the data of specific cells.

Your DataTables object contains a list of tables where you can access by either index or key, for example tables[0]

You can request Read/Write on specific cells: tables[0].Read(..........

Then iterate the cells that you read in order to get it's values

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.