Setting Channel
① Digital I/O (DIO) [dio_init.vi]

 

Select when digital input/output by digital device

 


Layout of IN/OUT terminal

 


IN terminal

DeviceName

Initial value: "DIO000"

[Essential]
Specify the device name (Devicename) to use

Devicename is set and confirmed by device manager

 

DeviceType

Initial value: 0(General type)

Select the type of digital device

Type

Value

General type

0

Double direction type

1

Double direction type(8255)

2

Double direction type(32DM)

3

*When you don't know the type of device, you can refer to [Device-specific Setting List]

 

DioDirection

Initial value: 0

In the case of [Double direction] and [Double direction (32DM)], specify the direction for input/output

 - [Double direction]

Port0

Port1

Port2

Num.

IN

IN

IN

0

OUT

IN

IN

1

IN

OUT

IN

2

OUT

OUT

IN

3

IN

IN

OUT

4

OUT

IN

OUT

5

IN

OUT

OUT

6

OUT

OUT

OUT

7

  - [Double direction (32DM)]

Setting

Num.

32bit input

1 or 0

32bit output

2 or 15

16bit input(Bit0-15), 16bit output(Bit16-31)

3 or 12

  - [Double direction (32DM)] Num.(setting value) [15] and [12] is common to each type,
   and the setting value can be specified for each port (8 bits) using the concept shown in the table below.

Port3

Port2

Port1

Port0

Num.(Hex)

IN

IN

IN

IN

0

IN

IN

IN

OUT

1

IN

IN

OUT

IN

2

IN

IN

OUT

OUT

3

IN

OUT

IN

IN

4

IN

OUT

IN

OUT

5

IN

OUT

OUT

IN

6

IN

OUT

OUT

OUT

7

OUT

IN

IN

IN

8

OUT

IN

IN

OUT

9

OUT

IN

OUT

IN

10(A)

OUT

IN

OUT

OUT

11(B)

OUT

OUT

IN

IN

12(C)

OUT

OUT

IN

OUT

13(D)

OUT

OUT

OUT

IN

14(E)

OUT

OUT

OUT

OUT

15(F)

 

Dio8255

Initial value:  0:80H

In the case of [Double direction (8255)], Specify the direction for input/output with chip number and setting value (control word) as an array with 2-elements

[Element 1]: Chip No (ChipNo)

Each LSI8255 chip corresponds to 24-bit input/output. The relationship between the number of input/output bits and the number of chips for digital device is as follows

The number of I/O bits

The number of chips  (chip number)

24-bits I/O

The number of chips is 1 (ChipNo 0)

48-bits I/O

The number of chips is 2 (ChipNo 0, 1)

72-bits I/O

The number of chips is 3 (ChipNo 0, 1, 2)

96-bits I/O

The number of chips is 4 (ChipNo 0, 1, 2, 3)

[Element 2]: Ctrol word (CtrlWord)

The setting value is specified in Hexadecimal (80 to 9B) defined in the following table

Port A

Port C

(High 4bit)

Port B

Port C

(Low 4bit)

Control Word

D7

D6

D5

D4

D3

D2

D1

D0

Hex

OUT

OUT

OUT

OUT

1

0

0

0

0

0

0

0

80

OUT

OUT

OUT

IN

1

0

0

0

0

0

0

1

81

OUT

OUT

IN

OUT

1

0

0

0

0

0

1

0

82

OUT

OUT

IN

IN

1

0

0

0

0

0

1

1

83

OUT

IN

OUT

OUT

1

0

0

0

1

0

0

0

88

OUT

IN

OUT

IN

1

0

0

0

1

0

0

1

89

OUT

IN

IN

OUT

1

0

0

0

1

0

1

0

8A

OUT

IN

IN

IN

1

0

0

0

1

0

1

1

8B

IN

OUT

OUT

OUT

1

0

0

1

0

0

0

0

90

IN

OUT

OUT

IN

1

0

0

1

0

0

0

1

91

IN

OUT

IN

OUT

1

0

0

1

0

0

1

0

92

IN

OUT

IN

IN

1

0

0

1

0

0

1

1

93

IN

IN

OUT

OUT

1

0

0

1

1

0

0

0

98

IN

IN

OUT

IN

1

0

0

1

1

0

0

1

99

IN

IN

IN

OUT

1

0

0

1

1

0

1

0

9A

IN

IN

IN

IN

1

0

0

1

1

0

1

1

9B

*About the assignment of each port and IN/OUT terminals, please refer to the manual of the using board

  e.g.) Chip 0 and chip 1 are set to 80, 9B

    [Element 1]: 0, 1  (ChipNo)
    [Element 2]: 80, 9B  (CtrlWord)

 

Operate with initial value

There is an initial value for each input terminal setting.

For example, since the initial value of [DeviceType] for selecting the type of digital device is [0 (General)], when using a digital device other than bidirectional type, there is no need to set [DeviceType] in particular.

 

 

How to count port numbers

For [General type] devices that are not double direction type, both the input port and output port numbers start at 0, so [Input port number 0] and [Output port number 0] exist.

For double direction type devices, the port number does not change irrespective of the input/output setting state.

For example, if the device is double direction type with 24 bits, 1 port has 8 bits, so there are 3 ports, the port number are 0,1,2. If the 3 ports are set as [Input, Output, Input], the port number for output is 1. Please notice that it's not 0.

Please notice that it's not 0.