DioSetDemoByte


Function

Sets 1 byte (8 bits) of data to the input port of the demo device.

Format

Ret = DioSetDemoByte ( Id , PortNo , Data )

Parameters

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

PortNo [ C: short ] [ Python: ctypes.c_short ]
Specifies the logical input port number.
The logical input port number is a number, which is assigned from the first input port of the device as 0 to the last one serially.

Data [ C: unsigned char ] [ Python: ctypes.c_ubyte ]
Specifies the input data.

Return Value

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

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal completed.

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_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.

The others (See also: Details of Error Code)

Initial Value

This is dedicated function for demo device.

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

Please call DioInpByte function when you want to confirm Digital Input Value.

 

Remarks

Sets 1 byte of data to the input port. Specifies the setting data from 0H to FFH in hex number.

Example

Sets 55H to port 0.

C

Ret = DioSetDemoByte ( Id , 0 , 0x55 );
 

Python

Ret = cdio.DioSetDemoByte ( Id , 0 , 0x55 )
 

See Also

DioSetDemoBit, DioInpByte