Function
Sets the analog input range for each channel.
Format
Ret = AioSetAiRange ( Id , AiChannel , AiRange )
Parameters
Id
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the Device ID retrieved from AioInit function.
AiChannel
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the channel for that the analog input range is set.
AiRange
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the analog input range from the following range with macro or
value.
The available value differs by the device.
Range |
Macro |
Value |
-10 to 10V |
PM10 |
0 |
-5 to 5V |
PM5 |
1 |
-2.5 to 2.5V |
PM25 |
2 |
-1.25 to 1.25V |
PM125 |
3 |
0 to 10V |
P10 |
50 |
0 to 5V |
P5 |
51 |
0 to 2.5V |
P25 |
53 |
0 to 1.25V |
P125 |
54 |
0 to 20mA |
P20MA |
100 |
4 to 20mA |
P4TO20MA |
101 |
-20 to 20mA |
PM20MA |
102 |
1 to 5V |
P1TO5 |
150 |
Return value
Ret [ C, C++ : long ] [ Python : ctypes.c_long ]
Return values |
Content |
0 |
Normality completion |
7 |
Execute AioResetDevice function because the device has recovered from standby mode |
10001 |
Invalid
Id was specified |
10002 |
AIO
driver can't be called |
11040 |
The
value of AiChannel is outside the designated range of the function |
11041 |
The value of AiRange is outside the designated range of the function |
20001 |
This function can't be used by this device |
20002 |
Can
not use while by another device works |
21040 |
The value of AiChannel is outside the designated range of the device being used |
21041 |
The value of AiRange is outside the designated range of the device being used |
21042 |
JP
of the device must be set in unipolar |
21043 |
JP
of the device must be set in bipolar |
Initial value
It differs by the device type.
If the range is set by software, the initial value is the status when each
device is powered on.
If the range is set by jumper, the initial value is the factory settings.
(Hereafter, the jumper may be abbreviated as JP.)
Remarks
For the devices that cannot be set for each
channel individually, the range is set to all channels.
This function cannot be used on devices without the analog input function.
If the device is in operation, the function cannot be performed.
Specifications based on devices
AI-1204Z-PE |
The range is only changed by performing the
function. |
AIO-123202G-PE |
The range is only changed by performing the
function. |
AI-1664UG-PE |
The range is only changed by performing the
function. |
AIO-160802L-LPE |
-10 to 10V is fixed. |
AI-1616L-LPE |
-10 to 10V is fixed. |
AD12-16(PCI)EV |
The range is set by the JP settings and performing
the function. |
AD12-16U(PCI)EV |
The range is only changed by the JP settings. |
AD16-16(PCI)EV |
The range is only changed by the JP settings. |
AI-1216I2-PCI |
The range is set by the JP settings and performing
the function. |
AD12-64(PCI) |
The range is only changed by performing the
function. |
AI-1604CI2-PCI |
The range is set by the JP settings and performing
the function. |
AI-1608AY-USB |
-10 to 10V is fixed. |
AIO-163202FX-USB |
The range is only changed by performing the
function. |
AI-1664LAX-USB |
-10 to 10V is fixed. |
AIO-121602LN-USB |
The range is only changed by performing the
function. |
AI-1004LY-WQ |
-10 to 10V is fixed. |
CPSN-AI-1208LI |
The range is set by the switch and performing
the function. |
CPSN-AI-2408LI |
The range is set by the switch and performing
the function. |
CPS-AI-1608LI |
-10 to 10V is fixed. |
CPS-AI-1608ALI |
0 to 20mA is fixed. |
AI-1608VIN-USB |
-10 to 10V is fixed. |
AI-1608AIN-USB |
0 to 20mA is fixed. |
CPI-AI-1208LI |
The range is set by the switch and performing
the function. |
AIO-16256256-DEMO |
All ranges can be set. Initial value: AiRange
= 0. |
Example
The range of Channel 0 is set to -10 to 10V.
C, C++ |
long
Ret; |
Python |
Ret
= ctypes.c_long() |
See also
AioSetAiRangeAll AioGetAiRange