AioMultiAiSR


Function

Converts the more than one channel one time, the conversion data are returned in binary value on the wireless I/O device. This function supports multi-process.

Format

Ret = AioMultiAiSR ( Id , AiChannels , AiData , Timestamp , Mode )

Parameters

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

AiChannels [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the number of channels to be converted.

AiData [ VB.NET : Integer() ] [ C, C++ : long * ] [ C# : int[] ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the address of the array that stores the converted data. The converted data are stored in binary value.
Range of conversion data varies depending on the resolution of the device being used.

Resolution of device used

Range of conversion data

10 bit

0 to 1023

12 bit

0 to 4095

16 bit

0 to 65535

Timestamp [ VB.NET: UShort ] [ C, C++ : unsigned short * ] [ C#: out ushort ] [ Python : ctypes.POINTER(ctypes.c_ushort) ]
Specify the address of the variable to store the timestamp.

Mode [ VB.NET: Byte ] [ C, C++ : BYTE ] [ C#: out byte ] [ Python : ctypes.c_ubyte ]
Specify where to refer to the input data.

Definition

Value

Description

AIONET_MODE_DIRECT

0

Refer to the input data of Terminal.

AIONET_MODE_AP

1

Refer to the input data of Gateway.

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.

11440

The value of AiChannels is outside the designated range of the function
Specify the number of channels setting in range: 1 <= AiChannels <= Max number of channels.

11441

Pointer to AiData 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.

21441

The number of conversion channels was exceeded. It is converted on the maximum channel

Remarks

This function cannot be used on devices without the analog input function.
If the device is in operation, the function cannot be performed.

To acquire data, there are two methods. One is acquiring data stored in master unit, the other one is acquiring data directly from slave unit.
Please refer to the wireless I/O specification for features of each acquisition method.

For the data acquisition method, when acquiring the data stored in the master unit, you can acquire the time stamp of the data stored in the master unit.
The time stamp returns the time since the last update in seconds.
If the time stamp is longer than the update interval of the slave unit, the data from the slave unit is not reaching the master unit for some reason.
Please use it to check the validity of the data saved in the master unit.

Example

Converts from channel 0 to channel 3 one time.

VB.NET

Dim Ret As Integer
Dim AiData(3) As Integer
Dim Timestamp As UShort
Dim Mode As Byte
Mode = 0
Ret = AioMultiAiSR ( Id , 4 , AiData  , Timestamp , Mode )
 

C, C++

long Ret;
long AiData[4];
unsigned short Timestamp;
BYTE Mode;
Mode = 0;
Ret = AioMultiAiSR ( Id , 4 , &AiData[0] , &Timestamp , Mode );
 

C#

int Ret;
int[] AiData = new int[4];
ushort Timestamp;
byte Mode;
Mode = 0;
Ret = aio.MultiAiSR ( Id , 4 , AiData , out Timestamp , Mode );
 

Python

Ret = ctypes.c_long()
AiDataType = ctypes.c_long * 4
AiData = AiDataType()
Timestamp = ctypes.c_ushort()
Mode = ctypes.c_ubyte()
Mode.value = 0
Ret.value = caio.AioMultiAiSR ( Id , 4 , AiData , ctypes.byref(Timestamp) , Mode )
 

See also

AioSingleAiSR