Get8255


Function

 

Gets 8255 mode chip by chip.

 

Format

 

Ret = dncDaq01.Get8255(DeviceNo, ChipNo, CtrlWord)

 

Parameters

 

DeviceNo [ C#: short ] [ VB.NET: Short ]

Specifies the device No. managed by DncDaq.

 

ChipNo [ C#: short ] [ VB.NET: Short ]

Please specify the chip number of LSIi8255.
Chip number begins from 0 and increases by 1 every three ports.

 

CtrlWord [ C#: out short ] [ VB.NET: Short ]  

Please specify the address of the variable that stores the control word. The following is a list of control word settings.

D7

D6

D5

D4

D4

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 [ C#: int ] [ VB.NET: Integer ]

 

■Common

Value

Description

0

Normality completion

500001

The method on an unconfigured device has been called. Check the device settings.

500002

The method was called that the device does not support.

510001

The input parameter is invalid. Check the parameter contents.

 

■DIO Devices

Value

Description

10100

Invalid data buffer address.

20001

This board couldn't use this function.

20600

8255 chip number is outside of the range.

Other errors (see: Error code details)

 

Remarks

 

For devices equipped with the i8255 mode 0 equivalent function, gets 8255 mode chip by chip.
The default setting is that all ports are set to input at system startup. And after the control word has been set with Set8255 once, the set value will be returned.

 

Example

 

Retrieves the setting value of LSIi8255 chip 0.

C#

int  Ret;
byte Data;

ret = dncDaq01.Get8255(DeviceNo, 0, out Data);

 

VB.NET

Dim Ret As Integer
Dim Data As Byte

Ret = dncDaq01.Get8255(DeviceNo, 0, Data)