Jump to content

Write entire Data Table to SD .csv file (VisiLogic)


Flex727

Recommended Posts

  • MVP 2022

I have come up with a routine to write an entire Data Table to an SD card .csv file with one button press (or other action) in VisiLogic. It requires 6 ladder rungs. Has anyone come up with something better?

By the way, it takes around 15-20 seconds for a 100-row Data Table.

image.thumb.png.ca8503a1800c979eebb77334d9eb451d.png

Link to comment
Share on other sites

  • MVP 2022

Why not just export as a udt and convert it on the PC using Data Tables Editor.  The ladder work is much simpler, and you've got the raw data stored safely off the system in another format before you convert it etc.  See the end picture which in your case would be even simpler....

https://forum.unitronics.com/topic/3460-write-table-to-sd-with-date-stamp/

cheers, Aus

 

Link to comment
Share on other sites

  • MVP 2022

I write one line at a time as it happens.  This is a case where having a conditional subroutine is actually a good idea. 

I have a subroutine to bump all the previous entries down one row (newest at the top) and then tack the newest one to the bottom of the .csv file:

image.png.59ff5e1ded73a7bab2cbcfcbffa1f0fe.png

 

Is there a reason you're writing all 100 rows?  Does the user remove or access the SD card regularly? 

Joe T.

Link to comment
Share on other sites

  • MVP 2022
18 hours ago, kratmel said:

One quastion: is it only SD Delimited Line write metod needed? (.csv file on SD)

Maybe Write Data table to SD file is better solution?

In this case it was a specific customer request. They wanted a .csv file on the SD card and they wanted to be able to insert a card and have the entire file written at once. This was my solution.

Link to comment
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.

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