fsMediaQuickFormat (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


This performs a quick format of the media.

 

The formatting performed is a Quick Format, which means that all files and directories are erased but a full format with full sector initialization will not be performed.

 

 

Input:

media : INT (0..3)

The media to format.

 

full : BOOL (default: FALSE)

When TRUE a full format of the drive is performed.

Important: This parameter is only used for the internal drive of NX32L devices.

 

Returns: INT

0

- Media is formatted.

-1

- Media is not open.

-16

- Media not present.

-17

- Media communication error (card not supported).

-22

- Media is busy.

-23

- Media is write protected.

-24

- Unknown file system.

-39

- The media is busy because a platform extension is used.

 

Declaration:

FUNCTION fsMediaQuickFormat : INT;
VAR_INPUT
  media : INT;
  full  : BOOL := FLASE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
VAR
  cmd : STRING;
END_VAR;
 
PROGRAM FileExample;
 
// Open media
fsMediaOpen(media := 0);
 
BEGIN
  ...
  IF cmd = "format" THEN
     rc := fsMediaQuickFormat(media := 0);
    IF rc = 0 THEN
        DebugMsg(message := "Media formatted!");
    ELSE
        DebugFmt(message := "Media formatting failed! (\1)", v1 := rc);
    END_IF;
  END_IF;
  ...
END;
 
END_PROGRAM;