Jump to content

Data Logging stops after ~30 minutes


Recommended Posts

Hello all.  I am trying to figure out a problem I am having with data logging.  It is my hope you could help me out with this.

I am running a V1210 with a V200-18-E4XB IO snap in.  I am trying to log data to an SD card for long periods of time.

To do so, I am using the "Write Data Table to SD" utility and copying the data from a previously populated table.  I have already checked and found that I am able to write the data to the table no problem.  However, when i run the data logging for an extended period of time, eventually data logging to the SD card stops (I am watching the write success bit, which gets set to 0 permanently when data logging stops).  It seems to be stopping within ~30m when there are zero user inputs being applied.

I am writing to the DT1 folder using the udt file name of Testlog.udt.  I am selecting to append to .udt file.

My code waits for the data logging toggle to be pressed from the hmi.  When it is, a direct contact goes to a 1 second timer.  After 1 second, I check to see that my counter (starts at 0) is less than 5, update the clock values, then write 10 values to the data table using the "Data Table Write Row" function.  I then increment my counter.  Note that my data table has 5 rows.

The next net checks if the counter is greater than or equal to 5.  If so, the code passes through inverted SB 341 (to make sure the SD card is not currently being written), then runs the "Write Data Table to SD" utility.  I then reset the counter after the data write utility is executed (this is in series with the utility and is not called when data logging to the SD card fails).

I have attached images of the code, the write to sd card utility settings, and the data table.

Any help is appreciated.data_logging.thumb.png.3fb1d3dd921103e29ccc908cfa3c56f7.png

 

data_logging3.png

data_logging4.png

Link to comment
Share on other sites

  • MVP 2023

Hi jkoenig, perhaps you have missed the info about size limits for SD card folders.  Using the index in Help, find SD and then look at SD cards.  In there you will eventually find the 64 files limit references, under Folders and File types. This might be the explanation and you might need to change your procedures/methods.

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023

Try making TD13 in net 2 a positive transitional.  At present it appears to be writing every scan if MB211 is on.  Or change some of your other contacts to transitionals, so that they only work for one scan.

The little people inside the PLC are running out of breath doing the same thing again and again and again.  ?

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023
2 hours ago, Ausman said:

Try making TD13 in net 2 a positive transitional.

Looks to me like TD 13 IS a positive transitional, since it's a self-resetting timer. It's only on for one scan.

Also, for future reference to jkoenig, since you're doing one per second, you can use SB 13 instead and save a few keystrokes.

Link to comment
Share on other sites

I actually didn't use SB 13 in case I wanted to modify the rate of data acquisition. Also, following the code as it runs I seem to be incrementing once per second, so I don't think that is an issue. I could try replacing the timer with SB 13 just in case though.

Beyond that, I was thinking to get around this issue I could try using the write row to SD card function, but I'll be honest it's driving me a little crazy that I can't figure out the error for the function I'm currently using. I just ran the data logging for ~30 minutes again and got an output of 64 for the status message bit. I'm not sure if that's being buggy or if that actually means something, as the bits only go from 0-10.

Link to comment
Share on other sites

  • MVP 2023
9 hours ago, Flex727 said:

Looks to me like TD 13 IS a positive transitional, since it's a self-resetting timer.

Yep, missed that in the first net.  Perhaps it is one of my stooopid days today.

Next theory on the issue is that anything to do with SD card read/writes happens veryyy slowlllyyy.  Try reading/writing to the card online and see how slowly it goes.  Maybe you are running out of time and the card write is not actually finished.  Trial making TD13 a minute and see what happens.

And

8 hours ago, jkoenig said:

I just ran the data logging for ~30 minutes again

Edit...I just noticed you are using Append!   Doesn't this mean that you have (60/6) x 30) ie 300 writes to the card?  Which again gets back to my original comment about 64 files.

cheers,

Aus

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