Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual Kuhnke Electronics Instruction Manual

17.02.2013 Views

Function Libraries 4.5.16 Opening, Writing, Closing a File "MMC_OWC" lets you write data to a file. The function will open the file, write the set number of data bytes, and close the file again afterwards. Users therefore need not worry about the file handle. Parameter Type Value Explanation name DWORD ADR(file name) mode UINT 0 create and open file 1 read access to file 2 read/write access to file buff DWORD pointer to write buffer count INT pSysInfo POINTER TO STRING error INT finished BOOL start BOOL number of bytes to be read ADR(systeminfo) 0 no error ? error code TRUE function performed FALSE executing function TRUE start function FALSE stop function 'mode' constant defined Type Value MMC_OPENMODE_CREATE 0 MMC_OPENMODE_READ UINT 1 MMC_OPENMODE_READ_WRITE MMC_OPENMODE_CREATE will delete a file of the same name. 110 E 700 GB 2

� Use 'start' to repeatedly run the function. Function Libraries � 'Finished' is TRUE when the defined process is complete. � There is no error if 'error' = 0 at that point; otherwise you can get the error code. FUNCTION_BLOCK MMC_OWC VAR_INPUT name:DWORD; mode:UINT; buff: DWORD; count: INT; pSysInfo:POINTER TO MMC_SYSINFO; END_VAR VAR_OUTPUT error: INT:=0; finished:BOOL:=FALSE; END_VAR VAR_IN_OUT Start:BOOL; END_VAR 111

� Use 'start' to repeatedly run the function.<br />

Function Libraries<br />

� 'Finished' is TRUE when the defined process is<br />

complete.<br />

� There is no error if 'error' = 0 at that point; otherwise<br />

you can get the error code.<br />

FUNCTION_BLOCK MMC_OWC<br />

VAR_INPUT<br />

name:DWORD;<br />

mode:UINT;<br />

buff: DWORD;<br />

count: INT;<br />

pSysInfo:POINTER TO MMC_SYSINFO;<br />

END_VAR<br />

VAR_OUTPUT<br />

error: INT:=0;<br />

finished:BOOL:=FALSE;<br />

END_VAR<br />

VAR_IN_OUT<br />

Start:BOOL;<br />

END_VAR<br />

111

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

Saved successfully!

Ooh no, something went wrong!