5/11/2015 2:20 PM | |
Posts: 57 Rating:
|
My need is to use WRIT_DBL and READ_DBL to store and retrieve data to/from flash memoy card. My purpose is to work as follows: about writing
about reading:
DB2 attribute is "Only store in load memory". The attribute "Optimized block access" is not set. DB5 attribute "Optimized block access" is not set. When I try to compile my program (see attachment) I get an error on WRIT_DBL block. The error is: "Network 1,The reference information is inconsistent. The block cannot be compiled." No errors on the READ_DBL operation. Any hint? Attachmentrw_dbl_test.zip (524 Downloads) |
Last edited by: salrandazzo at: 5/11/2015 2:23:32 PM |
|
5/11/2015 3:55 PM | |
Posts: 5225 Rating:
|
Hi. Please see the HINTS in the attachment: The software is giving us a problem with the data consistency.. Greetings. AttachmentDesign Idea_Write to memory DB.zip (779 Downloads) |
This contribution was helpful to
1 thankful Users |
5/12/2015 3:59 PM | |
Posts: 57 Rating:
|
I wrote a working version of the WRIT_DBL and READ_DBL. Here the description: This program demonstrates the use of the WRIT_DBL and READ_DBL instructions. The purpose is to store information on the flash memory. This is the data organisation: DB1 (load flash memory) is used as retentive memory. DB2 (work memory) is used for normal work. DB1 is updated when DB2 changes with a WRIT_DBL operation that copies DB2 to DB1. DB1 is read into DB2 with a READ_DBL only at startup (OB100). When a request (write_record_request) arises, a new record will be written in the work memory (DB2) The work memory will then be written by FC1 into the load (flash) memory using WRIT_DBL. We just write the time (DTL 12 bytes) when the request goes on. A write pointer counts the next record to be written (0 to 5). When you turn off the power supply, data won't be lost and will be read at power on (OP100). The advantage if this method is that we have a lot of space to use, much more than the normal retentive memory. We can use part of the 4MB CPU load memory (it will also accomodate program and working DB) and a possible external 2 / 12 / 24 MB SMC card . AttachmentREAD_WRITE_DBL.zip (872 Downloads) |
This contribution was helpful to
4 thankful Users |
Follow us on