clint226 Posted November 9, 2016 Report Share Posted November 9, 2016 Hi support and forum members I have successfully used the Visilogic project examples to log data using an SD Card. However, the example program uses SB13 to write data to the SD card every 1 second. This is far too frequent for my application. I want to log data every minute, or every 10 minutes. How can I reduce the write frequency? Do I need to use some delay timers? Can anybody assist me with the correct/optimal ladder for this. Picture of code attached. I'd also like to know how to display the free space in MB or GB left on the SD card Best Regards Quote Link to comment Share on other sites More sharing options...
Kikis Posted November 9, 2016 Report Share Posted November 9, 2016 Hello, Use a self-resetting timer with 1 min preset setting (attached example) so that you get a pulse every minute. Then replace SB13 with the direct contact of this timer. SD card's free space is shown in SBW 59. Capacity is given in 512-byte chunks. Note that you have to SET SB 217 to enable writing into SBW 59. Then just link SDW 59 to a numeric entry variable on the screen. 1 Quote Link to comment Share on other sites More sharing options...
Cam Posted November 9, 2016 Report Share Posted November 9, 2016 I'd use a timer set for the frequency that you want to log at as you mentioned. As for the amount of free space on the card SDW 59 shows the amount of free space left on the card with some math you can display it in MB or GB. 1 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted November 9, 2016 MVP 2022 Report Share Posted November 9, 2016 Just use a self-resetting delay timer, as follows: T0 T0 -|/|------( )- ------------------------ T0 -|P|-, in place of SB13 2 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted November 9, 2016 MVP 2022 Report Share Posted November 9, 2016 In theory a self-resetting timer set at 60 seconds will count to the minute, but there are innate scan time variations involved which cause errors over time. For all my minute by minute logging I need it done exactly on the minute, so that it can be correctly interpreted into Excel later. I use an = 0 comparison on SI30, which turns on an MB. I then use a positive transition of this MB to activate the log row write. The logging row itself includes time and date for reference/display in Excel. For different "on the minute, but at minute multiples" counts, you can achieve the same thing with simple revolving count comparisons on SI36 triggering the MB. cheers, Aus 1 Quote Link to comment Share on other sites More sharing options...
clint226 Posted November 10, 2016 Author Report Share Posted November 10, 2016 All good solutions - thank you everyone! I will probably go with the timer Ausman - thanks, I like your method a lot. I probably don't need this degree of accuracy for this particular application but I will explore it nonetheless. That knowledge will certainly be useful for future. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted November 14, 2016 MVP 2022 Report Share Posted November 14, 2016 Thanks Clint. Re SDW59. It's all pretty self-explanatory. If you are ever bored, instead of getting a coffee, go cruising through the System operands. I still find things I didn't know about, or didn't have a previous need for which meant they weren't stored in the grey matter. ......Oh alright then, you can get the coffee to have whilst you do this! cheers, Aus 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.