AioSetAiRangeAll


Function

Sets the analog input range for all channels.

Format

Ret = AioSetAiRangeAll ( Id, AiRange )

Parameters

Id [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit function.

AiRange [ VB.NET : Short ] [ C, C++ : short ] [ 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 [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ 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
Use the Id retrieved from AioInit to specify the Id in this function.

10002

AIO driver can't be called
At first, perform AioInit function.

11060

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
To use this function, analog input operation must be stopped

21060

The value of AiRange is outside the designated range of the device being used

21061

JP of the device must be set in unipolar
JP on device was set bipolar.

21062

JP of the device must be set in bipolar
JP on device was set unipolar.

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.

Remarks

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
AI-1204Z-PCI

The range is only changed by performing the function.
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
-1.25 to 1.25V : AiRange = 3
0 to 10V : AiRange = 50
0 to 5V : AiRange = 51
0 to 2.5V : AiRange = 53
Initial value: AiRange = 0.
It can be set for each channel.

AIO-123202G-PE

The range is only changed by performing the function.
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
-1.25 to 1.25V : AiRange = 3
0 to 10V : AiRange = 50
0 to 5V : AiRange = 51
0 to 2.5V : AiRange = 53
0 to 1.25V : AiRange = 54
Initial value: AiRange = 0.
Cannot set to each channel.

AI-1664UG-PE

AIO-163202G-PE
AIO-163202UG-PE
AIO-123202UG-PE
AIO-163202F-PE
ADA16-32/2(PCI)F

The range is only changed by performing the function.
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
0 to 10V : AiRange = 50
0 to 5V : AiRange = 51
0 to 2.5V : AiRange = 53
Initial value: AiRange = 0.
Cannot set to each channel.

AIO-160802L-LPE
ADA16-8/2(LPCI)L
ADAI16-8/2(LPCI)L
AIO-160802LI-PE

-10 to 10V is fixed.

AI-1616L-LPE
AD16-64(LPCI)LA
AD16-16(LPCI)L
ADI16-16(LPCI)L
AI-1616LI-PE
AI-1664LA-LPE

-10 to 10V is fixed.

AD12-16(PCI)EV
AIO-121601E3-PE

The range is set by the JP settings and performing the function.
-10 to 10V : JP Bipolar settings, AiRange = 0
-5 to 5V : JP Bipolar settings, AiRange = 1
-2.5 to 2.5V : JP Bipolar settings, AiRange = 2
-1.25 to 1.25V : JP Bipolar settings, AiRange = 3
0 to 10V : JP Unipolar settings, AiRange = 50
0 to 5V : JP Unipolar settings, AiRange = 51
0 to 2.5V : JP Unipolar settings, AiRange = 53
0 to 1.25V : JP Unipolar settings, AiRange = 54
Initial value is set by the JP settings, AiRange = 0 or AiRange = 50.
Cannot set to each channel.

AD12-16U(PCI)EV
AIO-121601UE3-PE

The range is only changed by the JP settings.
-10 to 10V : Only the JP settings
-5  to 5V : Only the JP settings
-2.5 to 2.5V : Only the JP settings
0 to 10V : Only the JP settings
0 to 5V : Only the JP settings

AD16-16(PCI)EV
AD16-16U(PCI)EV
AIO-161601E3-PE
AIO-161601UE3-PE

The range is only changed by the JP settings.
-10 to 10V : Only the JP settings
-5 to 5V : Only the JP settings
0 to 10V : Only the JP settings
0 to 5V : Only the JP settings
Initial value is set by the JP settings, AiRange = 0 or AiRange = 50.
Cannot set to each channel.

AI-1216I2-PCI

The range is set by the JP settings and performing the function.
-10 to 10V : JP Bipolar settings, AiRange = 0
-5 to 5V : JP Bipolar settings, AiRange = 1
-2.5 to 2.5V : JP Bipolar settings, AiRange = 2
-1.25 to 1.25V : JP Bipolar settings, AiRange = 3
0 to 10V : JP Unipolar settings, AiRange = 50
0 to 5V : JP Unipolar settings, AiRange = 51
0 to 2.5V : JP Unipolar settings, AiRange = 53
0 to 1.25V : JP Unipolar settings, AiRange = 54
4 to 20mA : Only the JP settings
Initial value is set by the JP settings, AiRange = 0, AiRange = 50 or AiRange = 101.
Cannot set to each channel.

AD12-64(PCI)
AD12-16(PCI)

The range is only changed by performing the function.
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
-1.25 to 1.25V : AiRange = 3
0 to 10V : AiRange = 50
0 to 5V : AiRange = 51
0 to 2.5V : AiRange = 53
0 to 1.25V : AiRange = 54
Initial value: AiRange = 0.
It can be set for each channel.

AI-1604CI2-PCI

The range is set by the JP settings and performing the function.
-10 to 10V : JP Voltage settings, AiRange = 0
-5 to V : JP Voltage settings, AiRange = 1
0 to 10V : JP Voltage settings, AiRange = 50
0 to 5V : JP Voltage settings, AiRange = 51
4 to 20mA : JP Current settings, AiRange = 101
Initial value: AiRange = 0.
It can be set for each channel.

AI-1608AY-USB
AIO-160802AY-USB
AI-1608GY-USB
AIO-160802GY-USB

-10 to 10V is fixed.

AIO-163202FX-USB

The range is only changed by performing the function.
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
0 to 10V : AiRange = 50
0 to 5V : AiRange = 51
0 to 2.5V : AiRange = 53
Initial value: AiRange = 0.
Cannot set to each channel.

DEMO DEVICE

All ranges can be set. Initial value:  AiRange = 0.
It can be set for each channel.

AI-1664LAX-USB

-10 to 10V is fixed.

AIO-121602LN-USB
AIO-120802LN-USB

The range is only changed by performing the function.
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
0 to 10V : AiRange = 50
Initial value: AiRange = 0.
Cannot set to each channel.

AI-1608VIN-USB
AI-1608VIN-ETH

-10 to 10V is fixed.

AI-1608AIN-USB
AI-1608AIN-ETH

0 to 20mA is fixed.

AI-1004LY-WQ
AI-1004LY-WQ-EU
AI-1004LY-WQ-US
AI-1004LY-WQ-CN

-10 to 10V is fixed.

CPSN-AI-1208LI

The range is set by the switch and performing the function.
<Switch setting : Voltage input>
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
0 to 10V : AiRange = 50
<Switch setting : Current input>
-20 to 20mA : AiRange = 102
Initial value: AiRange = 0.
Cannot set to each channel.
Current input corresponds to differential input. Execution of AioSetAiInputMethod is necessary.

CPSN-AI-2408LI

The range is set by the switch and performing the function.
<Switch setting : Voltage input>
-10 to 10V : AiRange = 0
-5 to 5V : AiRange = 1
-2.5 to 2.5V : AiRange = 2
0 to 10V : AiRange = 50
0 to 5V : AiRange = 51
<Switch setting : Current input>
0 to 20mA : AiRange = 100
-20 to 20mA : AiRange = 102
Initial value: AiRange = 0.
It can be set for each channel.
Current input corresponds to differential input. Execution of AioSetAiInputMethod is necessary.

CPS-AI-1608LI

-10 to 10V is fixed.

CPS-AI-1608ALI

0 to 20mA is fixed.

Example

The range of all channels are set to -10 to10V.

VB.NET

Dim Ret As Integer
Ret = AioSetAiRangeAll ( Id , PM10 )
 

C, C++

long Ret;
Ret = AioSetAiRangeAll ( Id , PM10 );
 

C#

int Ret;
Ret = aio.SetAiRangeAll ( Id , (short)CaioConst.PM10 );
 

Python

Ret = ctypes.c_long()
Ret.value = caio.AioSetAiRangeAll ( Id , caio.PM10 )
 

See also

AioSetAiRange AioGetAiRange