Outdated Information
This online document might be outdated. Please see the LucidControl USB Analog Input Module PDF documentation instead.
3 USB Analog Input Module Data Acquisition and Operation
The LucidControl AI4 USB Analog Input Module measures the voltage of input signals.

Fig. 3-1 USB Analog Input Module – Signal Processing
Fig. 3-1 illustrates the processing of the analog input signals in Standard Mode. In order to keep the diagram simple it shows only two active channels. The blue lines are related to input channel 1, the red lines to input channel 2. The figure illustrates the periodical scanning of both input channels within the scan interval time TScan. TScan can be configured by the IO Configuration Parameter inAnScanTime.
3.1 Input Calibration
The LucidControl AI4 USB Analog Input Module measures analog signals (more precisely voltages) which are captured, conditioned and converted to digital values. In contradiction to logic signals where by nature only two states LOW and HIGH are possible for analog signals all voltages within a given range are converted to their representing digital value. The signal conditioning which is part of the measurement circuit consists of electrical components which are not free from tolerances (e.g. offset voltages of amplifier or tolerances of resistors). For the conditioning circuit components with low tolerances have been used in order to minimize these errors. The input calibration allows to compensate the remaining tolerances for each input. Note All modules are calibrated before shipping and it is not necessary to re-calibrate a new module nor is it necessary to calibrate it regularly!
3.1.1 Calibration Procedure
For short input calibration the inputs must be shortcut as it is shown in Fig. 3.1.1-1. After creating a shortcut e.g. by connecting the terminals 1 and 2 for input channel 0, the short input calibration can be executed by using the LucidIoCtrl command line tool. See the CalibrateIO command for more information. Example The short input calibration should be done for channel 0 and the result should be stored for further usage. LucidIoCtrl –dCOM1 –c0 –a --short –p –-quiet [ENTER]
In combination with the I/O Calibration command (-a) the short input calibration is specified (–short). Passing Parameter –quiet causes LucidIoCtrl to skip user confirmation before the command is started. Using Parameter –p makes the calibration setting persistent so that is used after a restart of the module. The short input calibration for channel 0 is finished and the remaining input channels can be calibrated the same way afterwards. Reading the input voltage after short input calibration was done should return a voltage of 0 V (assuming that the shortcut between the terminals was not removed) LucidIoCtrl –dCOM1 –c0 –tV –r [ENTER]
-> CH0:0.000
3.1.2 Offset Compensation
In some cases it is necessary to compensate an offset voltage by adding a value to the measured result. The value of the IO Configuration Parameter inAnOffset is added to the measured result. The Parameter can also be negative and allows an offset correction of ± 3 V.
3.2 Commands
After an input was set up correctly and configured it is possible to read the input value by using the commands GetIo for a single value or GetIoGroup in order to read a group of input values of the same type. Accessing inputs and outputs is a very common task which is mostly identical for all LucidControl modules. Please refer to the sections:
- LucidIoCtrl Commandline Tool (Read Command)
- General Lucid Control Documentation (Implemented Commands)
The following sections describe in detail the commands which are supported by the AI4 Anlog Input USB Module.
3.2.1 GetIo
This command reads the value of an analog input. Please see also the General LucidControl documentation for more information.
Command | GetIo | Access | Read | ||||
---|---|---|---|---|---|---|---|
Opcode | 0x46 | ||||||
LucidIoControl Command Line Tool | |||||||
Call (-tV) | LucidIoCtrl –d[COMx] –c[Channels] –tV –r |
||||||
Return | CHn:VV
|
||||||
Call (-tA) | LucidIoCtrl –d[COMx] –c[Channels] –tA –r |
||||||
Return | CHn:DD
|
Request Frame
OPC | P1 | P2 | LEN |
---|---|---|---|
0x46 | Channel | Value Type | 0 |
Value | Description | ||||||
---|---|---|---|---|---|---|---|
Channel | Number of input channel (Range: 0 ~ 3) | ||||||
Value Type |
|
2 Bytes | |||||
Signed Voltage Value (0x1D) |
Resolution: 1µV Value Range: 100,000,000 µV ~ 100,000,000 µV | 4 Bytes | |||||
Analog ADC Value (0x10) |
Value Range: 0 ~ 65,535 | 2 Bytes |
Response Frame
Status | LEN | Data Field |
---|---|---|
Status | Size | Value |
In case of successful execution the command returns the value of the specified channel number. In the case of an error the command returns Execution Status Code.
LucidIoCtrl Command Line Tool Example
Read voltage from input channel 0: LucidIoCtrl –dCOM4 –c0 –tV -r [ENTER]
Read digital ADC value from input channel 0:
-> CH0:5.000LucidIoCtrl –dCOM4 –c0 –tA -r [ENTER]
-> CH0:0x0064 (100)
3.2.2 GetIoGroup
This command reads the values of a group of analog inputs of the same Value Type. See also For more information about reading of analog inputs. Please see also the General LucidControl documentation for more information.
Command | GetIo | Access | Read | ||||
---|---|---|---|---|---|---|---|
Opcode | 0x48 | ||||||
LucidIoControl Command Line Tool | |||||||
Call (-tV) | LucidIoCtrl –d[COMx] –c[Channels] –tV –r Channels Comma separated list of channels e.g. –c0,1,3 |
||||||
Return | CHn:VV
|
||||||
Call (-tA) | LucidIoCtrl –d[COMx] –c[Channels] –tA –r Channels Comma separated list of channels e.g. –c0,1,3 |
||||||
Return | CHn:DD
|
Request Frame
OPC | P1 | P2 | LEN |
---|---|---|---|
0x48 | Channel Mask |
Value Type | 0 |
Value | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Channel Mask | Specifies the output channels to access
Values can be bitwise combined Examples Accessing channel numbers 0 and 3 -> Value = 0x01 OR 0x08 = 0x09 |
|||||||||||||||
Value Type |
|
2 Bytes | ||||||||||||||
Signed Voltage Value (0x1D) |
Resolution: 1µV Value Range: 100,000,000 µV ~ 100,000,000 µV | 4 Bytes | ||||||||||||||
Analog ADC Value (0x10) |
Value Range: 0 ~ 65,535 | 2 Bytes |
Response Frame
Status | LEN | Data Field |
---|---|---|
Status | Size | Value(s) |
In case of successful execution the command returns the value of the specified channels. In the case of an error the command returns Execution Status Code.
Example of GetIoGroup Request
This request frame reads the voltages of input channel 0 and 1 Request Frame
OPC | P1 | P2 | LEN |
---|---|---|---|
0x48 | 0x03 | 0x00 | 0x00 |
Channel Mask (P1) = 0x01 OR 0x02 = 0x03 Response Frame For input channel 0 = 5.000 V, input channel 1 = 2.500V Values in Data Field are in ascending order Channel 0 and Channel 1.
Header Field | Data Field | ||||||||
---|---|---|---|---|---|---|---|---|---|
Status | LEN | Value Channel 0 | Value Channel 1 | ||||||
0x00 | 0x08 | 0x40 | 0x4B | 0x4C | 0x00 | 0xA0 | 0x24 | 0x26 | 0x00 |
3.2.4 CalibrateIO
This command performs the short input calibration.
Command | GetIo | Access | – |
---|---|---|---|
Opcode | 0x52 | ||
LucidIoControl Command Line Tool | |||
Call | LucidIoCtrl –d[COMx] –c[Channel] –a {--quiet} {–p} {--short} |
Request Frame
OPC | P1 | P2 | LEN |
---|---|---|---|
0x52 | Channel | 0x00 | 0x00 |
Value | Description |
---|---|
Channel | Number of input channel (Range: 0 ~ 3) |
Response Frame
Status | LEN |
---|---|
Status | 0x00 |
The command does not return any data. In the case of an error the command returns Execution Status Code.
3.3 Parameters
LucidControl modules allow configuration by a set of System Configuration Parameters and IO Configuration Parameters. The Parameters are accessible by using the SetParam command and GetParam command which are described the genreral LucidControl documentation.
3.3.1 inAnValue
This IO Configuration Parameter contains the ADC value of the input.
Parameter | inAnValue | Access | Read |
---|---|---|---|
Address | 0x1000 | ||
Values | ADC Input Value | ||
Default Value | 0x00 | Parameter Type | 2 Bytes unsigned |
LucidIoControl Command Line Tool | |||
ParameterName | inAnValue | Parameter Values | 0 ~ 65,535 |
Call (Get) | LucidIoCtrl –d[COMx] –c[Channel] –ginAnValue |
LucidIoCtrl Command Line Tool Example
Read value of input channel 0: LucidIoCtrl –dCOM4 –c0 –ginAnValue [ENTER]
Note For normal operation it is recommended to use the GetIo function in order to read the input value. The parameter provides the ADC Value (Value Type 0x10) only.
-> inAnValue=0
3.3.2 inAnMode
This IO Configuration Parameter configures the operation mode of the input.
Parameter | inAnMode | Access | Read / Write | ||||||
---|---|---|---|---|---|---|---|---|---|
Address | 0x1100 | ||||||||
Values | Input Mode
|
||||||||
Default Value | 0x00 | Parameter Type | 1 Byte unsigned | ||||||
LucidIoControl Command Line Tool | |||||||||
ParameterName | inAnMode | Parameter Values | inactive / standard | ||||||
Call (Set) | LucidIoCtrl –d[COMx] –c[Channel] –sinAnMode=[Value] {-p} {--default} |
||||||||
Call (Get) | LucidIoCtrl –d[COMx] –c[Channel] –ginAnMode |
LucidIoCtrl Command Line Tool Example
Set operation mode of input channel 0 to Standard Mode and make the setting persistent. LucidIoCtrl –dCOM4 –c0 –sinAnMode=standard –p [ENTER]
Read the operation mode of input channel 0 LucidIoCtrl –dCOM4 –c0 –ginAnMode [ENTER]
-> inAnMode=standard
3.3.3 inAnScanTime
This IO Configuration Parameter specifies the scan time TScan of the digital input. TScan defines the scan time interval within the input signal must be stable in order to detect it as valid.
Parameter | inAnScanTime | Access | Read / Write |
---|---|---|---|
Address | 0x1111 | ||
Values | TScan in µs (micro seconds) 50 ms ≤ TScan ≤ 10 s | ||
Default Value | 200 (200 ms) | Parameter Type | 2 Bytes unsigned |
LucidIoControl Command Line Tool | |||
ParameterName | inAnScanTime | Parameter Values | TScan [µs] |
Call (Set) | LucidIoCtrl –d[COMx] –c[Channel] –sinAnScanTime=[Time] {-p} {--default} |
||
Call (Get) | LucidIoCtrl –d[COMx] –c[Channel] –ginAnScanTime |
LucidIoCtrl Command Line Tool Example
Set TScan of input channel 0 to 0.5 s and make the setting persistent. LucidIoCtrl –dCOM4 –c0 –sinAnScanTime=500 –p [ENTER]
Read TScan parameter of input channel 0 LucidIoCtrl –dCOM4 –c0 –ginAnScanTime [ENTER]
-> inAnScanTime=500
3.3.4 inAnOffset
This IO Configuration Parameter configures the Input Offset Compensation Value.
Parameter | inAnOffset | Access | Read / Write |
---|---|---|---|
Address | 0x1120 | ||
Values | Offset Compensation in 100 µV steps (-3 V ~ 3 V) -30,000 ~ 30000 | ||
Default Value | 0 | Parameter Type | 2 Bytes unsigned |
LucidIoControl Command Line Tool | |||
ParameterName | inAnOffset | Parameter Values | Voltage [100 µV] |
Call (Set) | LucidIoCtrl –d[COMx] –c[Channel] –sinAnOffset=[Voltage] {-p} {--default} |
||
Call (Get) | LucidIoCtrl –d[COMx] –c[Channel] –ginAnOffset |
LucidIoCtrl Command Line Tool Example
Set Input Offset Compensation value of input channel 0 to -500µV and make the setting persistent. LucidIoCtrl –dCOM4 –c0 –sinAnOffset=-5 –p [ENTER]
Read Offset Compensation value LucidIoCtrl –dCOM4 –c0 –ginAnOffset [ENTER]
-> inAnOffset=-5
3.3.5 inAnCal
This IO Configuration Parameter configures the short calibration value. The value does not have a unit and even if it possible it is not recommended to set this value manually.
Parameter | inAnCal | Access | Read / Write |
---|---|---|---|
Address | 0x1130 | ||
Values | Short Calibration Value 0 ~ 65,535 | ||
Default Value | 0 | Parameter Type | 4 Bytes unsigned |
LucidIoControl Command Line Tool | |||
ParameterName | inAnCal | Parameter Values | 0 ~ 65,535 |
Call (Set) | LucidIoCtrl –d[COMx] –c[Channel] –sinAnCal=[Value] {-p} {--default} |
||
Call (Get) | LucidIoCtrl –d[COMx] –c[Channel] –ginAnCal |
LucidIoCtrl Command Line Tool Example
Read Short Calibration Value of input channel 0 LucidIoCtrl –dCOM4 –c0 –ginAnCal [ENTER]
-> inAnCal=760
Previous | Top | Next |
---|---|---|
2 Setup and Installation | LucidControl USB Analog Input Module Content | 4 Specification |
Leave a Reply
Want to join the discussion?Feel free to contribute!