Chapter 7 Integrated OBs, SFBs and SFCs
CPU ADAM 821x
7-8
ADAM 8000 Manual CPU 821x – Rev 1.1
SFC 220 MMC_CR_F
Deploying this block, you may create a new res. access an existing file
when a MMC is plugged-in.
As long as you do not open another file, you may access this file via
read/write commands.
For deploying the SFCs 220, 221 and 222, you have to regard the following
restrictions:
•
A read res. write access to the MMC is only possible after creation res.
opening of the file via SFC 220.
•
The data on MMC must be unfragmentated, for only complete data
blocks may be read res. written.
When transferring data to the MMC from an external reading device, they
may be fragmentated, i.e. the data is divided into blocks. This may be
avoided by formatting the MMC before the write access.
At a write access from the CPU to the MMC, the data is always stored
unfragmentated.
•
When opening an already existing file, you have to use the same file
name and file size that you used at creation of this file.
•
A MMC is structured into sectors. Every sector has a size of 512Byte.
Sector overlapping writing or reading is not possible. Access to sector
overlapping data is only possible by using a write res. read command for
every sector. By giving the offset, you define the according sector.
The following picture shows the usage of the single SFCs and their
variables:
FILENAME
FILESIZE
512
Sektor
}
OFFSET
MMC
CPU
E
Memory
A
D
PTR
RET_VAL
BUSY
SFC 222 MMC_WR_F
SFC 221 MMC_RD_F
SFC 220 MMC_CR_F
Note!
For read and write accesses to the MMC, you firstly have to open the file
with SFC 220!
Description
Restrictions
11
x
21
x
51
x