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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

REMARKS Function «USER_OPEN_F» does not check the file type.<br />

Function «USER_OPEN_F» sets the file pointer to the first byte in the file.<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- *pF_id parameter error,<br />

- *pfilename parameter error.<br />

Close a File USER_CLOSE_F<br />

Syntax<br />

Description<br />

Closes a file opened by <strong>function</strong> «USER_OPEN_F».<br />

Parameters<br />

Inputs: pF_id: File identifier<br />

Outputs: None<br />

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

SINT32 USER_CLOSE_F(UINT32 F_Id)<br />

REMARK Since only a limited number of files can be opened simultaneously, <strong>function</strong><br />

«USER_CLOSE_F» must be used as soon as it is no longer necessary to have the<br />

file open.<br />

Read the Data in a File USER_READ_F<br />

Syntax<br />

SINT32 USER_READ_F(UINT32 pF_Id, UINT8 *pBuf, UINT32 Requestno, UINT32 No_read)<br />

Parameters<br />

Inputs: pF_id: File identifier returned by USER_OPEN_F.<br />

pBuf: Received data buffer.<br />

Requestno: Number of bytes to be read.<br />

Outputs: No_read: Number of bytes effectively read. If this number is less than the number requested, the<br />

end of the file was reached.<br />

REMARKS The data are read from the current position of the file pointer. The file pointer is<br />

automatically repositioned after the read.<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- *pBuf parameter error,<br />

- *pBuf+Requestno outside authorised area,<br />

- *No_read parameter error.

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

Saved successfully!

Ooh no, something went wrong!