Jump to content

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


Flex727

Recommended Posts

  • MVP 2023

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 2023

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 2023

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

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.