AioGetAiRange


Function

Retrieves the analog input range of each channel.

Format

Ret = AioGetAiRange ( 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.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the analog input range.

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
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.

11050

The value of AiChannel is outside the designated range of the function
Specify the channel setting in range: 0 <= AiChannel <= Max channel.

11051

Pointer to AiRange is NULL
Specify the address of variable to parameter.

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

21040

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

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.

Example

Retrieves the analog input range of channel 0.

C, C++

long Ret;
short AiRange;
Ret = AioGetAiRange ( Id , 0 , &AiRange );
 

Python

Ret = ctypes.c_long()
AiRange = ctypes.c_short()
Ret.value = caio.AioGetAiRange ( Id , 0 , ctypes.byref(AiRange) )
 

See also

AioSetAiRange AioSetAiRangeAll