15.07.2013 Views

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Programming in C Language<br />

REMARKS If the filename already exists, the <strong>function</strong> returns error code «UF_ERRNAME». An<br />

existing file must first be deleted by <strong>function</strong> «USER_REMOVE_F» before the name<br />

can be reused for another file.<br />

After execution of <strong>function</strong> «USER_CREATE_F», the new file is empty. Function<br />

«USER_CREATE_F» is only used for data files. Function «USER_CREATE_F»<br />

does not automatically open the file. To open it, use <strong>function</strong> «USER_OPEN_F».<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- *pfilename parameter error.<br />

Delete a File USER_DELETE_F<br />

Syntax<br />

Parameters<br />

SINT32 USER_DELETE_F(SINT8 *pfilename)<br />

Inputs: pfilename: The path must not be specified because the user files are necessarily stored in a<br />

particular directory.<br />

Output: None<br />

REMARK If a file is always open, it is not deleted.<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- *pfilename parameter error.<br />

Open a File USER_OPEN_F<br />

Syntax<br />

Description<br />

SINT32 USER_OPEN_F(UINT32 *pF_id, SINT8 *pfilename)<br />

Opens the file identified by pfilename. This file is accessible for read and write. If the operation is executed normally,<br />

the file manager returns an identifier pF_id used by <strong>function</strong>s «USER_CLOSE_F», «USER_READ_F»,<br />

«USER_WRITE_F» and «USER_SEEK_F».<br />

Parameters<br />

Inputs: pfilename: The path must not be specified because the user files are necessarily stored in a<br />

particular directory.<br />

Output: pF_id: File identifier if the operation was correctly completed.<br />

en-938846/7 16 - 27<br />

16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!