AioGetAoRange


Function

Retrieves the analog output range for each channel.

Format

Ret = AioGetAoRange ( Id, AoChannel , AoRange )

Parameters

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

AoChannel [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the channel for that the analog output range is set.

AoRange [ VB.NET : Short ] [ C, C++ : short * ] [ C# : out short ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the analog output 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

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.

13110

The value of AoChannel is outside the designated range of the function
Specify the number of analog output channels in range: 0 <= AoChannels <= Max number of channels.

13111

Pointer to AoRange 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 output operation must be stopped.

23100

The value of AoChannel 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 output function.
If the device is in operation, the function cannot be performed.

Example

Retrieves the analog output range of channel 0.

VB.NET

Dim Ret As Integer
Dim AoRange As Short
Ret = AioGetAoRange ( Id , 0 , AoRange )
 

C, C++

long Ret;
short AoRange;
Ret = AioGetAoRange ( Id , 0 , &AoRange );
 

C#

int Ret;
short AoRange;
Ret = aio.GetAoRange ( Id , 0 , out AoRange );
 

Python

Ret = ctypes.c_long()
AoRange = ctypes.c_short()
Ret.value = caio.AioGetAoRange ( Id , 0 , ctypes.byref(AoRange) )
 

See also

AioSetAoRange AioSetAoRangeAll