At a Glance

The tables below set out the methods for using the memory card once it has been formatted.

NOTE: The operations presented below only concern the Modicon M580 and M340 range.

Creating a File

The table below sets out the method for creating a file and adding information to it.

Step

Action

Related function

Comment

1

Create the file

CREATE_FILE

Returns the identifier (file descriptor) which will be used by the other functions.

2

Set the file attributes

SET_FILE_ATTRIBUTES

Optional

3

Display available space

GET_FREESIZE

Optional

This function can be called at any time.

4

Positioning in the file

SEEK_FILE

 

5

Write data into the file

WR_DATA_TO_FILE

 

6

Close the file

CLOSE_FILE

 

Opening a File for Reading/Writing

The table below sets out the methods for opening a file to read it or write data into it.

Step

Action

Related function

Comment

1

Open the file

OPEN_FILE

Returns the identifier (file descriptor) which will be used by the other functions.

2

Retrieve the file attributes

GET_FILE_INFO

Optional

3

Position in the file

SEEK_FILE

Optional

4

Display available space

GET_FREESIZE

Optional

This function can be called at any time.

5

Write data

WR_DATA_TO_FILE

 

6

Position in the file

SEEK_FILE

 

7

Read data

RD_FILE_TO_DATA

 

8

Close the file

CLOSE_FILE

 

Deleting a File

The table below sets out the method for deleting a file

Step

Action

Related function

1

Delete the file

DELETE_FILE

Function Limitations

The number of files that may be open at the same time is limited to 16.

The number of files that can be created depends on the storage capacity of the memory card.

The functions can only be used in the MAST task.

The memory card must have DATA-STORAGE rights to be able to use these functions.