FP_AVERAGE_BUFFER_WRITE

Write to buffer for moving average and total values

This FP instruction writes the data specified by s into the buffer for moving average and total values specified by d_Start.

Parameters

Input

s (INT), (UINT)

Data area or equivalent constant for storing data to write in the buffer

Output

d_Start (WORD, INT, UINT)

Starting data area of the buffer

Remarks

If this instruction is executed when the writing pointer is indicating the final address in the buffer (n_Words defined by FP_AVERAGE_BUFFER_DEFINE), the writing pointer will be set to 0.

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the size (n_Words) of the buffer specified by d_Start is n_Words = 0, or when n_Words > 30000.

  • if the number of stored data items of the buffer = 0.

  • if the number of stored data items of the buffer > buffer size (n_Words).

  • if the writing pointer > buffer size (n_Words).

  • if the writing pointer is 30000 (16#7530) or higher after the data has been written.

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the size (n_Words) of the buffer specified by d_Start is n_Words = 0, or when n_Words > 30000.

  • if the number of stored data items of the buffer = 0.

  • if the number of stored data items of the buffer > buffer size (n_Words).

  • if the writing pointer > buffer size (n_Words).

  • if the writing pointer is 30000 (16#7530) or higher after the data has been written.

Example

Please refer to the example of FP_AVERAGE_BUFFER_DEFINE.

Modified on: 2022-07-04Feedback on this pagePanasonic hotline