17.02.2013 Views

Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual

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.

4.5.9 Opening a File<br />

Function Libraries<br />

"MMC_FileOpen" allows you to open a file.<br />

This is an asynchronous Function Block. It transfers the<br />

job to the file system and checks if it has been completed.<br />

It needs to be run until the job has been handled<br />

successfully.<br />

Parameter Type Value Explanation<br />

adrname<br />

mode UINT<br />

POINTER<br />

TO STRING<br />

ADR(file name)<br />

0 create and open file<br />

1 open file to read<br />

2 open file to read/write<br />

handle INT file handle<br />

result INT<br />

0 running<br />

< 0 error<br />

> 0 job done<br />

'mode' constant defined Type Value<br />

MMC_OPENMODE_CREATE 0<br />

MMC_OPENMODE_READ UINT 1<br />

MMC_OPENMODE_READ_WRITE<br />

MMC_OPENMODE_CREATE will delete a file of the<br />

same name.<br />

The file handle is returned as 'handle' which is required for<br />

any subsequent operations such as read, write, or close.<br />

2<br />

101

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

Saved successfully!

Ooh no, something went wrong!