Step 6 : Set Memory Type

You can select the memory type to be used in the transfer mode of device buffer and user buffer.

Memory Type of Device Buffer

1. FIFO

In the FIFO (First In First Out) type, conversion data writing into memory is always performed after the latest data, and data reading from memory is always performed from the oldest data.

If conversion data is stored in all of the memory while conversion data is stored, an overflow error occurs and conversion stops.

In FIFO, data can be read during AD conversion. Read data periodically so that the memory does not overflow. Therefore, it is possible to perform a long time sampling longer than the memory capacity.

The FIFO type is used to acquire all conversion data. It can be used for analog input under various conditions from sampling of specified number to infinite sampling.

2. RING

In RING type, the conversion data is sequentially written. When storing exceeds the upper limit of the memory, overwrites the old conversion data to store the new data. You can read data from memory anywhere. At this time, data reading is performed based on the writing position of current data.

The RING type is used to acquire the data with certain specific conditions. For example, when you need to acquire the data before and after the external trigger stop, or you want to acquire data at the moment that command (AioStopAi) is executed, use the RING memory.

 

Memory Type of User Buffer

1. Not overwrite the memory

Transfer stops when conversion data transfer is done to the end of the user buffer.
It is a valid memory type when the number of sampling times has been confirmed in advance.

2. Overwrite the memory

Transfer does not stop even if conversion data transfer is done to the end of the user buffer.
Until the conversion stop condition is satisfied, the memory is overwritten and transfer is performed.
It can be used for long time monitoring and infinite sampling which requires all data.

 

Set Memory Type

Use function AioSetAiMemoryType to set memory type.

Ret = AioSetAiMemoryType ( Id , AiMemoryType )

When using device buffer, set AiMemoryType = 0 in FIFO, set MemoryType = 1 in RING.
When using user buffer, set AiMemoryType = 0 to not overwrite, set MemoryType = 1 to overwrite.