DioGet8255Mode


Function

Retrieves 8255 mode chip by chip.

Format

Ret = DioGet8255Mode ( Id , ChipNo , CtrlWord )

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from DioInit.

ChipNo [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the chip number of LSIi8255.
Chip number begins from 0 and increases by 1 every three ports.

CtrlWord [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the control word. The setting value list of control word is shown below.

D7

D6

D5

D4

D3

D2

D1

D0

Hex

Port A

Port C

(High 4bit)

Port B

Port C

(Low 4bit)

1

0

0

0

0

0

0

0

80

OUTPUT

OUTPUT

OUTPUT

OUTPUT

1

0

0

0

0

0

0

1

81

OUTPUT

OUTPUT

OUTPUT

INPUT

1

0

0

0

0

0

1

0

82

OUTPUT

OUTPUT

INPUT

OUTPUT

1

0

0

0

0

0

1

1

83

OUTPUT

OUTPUT

INPUT

INPUT

1

0

0

0

1

0

0

0

88

OUTPUT

INPUT

OUTPUT

OUTPUT

1

0

0

0

1

0

0

1

89

OUTPUT

INPUT

OUTPUT

INPUT

1

0

0

0

1

0

1

0

8A

OUTPUT

INPUT

INPUT

OUTPUT

1

0

0

0

1

0

1

1

8B

OUTPUT

INPUT

INPUT

INPUT

1

0

0

1

0

0

0

0

90

INPUT

OUTPUT

OUTPUT

OUTPUT

1

0

0

1

0

0

0

1

91

INPUT

OUTPUT

OUTPUT

INPUT

1

0

0

1

0

0

1

0

92

INPUT

OUTPUT

INPUT

OUTPUT

1

0

0

1

0

0

1

1

93

INPUT

OUTPUT

INPUT

INPUT

1

0

0

1

1

0

0

0

98

INPUT

INPUT

OUTPUT

OUTPUT

1

0

0

1

1

0

0

1

99

INPUT

INPUT

OUTPUT

INPUT

1

0

0

1

1

0

1

0

9A

INPUT

INPUT

INPUT

OUTPUT

1

0

0

1

1

0

1

1

9B

INPUT

INPUT

INPUT

INPUT

Please refer to the supplied manual of a board for details.

Return Value

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal completed.

DIO_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute DioResetDevice function because the device has recovered from standby mode.

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Not call the driver (Failure on DEVICE I/O CONTROL).

DIO_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

DIO_ERR_SYS_NOT_SUPPORTED

20001

This board couldn't use this function.

DIO_ERR_SYS_8255

20600

8255 chip number is outside of the range.

The others (See also: Details of Error Code)

Initial Value

The default setting is that all ports are set to input at system startup. And after the control word has been set with DioSet8255Mode once, it becomes that set value.

Remarks

To use this function, please execute DioInit first, and call it after setting I/O ports (I/O channels) with DioSet8255Mode().

Example

Retrieves the setting value of LSIi8255 chip 0.

VB.NET

Dim Ret As Integer
Dim Data As Integer
Ret = DioGet8255Mode ( Id , 0 , Data )
 

C, C++

long Ret;
short Data;
Ret = DioGet8255Mode ( Id , 0 , &Data );
 

C#

int Ret;
short Data;
Ret = dio.Get8255Mode ( Id , 0 , out Data );
 

Python

Ret = ctypes.c_long()
Data = ctypes.c_short()
Ret.value = cdio.DioGet8255Mode ( Id , 0 , ctypes.byref(Data) )