DioOutMultiByte


Function

Outputs multiple bytes to the output ports.

Format

Ret = DioOutMultiByte ( Id , &PortNo[0] , PortNum , &Data[0] )

Parameters

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

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

PortNum[C:short] [Python: ctypes.c_short]
Specifies the number of ports which are specified by PortNo. The maximum number of ports is 256.

Data [C:unsigned char *] [Python: ctypes.POINTER(ctypes.c_ubyte)]
Stores the output data into a array. Specifies the base address of this array.
The output data are specified from 0H to FFH in hexadecimal.

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_PORT_NO

20100

Port number is outside of the available range.

DIO_ERR_SYS_PORT_NUM

20101

Number of ports is outside of the available range.

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 bytes to the output ports. Before this function is called, it is necessary that the logical ports numbers to be output are set into the array specified by PortNo.
The data to be output are stored in the array Data in the order that the logical port are specified by PortNo.

When you want to output data to the same port continuously, the same port numbers are stored in the array PortNo and the data which are to be continuously output are stored in the array Data sequentially.
In this case, the maximum number of ports and the maximum number 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 = DioOutMultiByte ( Id , &PortNo[0] , PortNum , &Data[0] );
 

Python

Ret = cdio.DioOutMultiByte ( Id , PortNo , PortNum , Data )
 

See Also

DioOutByte
DioOutBit
DioOutMultiBit
Logic_Bit