DioOutMultiBit


Function

Outputs multiple bits to the output bits.

Format

Ret = DioOutMultiBit ( Id , &BitNo[0] , BitNum , &Data[0] )

Parameters

Id [C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.

BitNo [C:short *] [Python: ctypes.POINTER(ctypes.c_short)]
Stores the logical output bit numbers into an array. Specifies the base address of this array.

BitNum [C:short] [Python: ctypes.c_short]
Specifies the number of bits which are specified by BitNo. The maximum number of bits is 256.

Data [C:unsigned char *] [Python: ctypes.POINTER(ctypes.c_ubyte)]
Stores the output data into an array. Specifies the base address of this array. The output data is set to 0 or 1.

Return Value

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

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal complete

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Driver cannot be called (failed in ioctl).

DIO_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

DIO_ERR_SYS_NOT_SUPPORTED

20001

This function cannot be used for this device.

DIO_ERR_SYS_BIT_NO

20102

Bit number is outside of the available range.

DIO_ERR_SYS_BIT_NUM

20103

Number of bits is outside of the available range.

DIO_ERR_SYS_BIT_DATA

20104

Bit data is neither 0 nor 1.

The other errors: (See also: Error code details)

Initial Value

The initial value of the output data is 0, after the device was reset.

Remarks

Outputs multiple bits to the output bits. Before this function is called, it is necessary that the logical bit numbers to be output are set into the array specified by BitNo.
The data to be output are stored in the array Data in the order that the logical bits are specified by BitNo.

When you want to output to the same bit continuously, the same bit numbers are stored in the array named BitNo and the data which are to be output continuously are stored in the array named Data sequentially.
In this case, the max of bits and the max of data are 256.
When the type of the device is isolation, before output the data, it need to wait the data are really output. Therefore, only with the output device of TTL level, this usage is valid.

Example

C

Ret = DioOutMultiBit( Id , &BitNo[0] , BitNum , &Data[0] );
 

Python

Ret = cdio.DioOutMultiBit( Id , BitNo , BitNum , Data )
 

See Also

DioOutByte
DioOutBit
DioOutMultiByte
Logic_Bit