Jump to content

DT to SD as CSV


tmoulder

Recommended Posts

  • External Moderators

Sorry, couldn't resist :D

I've been wracking my brain about this, and was wondering if anyone has tried it - or perhaps if it's even necessary.

I'm working on a project where data is to be stored by the Vision to an SD card as an excel file (.csv if fine). Periodically, the user would remove the SD card to collect data. Simple, right?

But when the card is removed, the system may continue to run, and I don't want to lose any data.

My first thought was to use a data table as a buffer. Data collected goes into the buffer, and when the buffer is full, write to SD card, wipe the table and restart from the beginning. Simple, right?

Thing is, it seems from the docs that I can write a DT to an SD, but not in the form of a CSV. It's two separate functions. And I don't want the user to have to convert the DT to a CSV via SD Suite, because that's one more piece of software and one more step to getting their data.

It occurs to me I could read each row of data out of SD into operands, then write that line to CSV, then repeat. I get the sense this could take a long time to accomplish with a substantial buffer DT full of ML values, and my gut tells me this could be fraught with pitfalls.

Is there a utility somewhere I am overlooking that writes DT to SD as CSV, or has anyone else faced a similar challenge in the past, and have some handy advice?

Thanks!

TM

Link to comment
Share on other sites

There is no direct way to accomplish the operation you described. The workaround of storing the value in an operand and then sending it to the Excel file in the SD card is the correct and regular way to do that.

Writing each row takes one scan which is about 2ms. Even with hundreds of rows it won't take that long.

Link to comment
Share on other sites

  • 6 years later...

I also have a need for the customers (V130) to convert a DT to .csv on the SD card when required.  The interval for doing this is not known, customer driven.  The data table has 8 columns and 1000 rows.  Are there any future plans to incorporate this feature for DT's?

Link to comment
Share on other sites

  • MVP 2023

Probably not.  The Vision series is mostly mature from a functionality standpoint - they've literally filled it's little CPU brain with functionality.

Converting file types is a job for a real computer, which is why this sort of application is pushed toward the new UniStream.

Joe T.

  • Upvote 1
Link to comment
Share on other sites

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.