FLASH_WRITE

../_images/b4fbfa46e38aa3370a33139000eba54e1

The Function Block writes a data set to a data segment in the Flash. For that purpose, two data segments are available for the AC500. A delete operation (Function Block FLASH_DEL) always deletes a complete data segment. A data segment consists of 1927 blocks (0 … 1926). Each block is composed of 34 bytes.

After a delete operation, data can be written only once to each of these 1927 data segment blocks. If a block containing data is to be overwritten with new data, the entire data segment has to be deleted first. In doing so, all data in this segment are lost.

Access to the Flash is only possible using the Function Blocks FLASH_DEL, FLASH_WRITE and FLASH_READ.

NB blocks are read starting at address SM and stored in the segment SEG starting at block BNR.

Either 32 binary data or 16 word data or 8 double word data are read per block.

One block contains 34 bytes:

32 bytes of data

1 byte CRC checksum

1 byte “written identifier”

(see figure at the end of this block description)

When a write operation of a data set is started (FALSE/TRUE edge at input EN), the data of the data set must not be changed until the end of the write procedure (DONE = TRUE). Storing the data set in the FLASH can take several PLC cycles.

With a FALSE/TRUE edge at input EN, the data set is written once. Until the storage procedure has not been finished (DONE = TRUE), input EN will not be evaluated again.

After the write operation is completed, the block outputs DONE, ERR and ERNO are updated. The storage was successful, if DONE = TRUE and ERR = FALSE. If DONE = TRUE and ERR = TRUE, an error occurred. The error type is signalized at output ERNO.

A new FALSE/TRUE edge at input EN starts a new write operation. Since without a previous deletion of the data segment no new data can be written to blocks which already contain data, the input BNR must point to the next free block for the next write procedure.

Available as of PLC runtime system: V1.0
Included in library: SysInt_AC500_V10.lib
Type Function Block with historical values