Data File without Sectors

To store user data to the SD memory card in a data file without sectors, proceed as follows:

  1. Insert the SD memory card.

  2. Write a data set by calling the function block SD_WRITE: SD_WRITE

    EN := TRUE (* FALSE/TRUE edge starts writing *)
    ATTRIB := 2 (* write append *)
    FILENO := 0…99 (* number of the file to which the data set is to be appended *)
    SEG := Address of the variable of the sector label (*any*)
    FORMAT := Data format
    NVAR := Number of values in data set
    ADRVAR := Address of the first variable to be written

    If no corresponding file exists, then it is created.

    The write process is successfully completed when output DONE:=TRUE and output ERR:=FALSE. A write error is indicated by ERR:=TRUE and ERNO<>0

  3. Further data sets can be written with the same function block settings after the completion message is indicated (output DONE=TRUE). This process is started with a FALSE/TRUE edge at input EN.

Note

The file USRDATxx.DAT is saved as USRDATxx.BAK for each write process. An “Open file / Write file / Close file” procedure is performed.