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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...