AioInit


Function

Creates device file, then the device can be used.
To access a device, you need to perform this function in advance.
This function supports multi-process.

Format

Ret = AioInit ( DeviceName , Id )

Parameters

DeviceName [ C, C++ : char * ] [ Python : ctypes.c_char_p ]
Specifies the device name set by using Configuration Tool (config).

Id [ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies address of the variable that receives the ID.
The sequent functions can use the value stored in this variable to access the device.

Return values

Ret [ C, C++ : long ] [ Python : ctypes.c_long ]

Return values

Content

0

Normality completion

2

Failed in the registration of the interruption routine
If the device is with interrupt jumper, please do the necessary settings.

3

Failed in the allocation of the memory
Memory is insufficient. Terminate the unnecessary applications.

8

Initialization failed because caio.sys is not found

9

Initialization failed because the file version of caio.dll cannot be acquired

10

Initialization failed because the file version of caio.sys cannot be acquired

11

Initialization failed because the file version of caio.dll is not same as caio.sys

10000

The device name which wasn't registered by Configuration Tool was specified
Specify the right device name.

10003

Failed in the creation of the file
Please confirm whether the device driver has been started up normally in Configuration Tool (config).
If the device driver has not been started up normally, delete the device from Configuration Tool (config), and recognize the device again.

10100

A device name isn't stored in DeviceName
The string DeviceName is empty. Please store the device name into it.

10101

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

20000

It failed in memory allocation for the object preparation
Memory is insufficient. Terminate the unnecessary applications.

20035

It's need to upgrade the firmware

20036

It's need to upgrade the host driver

20100

The number of processes met an upper limit
Up to 16 processes can be executed simultaneously.

Remarks

When the function is first performed in process, all internal parameters are set to default values.
If the device is configured with registers, the registers are set to default values.
If the function AioExit isn't performed, even if AioInit is performed, the internal parameters don't return to the default values.
To return the internal parameters to their default values, please use AioResetDevice.

This function can be performed even if the device is in operation, but the operation of device doesn't stop.

Example

Performs initialization by device name "AIO000".

C, C++

long Ret;
short Id;
Ret = AioInit ( "AIO000" , &Id );
 

Python

Ret = ctypes.c_long()
Id = ctypes.c_short()
Ret.value = caio.AioInit ( "AIO000" , ctypes.byref(Id) )
 

See also

AioExit

Multi-process Device Device Name ID Resource