MVP 2022 Flex727 Posted March 8, 2022 MVP 2022 Report Share Posted March 8, 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. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted March 8, 2022 MVP 2022 Report Share Posted March 8, 2022 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? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted March 8, 2022 MVP 2022 Report Share Posted March 8, 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 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted March 9, 2022 MVP 2022 Report Share Posted March 9, 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: Is there a reason you're writing all 100 rows? Does the user remove or access the SD card regularly? Joe T. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted March 9, 2022 Author MVP 2022 Report Share Posted March 9, 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.