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.

Programming in C Language<br />

Write a File USER_WRITE_F<br />

Syntax<br />

SINT32 USER_WRITE_F(UINT32 pF_Id, UINT8 *pBuf, UINT32 Buf_Size)<br />

Description<br />

Writes data in the file specified by pF_id. The write always begins on the file pointer. After the write, the pointer is<br />

positioned on the last byte in the file.<br />

Parameters<br />

Inputs: pF_id: File identifier returned by <strong>function</strong> «USER_OPEN_F».<br />

pBuf: Buffer containing the data to be written.<br />

Buf_Size: Buffer size.<br />

Outputs: None<br />

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

pointer is automatically repositioned after the write.<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- *pBuf parameter error,<br />

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

Reposition the Pointer USER_SEEK_F<br />

Syntax<br />

SINT32 USER_SEEK_F(UINT32 pF_Id, UINT32 mode, SINT32 offset, UINT32 *Old_Ptr)<br />

Description<br />

Repositions the pointer for read or write in the file specified by pF_id.<br />

Parameters<br />

Inputs: pF_id: File identifier returned by <strong>function</strong> «USER_OPEN_F».<br />

mode: Seek start position. 0 seek from beginning of file.<br />

1 seek from current position.<br />

2 seek from end of file.<br />

offset: Signed offset relative to the mode selected.<br />

Outputs: Old_Ptr: Initial pointer value.<br />

REMARKS The pointer is different for each file.<br />

The pointer is an unsigned variable. Movement outside the file limits generates an<br />

error.<br />

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

16

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

Saved successfully!

Ooh no, something went wrong!