ICP DAS
LinPAC-52xx Series XV-Board API User Manual
26
Read the Analog Input value for a single channel
Step1: Transfer the getxvai.exe file to the LP-22xx/52xx module.
Step2: Change the permissions for the file as shown below:
# chmod 755 getxvai.exe
Step3: Execute the program.
# ./getxvai 1
// Input voltage is 10 V
Remarks:
The following is a description of the demonstration.
(1) In this program, the address value for the
AI1
channel is
1
. Refer to the Modbus register
table for the XV310 module for more details. The table below provides the valid range for
register addresses.
Refer to Chapter 1.3: “
” for details of other specifications for the XV-Board
together with the Modbus register table.
AI0
AI1
:
AI3
(2) In this example, we set the type code of for the AI range to 08, which denotes that the
Analog Input range is +/-10 V. The table below gives an overview of the properties for the
Analog Input range.
(3) The default data format for AI/AO is hexadecimal, so we must first convert the
decimal
value to a
hexadecimal
value. For example, the decimal value
32767 (dec)
would be
expressed in hexadecimal format as
7FFF (hex)
.