USB Analog and Digital IO Modules

LucidControl USB IO Modules

  • Data acquisition and control
  • Cost effective and flexible
  • Platform independent
  • Windows® and Linux
  • Compatible with RPi and Beagle Bone
  • Clippable on DIN-Rail
Read More ...
  • Industrial & home automation
USB Digital Input Module

USB Digital Input Module

LucidControl Product Series

  • 4 / 8 digital inputs
  • For 5V, 10V and 24V signals
  • Opto insulated contacts
  • Counters and edge detectors
Read More ...
USB Digital Output Module

USB Digital Output Module

LucidControl Product Series

  • Opto insulated option
  • 4 / 8 digital outputs
  • Relay module option
  • Pulse width modulation and timers
Read More ...
  • Switching and power control applications
USB Analog Input Module

USB Analog Input Module

LucidControl Product Series

  • Measurement range options
  • 4 analog inputs
  • e.g. 0-10 V or 0-20mA
  • 14 bit resolution
Read More ...
  • Acquisition of sensor signals
USB Analog Output Module

USB Analog Output Module

LucidControl Product Series

  • 4 analog outputs
  • Output range options
  • e.g. 0 - 10 V or 4 - 20 mA
  • 12 bit resolution
Read More ...
  • 4 - 20 mA current interfaces
USB RTD Input Module for Pt100 / Pt1000 with 8 Channels

USB RTD Input Module

LucidControl Product Series

  • 4/8 Pt1000/Pt100 RTD inputs
  • Temperature range: -180 ~ 180 °C or 0 ~ 360°C
  • 0.1 °C resolution
  • Heat control applications
Read More ...
  • Logging of temperatures

3 USB Analog Input Module Data Acquisition and Operation

The LucidControl AI4 USB Analog Input Module measures the voltage of input signals.

LucidControl Analog Input USB Module - Signal Processing

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:

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

n Input Channel
VV Input Voltage
Call (-tA) LucidIoCtrl –d[COMx] –c[Channels] –tA –r
Return CHn:DD

n Input Channel
DD Analog ADC Value

Request Frame

OPC P1 P2 LEN
0x46 Channel Value Type 0
Value Description
Channel Number of input channel (Range: 0 ~ 3)
Value Type
Value Type Value Range Size
Signed Voltage Value
(0x1C)
Resolution: 1 mV Value Range: -30,000 mV ~ 30,000 mV
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]
-> CH0:5.000
Read digital ADC value from input channel 0: LucidIoCtrl –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

n Input Channel
VV Input Voltage
Call (-tA) LucidIoCtrl –d[COMx] –c[Channels] –tA –r Channels Comma separated list of channels e.g. –c0,1,3
Return CHn:DD

n Input Channel
DD Analog ADC Value

Request Frame

OPC P1 P2 LEN
0x48 Channel
Mask
Value Type 0
Value Description
Channel Mask Specifies the output channels to access

Channel Bit Position Value
0 0 0x01
1 1 0x02
2 2 0x04
3 3 0x08

Values can be bitwise combined Examples Accessing channel numbers 0 and 3 -> Value = 0x01 OR 0x08 = 0x09
Accessing channel numbers 1 and 2 -> Value = 0x02 OR 0x04 = 0x06

Value Type
Value Type Value Range Size
Signed Voltage Value
(0x1C)
Resolution: 1 mV Value Range: -30,000 mV ~ 30,000 mV
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]
-> inAnValue=0
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.


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

Byte Mode
0x00 Inactive
0x01 Standard
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