Infinite Sampling Using Device Buffer


Appearance

 

Overview

This is a sample that performs sampling with a stop condition other than the Stop conversion by the specified times in device buffer mode.

Sampling data is added to the file that saves the data at Event that the specified number of data are transferred.

In addition to the current sampling count, the total sampling count since the start of sampling is retained/displayed.

This sample program requires selecting a device with an analog input function.

Sample specification

※This is the initial value of the sample program.
Please note that it is different from the initial value of the driver.

Program name

AiSamplingInfiniteDev

Conversion data transfer mode

0 (Device buffer mode)

Memory type

0(FIFO)

Buffer size for saving data

1MByte

Event

Event that AD conversion start, Event that device operation end, Event that the specified number of data are stored, Event that overflow, Event that AD conversion error, Event that sampling clock period error

 

Step to Use

1. Specify the desired program name, run the program, and a window that looks like the one above will appear.

  Appearance may vary depending on software version.

 

2. Initialize

 ・Specify the device name set in the device manager as the device name, and click the [AioInit] button.

  Notifies the device driver to start using the specified device.

 

3. Parameter Set

 ・Select the desired input range in [Range:] and press the [AioSetAiRangeAll] button.

  Depending on the device used, the setting may not be effective unless the input range is changed with the jumper pin on the device.

 ・Select the desired input method in [Input Method:] and press the [AioSetAiInputMethod] button.

 ・Enter the desired number of channels in [Number of Channels:] and press the [AioSetAiChannels] button.

  The starting channel number is fixed at 0ch. For example, if 3 channels are specified, data will be acquired from 0ch to 2ch.

 

4. Sampling condition setting

 ・When you press the [Condition Set...] button, the "Sampling Condition Settings" dialog box will be displayed.

  

  

 ・Select the desired start condition in [Start Condition:].

 ・Select the desired [Clock Type:] in the Sampling Clock Condition setting.

  If the Internal clock is selected, enter the sampling clock period in units of [μsec]. The minimum sampling clock period that can be specified depends on the device used.

  If the External clock is selected, data will be obtained at the cycle of the external clock connected to the device.

  You should also consider the number of channels you specified. For details, please refer to the item of [Glossary] Sampling clock error.

 ・In the Scan Clock Condition settings, enter the desired [Conversion Speed:] in units of [μsec].

  The minimum value that can be specified depends on the device used.

 ・Select the desired stop condition in [Stop Condition:]. Perform Level Comparison settings and In Range/Out Range Comparison settings according to the selected stop condition.

 ・When you press the [OK] button, all settings in the "Sampling Condition Settings" dialog box will be reflected in the device and you will return to the main window.

  When you press the [Cancel] button, all settings will be discarded and you will return to the main window.

 

5. Event that the specified number of data are stored Set

 ・Enter the desired number of sampling times in [Sampling Times:] and press the [AioSetAiEventSamplingTimes] button.

 

6. Sampling Operation

 ・Press the [Sampling Start] button to start sampling.

  An event occurs when the sampling data for the number of Sampling Times in the "Event that the specified number of data are stored Set] is stored in the FIFO memory.

  Every time an event occurs, the displayed values of [Total Sampling Count:] and [Sampling Count:] are updated.

  The acquired data will be saved in xxx.csv in the same hierarchy.

 ・When you press the [AioGetAiSamplingCount] button, the displayed value of [Total Sampling count:] is updated.

 ・When you press the [AioGetAiSamplingTimes] button, the displayed value of [Sampling Count:] is updated.

 ・Data sampling stops when the [Sampling Stop] button is pressed.

 

7. Exit

 ・Press the [AioExit] button to notify the device driver that the use of the current device is complete.

  Data can be acquired from different devices (e.g. AIO001, etc.) without terminating the program.

  To perform data acquisition processing again, specify a new device name and press the [AioInit] button to perform device initialization processing.

 

8. Processing to terminate the program

 ・Press the [Close] button in the window to terminate the program.