Jump to content

DT to SD as CSV

Recommended Posts

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?



Link to post
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 post
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 post
Share on other sites

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 post
Share on other sites

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.

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