Jump to content

Early Holiday Present


Recommended Posts

  • External Moderators

Attached is a program that writes a vector of 10 ML to the SD card as excel CSV data via a Data Table that acts as a buffer. This allows you to remove and re-insert the card without losing information.

I developed it for my own education, and wanted to share. In the Read Me text are instructions for importing it into your own program, including used memory ranges, and some important info I discovered along the way, so be sure to read it.

A couple of notes from the readme - I was unable to get the File Information FB to work, it always returned a status 16, so I did not use it. And there seems to be a bug in exporting / importing an Explore SD Contents screen object, the folder to open does not come across, and must be assigned manually (Excel 1, by the way).

Enjoy!

TM

SD Card with Buffer.zip

Link to comment
Share on other sites

  • External Moderators

Hi guys,

As far as the File Info FB, I couldn't get anything from it besides a status of 16 and a success bit going high, everything else was "0". I shut down all SD Write operations and toggled the FB manually, and that was still the result.

I was a little confused by the busy bit on this command, it uses (and requires at compile) SB 359, the Folder Report in Progress bit to control itself. However, there is also SB 343, File Report in Progress, which appears to be unused.

After exporting the various parts of the program for further import, I then imported them into a blank program to make sure everything came in and started properly. The only problem I saw then was in the View SD Contents object, the Folder to View (set to Excel 1 in the source program) was blank. I made a note of that and published.

Later yesterday evening, I tried importing the code into one of my own programs. This time, the View object's folder was randomly set to 100 (DT1).

Lastly, a bug report of my own - in the Data Tables Copy Rows function in Net 23 of the source, the Target Row Number operand is set to "MI 0". This should be a constant "0". It didn't produce a problem in the test program, since MI 0 wasn't used for anything.

Updated module attached.

Thanks,

TM

SD Card with Buffer Rev 1.zip

Link to comment
Share on other sites

  • External Moderators

One more observation:

In the source program, I linked ML 400 to an INC FB with a 1 sec pulse to change data for testing purposes. I've since tried it linked directly to a rail, and the buffer quickly overflowed, despite constant SD writes. The 100mS pulse worked fine, and gradually brought the buffer down as well.

It may be my card is not fast enough, but it looks like 100mS would be the best write speed, since you do want the buffer to eventually empty out.

Thanks,

TM

Link to comment
Share on other sites

  • 4 months later...

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.