ICP DAS USA LinPAC-22 Series User Manual page 26

Xv-board api functions
Table of Contents

Advertisement

ICP DAS
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
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.
AI0
AI1
:
AI3
Refer to Chapter 1.3: "Specifications" for details of other specifications for the XV-Board
together with the Modbus register table.
(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).
// Input voltage is 10 V
LinPAC-52xx Series XV-Board API User Manual
26

Advertisement

Table of Contents
loading

Table of Contents