14.1 AIN Extended Features [T-Series Datasheet]
Overview
Analog Input Extended Features (AIN_EF) simplifies many applications by combining data collection and analysis into a single step (register read).
AIN_EF can not be used in the stream scan list. Nor can it be used while streaming is running.
Operation
AIN_EF can be configured for one of several different modes. The selected mode controls how the data is collected and what analysis will be performed on that data. See the table below for a list of available modes.
Data Collection Methods
Depending on the selected mode, data is collected in one of two ways. Some modes require a single analog input (AIN) to be sampled repeatedly. For these modes, the T-Series device internally uses stream mode to acquire the necessary data. Any modes that utilize stream mode will be noted in the mode table.
In contrast, other modes simply require a single reading from one or more analog inputs. These modes operate in a standard command-response manner, similar to a regular read from AINx
Configuration
Configuration of the AIN_EF is accomplished by writing to to following registers:
Mode Selection: The desired analysis mode is set by writing its index number to the AIN#_EF_INDEX register.
Mode Configuration: Each mode has several configurations which control how the mode collects data and computes results. The mode specific configurations are set using the AIN#_EF_CONFIG_A through J registers. Refer to the specific mode's documentation for detailed information.
Reading Results
After configuration, the AIN_EF system is idle. Reading from the AIN#_EF_READ_A register initiates the data collection and analysis process. This is a blocking operation, meaning that the read will not return until the process is complete. When complete, the READ_A
register returns the primary result of the analysis and the AIN_EF will return to idle. If the selected mode produces more than one result, the additional values are saved and can be read from the AIN#_EF_READ_B, C, and D registers.
The total time for a read operation is determined by the number of samples required, the sampling rate, and the time for analysis and communication. An error will be thrown if the configured process is expected to take longer than 180 ms.
Configuring many channels for AIN_EF
When many analog input channels need to be configured to use an extended feature, there are several options for writing to the requested registers:
Kipling's Register Matrix - This option can be tedious. The Lua option is a much better option.
Lua - A simple script can be used to easily configure many channels for AIN_EF.
Custom application - Many of our customers write their own applications. This
Boot-up Configuration
The AIN_EF configuration can be saved in flash memory so that it will loaded next time the device boots up. See section 24.0 Device Configuration for more information.