Option Strict Off
Option Explicit On 
Public Class MultiIO
	Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

	Public Sub New()
		MyBase.New()

		'This call is required by the Windows Form Designer.
		InitializeComponent()

		'Add any initialization after the InitializeComponent() call

	End Sub

	'Form overrides dispose to clean up the component list.
	Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
		If disposing Then
			If Not (components Is Nothing) Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(disposing)
	End Sub

	'Required by the Windows Form Designer
	Private components As System.ComponentModel.IContainer

	'NOTE: The following procedure is required by the Windows Form Designer
	'It can be modified using the Windows Form Designer.  
	'Do not modify it using the code editor.
	Friend WithEvents Label38 As System.Windows.Forms.Label
	Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
	Friend WithEvents Label29 As System.Windows.Forms.Label
	Friend WithEvents Label30 As System.Windows.Forms.Label
	Friend WithEvents Label31 As System.Windows.Forms.Label
	Friend WithEvents Label32 As System.Windows.Forms.Label
	Friend WithEvents Label33 As System.Windows.Forms.Label
	Friend WithEvents Label34 As System.Windows.Forms.Label
	Friend WithEvents Label35 As System.Windows.Forms.Label
	Friend WithEvents Label36 As System.Windows.Forms.Label
	Friend WithEvents Label37 As System.Windows.Forms.Label
	Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
	Friend WithEvents Label20 As System.Windows.Forms.Label
	Friend WithEvents Label21 As System.Windows.Forms.Label
	Friend WithEvents Label22 As System.Windows.Forms.Label
	Friend WithEvents Label23 As System.Windows.Forms.Label
	Friend WithEvents Label24 As System.Windows.Forms.Label
	Friend WithEvents Label25 As System.Windows.Forms.Label
	Friend WithEvents Label26 As System.Windows.Forms.Label
	Friend WithEvents Label27 As System.Windows.Forms.Label
	Friend WithEvents Label28 As System.Windows.Forms.Label
	Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
	Friend WithEvents Label11 As System.Windows.Forms.Label
	Friend WithEvents Label12 As System.Windows.Forms.Label
	Friend WithEvents Label13 As System.Windows.Forms.Label
	Friend WithEvents Label14 As System.Windows.Forms.Label
	Friend WithEvents Label15 As System.Windows.Forms.Label
	Friend WithEvents Label16 As System.Windows.Forms.Label
	Friend WithEvents Label17 As System.Windows.Forms.Label
	Friend WithEvents Label18 As System.Windows.Forms.Label
	Friend WithEvents Label19 As System.Windows.Forms.Label
	Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
	Friend WithEvents Label10 As System.Windows.Forms.Label
	Friend WithEvents Label9 As System.Windows.Forms.Label
	Friend WithEvents Label8 As System.Windows.Forms.Label
	Friend WithEvents Label7 As System.Windows.Forms.Label
	Friend WithEvents Label6 As System.Windows.Forms.Label
	Friend WithEvents Label5 As System.Windows.Forms.Label
	Friend WithEvents Label4 As System.Windows.Forms.Label
	Friend WithEvents Label3 As System.Windows.Forms.Label
	Friend WithEvents Label2 As System.Windows.Forms.Label
	Friend WithEvents Label1 As System.Windows.Forms.Label
	Friend WithEvents txtReturnCode As System.Windows.Forms.TextBox
	Friend WithEvents btnExit As System.Windows.Forms.Button
	Friend WithEvents btnDioExit As System.Windows.Forms.Button
	Friend WithEvents btnOutMultiBit As System.Windows.Forms.Button
	Friend WithEvents txtOutBitData7 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitData6 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitData5 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitData4 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitData3 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitData2 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitData1 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitData0 As System.Windows.Forms.TextBox
	Friend WithEvents btnOutMultiByte As System.Windows.Forms.Button
	Friend WithEvents txtOutPortData7 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortData6 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortData5 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortData4 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortData3 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortData2 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortData1 As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortData0 As System.Windows.Forms.TextBox
	Friend WithEvents btnInpMultiBit As System.Windows.Forms.Button
	Friend WithEvents txtInpBitData7 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitData6 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitData5 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitData4 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitData3 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitData2 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitData1 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitData0 As System.Windows.Forms.TextBox
	Friend WithEvents btnInpMultiByte As System.Windows.Forms.Button
	Friend WithEvents txtInpPortData7 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortData6 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortData5 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortData4 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortData3 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortData2 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortData1 As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortData0 As System.Windows.Forms.TextBox
	Friend WithEvents btnDioInit As System.Windows.Forms.Button
	Friend WithEvents cboDeviceName As System.Windows.Forms.ComboBox
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Me.txtReturnCode = New System.Windows.Forms.TextBox()
		Me.Label38 = New System.Windows.Forms.Label()
		Me.btnExit = New System.Windows.Forms.Button()
		Me.btnDioExit = New System.Windows.Forms.Button()
		Me.GroupBox4 = New System.Windows.Forms.GroupBox()
		Me.btnOutMultiBit = New System.Windows.Forms.Button()
		Me.Label29 = New System.Windows.Forms.Label()
		Me.Label30 = New System.Windows.Forms.Label()
		Me.Label31 = New System.Windows.Forms.Label()
		Me.Label32 = New System.Windows.Forms.Label()
		Me.Label33 = New System.Windows.Forms.Label()
		Me.Label34 = New System.Windows.Forms.Label()
		Me.Label35 = New System.Windows.Forms.Label()
		Me.Label36 = New System.Windows.Forms.Label()
		Me.Label37 = New System.Windows.Forms.Label()
		Me.txtOutBitData7 = New System.Windows.Forms.TextBox()
		Me.txtOutBitData6 = New System.Windows.Forms.TextBox()
		Me.txtOutBitData5 = New System.Windows.Forms.TextBox()
		Me.txtOutBitData4 = New System.Windows.Forms.TextBox()
		Me.txtOutBitData3 = New System.Windows.Forms.TextBox()
		Me.txtOutBitData2 = New System.Windows.Forms.TextBox()
		Me.txtOutBitData1 = New System.Windows.Forms.TextBox()
		Me.txtOutBitData0 = New System.Windows.Forms.TextBox()
		Me.GroupBox3 = New System.Windows.Forms.GroupBox()
		Me.btnOutMultiByte = New System.Windows.Forms.Button()
		Me.Label20 = New System.Windows.Forms.Label()
		Me.Label21 = New System.Windows.Forms.Label()
		Me.Label22 = New System.Windows.Forms.Label()
		Me.Label23 = New System.Windows.Forms.Label()
		Me.Label24 = New System.Windows.Forms.Label()
		Me.Label25 = New System.Windows.Forms.Label()
		Me.Label26 = New System.Windows.Forms.Label()
		Me.Label27 = New System.Windows.Forms.Label()
		Me.Label28 = New System.Windows.Forms.Label()
		Me.txtOutPortData7 = New System.Windows.Forms.TextBox()
		Me.txtOutPortData6 = New System.Windows.Forms.TextBox()
		Me.txtOutPortData5 = New System.Windows.Forms.TextBox()
		Me.txtOutPortData4 = New System.Windows.Forms.TextBox()
		Me.txtOutPortData3 = New System.Windows.Forms.TextBox()
		Me.txtOutPortData2 = New System.Windows.Forms.TextBox()
		Me.txtOutPortData1 = New System.Windows.Forms.TextBox()
		Me.txtOutPortData0 = New System.Windows.Forms.TextBox()
		Me.GroupBox2 = New System.Windows.Forms.GroupBox()
		Me.btnInpMultiBit = New System.Windows.Forms.Button()
		Me.Label11 = New System.Windows.Forms.Label()
		Me.Label12 = New System.Windows.Forms.Label()
		Me.Label13 = New System.Windows.Forms.Label()
		Me.Label14 = New System.Windows.Forms.Label()
		Me.Label15 = New System.Windows.Forms.Label()
		Me.Label16 = New System.Windows.Forms.Label()
		Me.Label17 = New System.Windows.Forms.Label()
		Me.Label18 = New System.Windows.Forms.Label()
		Me.Label19 = New System.Windows.Forms.Label()
		Me.txtInpBitData7 = New System.Windows.Forms.TextBox()
		Me.txtInpBitData6 = New System.Windows.Forms.TextBox()
		Me.txtInpBitData5 = New System.Windows.Forms.TextBox()
		Me.txtInpBitData4 = New System.Windows.Forms.TextBox()
		Me.txtInpBitData3 = New System.Windows.Forms.TextBox()
		Me.txtInpBitData2 = New System.Windows.Forms.TextBox()
		Me.txtInpBitData1 = New System.Windows.Forms.TextBox()
		Me.txtInpBitData0 = New System.Windows.Forms.TextBox()
		Me.GroupBox1 = New System.Windows.Forms.GroupBox()
		Me.btnInpMultiByte = New System.Windows.Forms.Button()
		Me.Label10 = New System.Windows.Forms.Label()
		Me.Label9 = New System.Windows.Forms.Label()
		Me.Label8 = New System.Windows.Forms.Label()
		Me.Label7 = New System.Windows.Forms.Label()
		Me.Label6 = New System.Windows.Forms.Label()
		Me.Label5 = New System.Windows.Forms.Label()
		Me.Label4 = New System.Windows.Forms.Label()
		Me.Label3 = New System.Windows.Forms.Label()
		Me.Label2 = New System.Windows.Forms.Label()
		Me.txtInpPortData7 = New System.Windows.Forms.TextBox()
		Me.txtInpPortData6 = New System.Windows.Forms.TextBox()
		Me.txtInpPortData5 = New System.Windows.Forms.TextBox()
		Me.txtInpPortData4 = New System.Windows.Forms.TextBox()
		Me.txtInpPortData3 = New System.Windows.Forms.TextBox()
		Me.txtInpPortData2 = New System.Windows.Forms.TextBox()
		Me.txtInpPortData1 = New System.Windows.Forms.TextBox()
		Me.txtInpPortData0 = New System.Windows.Forms.TextBox()
		Me.btnDioInit = New System.Windows.Forms.Button()
		Me.cboDeviceName = New System.Windows.Forms.ComboBox()
		Me.Label1 = New System.Windows.Forms.Label()
		Me.GroupBox4.SuspendLayout()
		Me.GroupBox3.SuspendLayout()
		Me.GroupBox2.SuspendLayout()
		Me.GroupBox1.SuspendLayout()
		Me.SuspendLayout()
		'
		'txtReturnCode
		'
		Me.txtReturnCode.Location = New System.Drawing.Point(87, 396)
		Me.txtReturnCode.Name = "txtReturnCode"
		Me.txtReturnCode.Size = New System.Drawing.Size(272, 20)
		Me.txtReturnCode.TabIndex = 39
		Me.txtReturnCode.Text = "TextBox33"
		'
		'Label38
		'
		Me.Label38.Location = New System.Drawing.Point(7, 400)
		Me.Label38.Name = "Label38"
		Me.Label38.Size = New System.Drawing.Size(81, 18)
		Me.Label38.TabIndex = 38
		Me.Label38.Text = "Return Value :"
		'
		'btnExit
		'
		Me.btnExit.Location = New System.Drawing.Point(376, 430)
		Me.btnExit.Name = "btnExit"
		Me.btnExit.Size = New System.Drawing.Size(105, 25)
		Me.btnExit.TabIndex = 37
		Me.btnExit.Text = "Exit"
		'
		'btnDioExit
		'
		Me.btnDioExit.Location = New System.Drawing.Point(376, 393)
		Me.btnDioExit.Name = "btnDioExit"
		Me.btnDioExit.Size = New System.Drawing.Size(105, 25)
		Me.btnDioExit.TabIndex = 36
		Me.btnDioExit.Text = "DioExit"
		'
		'GroupBox4
		'
		Me.GroupBox4.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnOutMultiBit, Me.Label29, Me.Label30, Me.Label31, Me.Label32, Me.Label33, Me.Label34, Me.Label35, Me.Label36, Me.Label37, Me.txtOutBitData7, Me.txtOutBitData6, Me.txtOutBitData5, Me.txtOutBitData4, Me.txtOutBitData3, Me.txtOutBitData2, Me.txtOutBitData1, Me.txtOutBitData0})
		Me.GroupBox4.Location = New System.Drawing.Point(7, 309)
		Me.GroupBox4.Name = "GroupBox4"
		Me.GroupBox4.Size = New System.Drawing.Size(496, 75)
		Me.GroupBox4.TabIndex = 35
		Me.GroupBox4.TabStop = False
		Me.GroupBox4.Text = "MultiBit Output"
		'
		'btnOutMultiBit
		'
		Me.btnOutMultiBit.Location = New System.Drawing.Point(369, 31)
		Me.btnOutMultiBit.Name = "btnOutMultiBit"
		Me.btnOutMultiBit.Size = New System.Drawing.Size(105, 25)
		Me.btnOutMultiBit.TabIndex = 20
		Me.btnOutMultiBit.Text = "DioOutMultiBit"
		'
		'Label29
		'
		Me.Label29.Location = New System.Drawing.Point(9, 41)
		Me.Label29.Name = "Label29"
		Me.Label29.Size = New System.Drawing.Size(71, 18)
		Me.Label29.TabIndex = 19
		Me.Label29.Text = "Bit Data :"
		'
		'Label30
		'
		Me.Label30.Location = New System.Drawing.Point(332, 16)
		Me.Label30.Name = "Label30"
		Me.Label30.Size = New System.Drawing.Size(8, 14)
		Me.Label30.TabIndex = 15
		Me.Label30.Text = "7"
		'
		'Label31
		'
		Me.Label31.Location = New System.Drawing.Point(300, 16)
		Me.Label31.Name = "Label31"
		Me.Label31.Size = New System.Drawing.Size(8, 14)
		Me.Label31.TabIndex = 14
		Me.Label31.Text = "6"
		'
		'Label32
		'
		Me.Label32.Location = New System.Drawing.Point(268, 16)
		Me.Label32.Name = "Label32"
		Me.Label32.Size = New System.Drawing.Size(8, 14)
		Me.Label32.TabIndex = 13
		Me.Label32.Text = "5"
		'
		'Label33
		'
		Me.Label33.Location = New System.Drawing.Point(236, 16)
		Me.Label33.Name = "Label33"
		Me.Label33.Size = New System.Drawing.Size(8, 14)
		Me.Label33.TabIndex = 12
		Me.Label33.Text = "4"
		'
		'Label34
		'
		Me.Label34.Location = New System.Drawing.Point(205, 16)
		Me.Label34.Name = "Label34"
		Me.Label34.Size = New System.Drawing.Size(8, 14)
		Me.Label34.TabIndex = 11
		Me.Label34.Text = "3"
		'
		'Label35
		'
		Me.Label35.Location = New System.Drawing.Point(172, 16)
		Me.Label35.Name = "Label35"
		Me.Label35.Size = New System.Drawing.Size(8, 14)
		Me.Label35.TabIndex = 10
		Me.Label35.Text = "2"
		'
		'Label36
		'
		Me.Label36.Location = New System.Drawing.Point(140, 16)
		Me.Label36.Name = "Label36"
		Me.Label36.Size = New System.Drawing.Size(8, 14)
		Me.Label36.TabIndex = 9
		Me.Label36.Text = "1"
		'
		'Label37
		'
		Me.Label37.Location = New System.Drawing.Point(109, 16)
		Me.Label37.Name = "Label37"
		Me.Label37.Size = New System.Drawing.Size(8, 14)
		Me.Label37.TabIndex = 8
		Me.Label37.Text = "0"
		'
		'txtOutBitData7
		'
		Me.txtOutBitData7.Location = New System.Drawing.Point(323, 37)
		Me.txtOutBitData7.Name = "txtOutBitData7"
		Me.txtOutBitData7.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData7.TabIndex = 7
		Me.txtOutBitData7.Text = "TextBox8"
		'
		'txtOutBitData6
		'
		Me.txtOutBitData6.Location = New System.Drawing.Point(291, 37)
		Me.txtOutBitData6.Name = "txtOutBitData6"
		Me.txtOutBitData6.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData6.TabIndex = 6
		Me.txtOutBitData6.Text = "TextBox7"
		'
		'txtOutBitData5
		'
		Me.txtOutBitData5.Location = New System.Drawing.Point(259, 37)
		Me.txtOutBitData5.Name = "txtOutBitData5"
		Me.txtOutBitData5.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData5.TabIndex = 5
		Me.txtOutBitData5.Text = "TextBox6"
		'
		'txtOutBitData4
		'
		Me.txtOutBitData4.Location = New System.Drawing.Point(227, 37)
		Me.txtOutBitData4.Name = "txtOutBitData4"
		Me.txtOutBitData4.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData4.TabIndex = 4
		Me.txtOutBitData4.Text = "TextBox5"
		'
		'txtOutBitData3
		'
		Me.txtOutBitData3.Location = New System.Drawing.Point(195, 37)
		Me.txtOutBitData3.Name = "txtOutBitData3"
		Me.txtOutBitData3.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData3.TabIndex = 3
		Me.txtOutBitData3.Text = "TextBox4"
		'
		'txtOutBitData2
		'
		Me.txtOutBitData2.Location = New System.Drawing.Point(163, 37)
		Me.txtOutBitData2.Name = "txtOutBitData2"
		Me.txtOutBitData2.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData2.TabIndex = 2
		Me.txtOutBitData2.Text = "TextBox3"
		'
		'txtOutBitData1
		'
		Me.txtOutBitData1.Location = New System.Drawing.Point(131, 37)
		Me.txtOutBitData1.Name = "txtOutBitData1"
		Me.txtOutBitData1.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData1.TabIndex = 1
		Me.txtOutBitData1.Text = "TextBox2"
		'
		'txtOutBitData0
		'
		Me.txtOutBitData0.Location = New System.Drawing.Point(99, 37)
		Me.txtOutBitData0.Name = "txtOutBitData0"
		Me.txtOutBitData0.Size = New System.Drawing.Size(29, 20)
		Me.txtOutBitData0.TabIndex = 0
		Me.txtOutBitData0.Text = "TextBox1"
		'
		'GroupBox3
		'
		Me.GroupBox3.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnOutMultiByte, Me.Label20, Me.Label21, Me.Label22, Me.Label23, Me.Label24, Me.Label25, Me.Label26, Me.Label27, Me.Label28, Me.txtOutPortData7, Me.txtOutPortData6, Me.txtOutPortData5, Me.txtOutPortData4, Me.txtOutPortData3, Me.txtOutPortData2, Me.txtOutPortData1, Me.txtOutPortData0})
		Me.GroupBox3.Location = New System.Drawing.Point(7, 225)
		Me.GroupBox3.Name = "GroupBox3"
		Me.GroupBox3.Size = New System.Drawing.Size(496, 75)
		Me.GroupBox3.TabIndex = 34
		Me.GroupBox3.TabStop = False
		Me.GroupBox3.Text = "MultiPort Output"
		'
		'btnOutMultiByte
		'
		Me.btnOutMultiByte.Location = New System.Drawing.Point(369, 31)
		Me.btnOutMultiByte.Name = "btnOutMultiByte"
		Me.btnOutMultiByte.Size = New System.Drawing.Size(105, 25)
		Me.btnOutMultiByte.TabIndex = 20
		Me.btnOutMultiByte.Text = "DioOutMultiByte"
		'
		'Label20
		'
		Me.Label20.Location = New System.Drawing.Point(9, 41)
		Me.Label20.Name = "Label20"
		Me.Label20.Size = New System.Drawing.Size(72, 18)
		Me.Label20.TabIndex = 19
		Me.Label20.Text = "Port Data :"
		'
		'Label21
		'
		Me.Label21.Location = New System.Drawing.Point(332, 16)
		Me.Label21.Name = "Label21"
		Me.Label21.Size = New System.Drawing.Size(8, 14)
		Me.Label21.TabIndex = 15
		Me.Label21.Text = "7"
		'
		'Label22
		'
		Me.Label22.Location = New System.Drawing.Point(300, 16)
		Me.Label22.Name = "Label22"
		Me.Label22.Size = New System.Drawing.Size(8, 14)
		Me.Label22.TabIndex = 14
		Me.Label22.Text = "6"
		'
		'Label23
		'
		Me.Label23.Location = New System.Drawing.Point(268, 16)
		Me.Label23.Name = "Label23"
		Me.Label23.Size = New System.Drawing.Size(8, 14)
		Me.Label23.TabIndex = 13
		Me.Label23.Text = "5"
		'
		'Label24
		'
		Me.Label24.Location = New System.Drawing.Point(236, 16)
		Me.Label24.Name = "Label24"
		Me.Label24.Size = New System.Drawing.Size(8, 14)
		Me.Label24.TabIndex = 12
		Me.Label24.Text = "4"
		'
		'Label25
		'
		Me.Label25.Location = New System.Drawing.Point(205, 16)
		Me.Label25.Name = "Label25"
		Me.Label25.Size = New System.Drawing.Size(8, 14)
		Me.Label25.TabIndex = 11
		Me.Label25.Text = "3"
		'
		'Label26
		'
		Me.Label26.Location = New System.Drawing.Point(172, 16)
		Me.Label26.Name = "Label26"
		Me.Label26.Size = New System.Drawing.Size(8, 14)
		Me.Label26.TabIndex = 10
		Me.Label26.Text = "2"
		'
		'Label27
		'
		Me.Label27.Location = New System.Drawing.Point(140, 16)
		Me.Label27.Name = "Label27"
		Me.Label27.Size = New System.Drawing.Size(8, 14)
		Me.Label27.TabIndex = 9
		Me.Label27.Text = "1"
		'
		'Label28
		'
		Me.Label28.Location = New System.Drawing.Point(109, 16)
		Me.Label28.Name = "Label28"
		Me.Label28.Size = New System.Drawing.Size(8, 14)
		Me.Label28.TabIndex = 8
		Me.Label28.Text = "0"
		'
		'txtOutPortData7
		'
		Me.txtOutPortData7.Location = New System.Drawing.Point(323, 37)
		Me.txtOutPortData7.Name = "txtOutPortData7"
		Me.txtOutPortData7.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData7.TabIndex = 7
		Me.txtOutPortData7.Text = "TextBox8"
		'
		'txtOutPortData6
		'
		Me.txtOutPortData6.Location = New System.Drawing.Point(291, 37)
		Me.txtOutPortData6.Name = "txtOutPortData6"
		Me.txtOutPortData6.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData6.TabIndex = 6
		Me.txtOutPortData6.Text = "TextBox7"
		'
		'txtOutPortData5
		'
		Me.txtOutPortData5.Location = New System.Drawing.Point(259, 37)
		Me.txtOutPortData5.Name = "txtOutPortData5"
		Me.txtOutPortData5.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData5.TabIndex = 5
		Me.txtOutPortData5.Text = "TextBox6"
		'
		'txtOutPortData4
		'
		Me.txtOutPortData4.Location = New System.Drawing.Point(227, 37)
		Me.txtOutPortData4.Name = "txtOutPortData4"
		Me.txtOutPortData4.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData4.TabIndex = 4
		Me.txtOutPortData4.Text = "TextBox5"
		'
		'txtOutPortData3
		'
		Me.txtOutPortData3.Location = New System.Drawing.Point(195, 37)
		Me.txtOutPortData3.Name = "txtOutPortData3"
		Me.txtOutPortData3.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData3.TabIndex = 3
		Me.txtOutPortData3.Text = "TextBox4"
		'
		'txtOutPortData2
		'
		Me.txtOutPortData2.Location = New System.Drawing.Point(163, 37)
		Me.txtOutPortData2.Name = "txtOutPortData2"
		Me.txtOutPortData2.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData2.TabIndex = 2
		Me.txtOutPortData2.Text = "TextBox3"
		'
		'txtOutPortData1
		'
		Me.txtOutPortData1.Location = New System.Drawing.Point(131, 37)
		Me.txtOutPortData1.Name = "txtOutPortData1"
		Me.txtOutPortData1.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData1.TabIndex = 1
		Me.txtOutPortData1.Text = "TextBox2"
		'
		'txtOutPortData0
		'
		Me.txtOutPortData0.Location = New System.Drawing.Point(99, 37)
		Me.txtOutPortData0.Name = "txtOutPortData0"
		Me.txtOutPortData0.Size = New System.Drawing.Size(29, 20)
		Me.txtOutPortData0.TabIndex = 0
		Me.txtOutPortData0.Text = "TextBox1"
		'
		'GroupBox2
		'
		Me.GroupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnInpMultiBit, Me.Label11, Me.Label12, Me.Label13, Me.Label14, Me.Label15, Me.Label16, Me.Label17, Me.Label18, Me.Label19, Me.txtInpBitData7, Me.txtInpBitData6, Me.txtInpBitData5, Me.txtInpBitData4, Me.txtInpBitData3, Me.txtInpBitData2, Me.txtInpBitData1, Me.txtInpBitData0})
		Me.GroupBox2.Location = New System.Drawing.Point(7, 142)
		Me.GroupBox2.Name = "GroupBox2"
		Me.GroupBox2.Size = New System.Drawing.Size(496, 74)
		Me.GroupBox2.TabIndex = 33
		Me.GroupBox2.TabStop = False
		Me.GroupBox2.Text = "MultiBit Input"
		'
		'btnInpMultiBit
		'
		Me.btnInpMultiBit.Location = New System.Drawing.Point(369, 31)
		Me.btnInpMultiBit.Name = "btnInpMultiBit"
		Me.btnInpMultiBit.Size = New System.Drawing.Size(105, 25)
		Me.btnInpMultiBit.TabIndex = 20
		Me.btnInpMultiBit.Text = "DioInpMultiBit"
		'
		'Label11
		'
		Me.Label11.Location = New System.Drawing.Point(9, 41)
		Me.Label11.Name = "Label11"
		Me.Label11.Size = New System.Drawing.Size(72, 18)
		Me.Label11.TabIndex = 19
		Me.Label11.Text = "Bit Data :"
		'
		'Label12
		'
		Me.Label12.Location = New System.Drawing.Point(332, 16)
		Me.Label12.Name = "Label12"
		Me.Label12.Size = New System.Drawing.Size(8, 14)
		Me.Label12.TabIndex = 15
		Me.Label12.Text = "7"
		'
		'Label13
		'
		Me.Label13.Location = New System.Drawing.Point(300, 16)
		Me.Label13.Name = "Label13"
		Me.Label13.Size = New System.Drawing.Size(8, 14)
		Me.Label13.TabIndex = 14
		Me.Label13.Text = "6"
		'
		'Label14
		'
		Me.Label14.Location = New System.Drawing.Point(268, 16)
		Me.Label14.Name = "Label14"
		Me.Label14.Size = New System.Drawing.Size(8, 14)
		Me.Label14.TabIndex = 13
		Me.Label14.Text = "5"
		'
		'Label15
		'
		Me.Label15.Location = New System.Drawing.Point(236, 16)
		Me.Label15.Name = "Label15"
		Me.Label15.Size = New System.Drawing.Size(8, 14)
		Me.Label15.TabIndex = 12
		Me.Label15.Text = "4"
		'
		'Label16
		'
		Me.Label16.Location = New System.Drawing.Point(205, 16)
		Me.Label16.Name = "Label16"
		Me.Label16.Size = New System.Drawing.Size(8, 14)
		Me.Label16.TabIndex = 11
		Me.Label16.Text = "3"
		'
		'Label17
		'
		Me.Label17.Location = New System.Drawing.Point(172, 16)
		Me.Label17.Name = "Label17"
		Me.Label17.Size = New System.Drawing.Size(8, 14)
		Me.Label17.TabIndex = 10
		Me.Label17.Text = "2"
		'
		'Label18
		'
		Me.Label18.Location = New System.Drawing.Point(140, 16)
		Me.Label18.Name = "Label18"
		Me.Label18.Size = New System.Drawing.Size(8, 14)
		Me.Label18.TabIndex = 9
		Me.Label18.Text = "1"
		'
		'Label19
		'
		Me.Label19.Location = New System.Drawing.Point(109, 16)
		Me.Label19.Name = "Label19"
		Me.Label19.Size = New System.Drawing.Size(8, 14)
		Me.Label19.TabIndex = 8
		Me.Label19.Text = "0"
		'
		'txtInpBitData7
		'
		Me.txtInpBitData7.Location = New System.Drawing.Point(323, 37)
		Me.txtInpBitData7.Name = "txtInpBitData7"
		Me.txtInpBitData7.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData7.TabIndex = 7
		Me.txtInpBitData7.Text = "TextBox8"
		'
		'txtInpBitData6
		'
		Me.txtInpBitData6.Location = New System.Drawing.Point(291, 37)
		Me.txtInpBitData6.Name = "txtInpBitData6"
		Me.txtInpBitData6.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData6.TabIndex = 6
		Me.txtInpBitData6.Text = "TextBox7"
		'
		'txtInpBitData5
		'
		Me.txtInpBitData5.Location = New System.Drawing.Point(259, 37)
		Me.txtInpBitData5.Name = "txtInpBitData5"
		Me.txtInpBitData5.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData5.TabIndex = 5
		Me.txtInpBitData5.Text = "TextBox6"
		'
		'txtInpBitData4
		'
		Me.txtInpBitData4.Location = New System.Drawing.Point(227, 37)
		Me.txtInpBitData4.Name = "txtInpBitData4"
		Me.txtInpBitData4.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData4.TabIndex = 4
		Me.txtInpBitData4.Text = "TextBox5"
		'
		'txtInpBitData3
		'
		Me.txtInpBitData3.Location = New System.Drawing.Point(195, 37)
		Me.txtInpBitData3.Name = "txtInpBitData3"
		Me.txtInpBitData3.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData3.TabIndex = 3
		Me.txtInpBitData3.Text = "TextBox4"
		'
		'txtInpBitData2
		'
		Me.txtInpBitData2.Location = New System.Drawing.Point(163, 37)
		Me.txtInpBitData2.Name = "txtInpBitData2"
		Me.txtInpBitData2.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData2.TabIndex = 2
		Me.txtInpBitData2.Text = "TextBox3"
		'
		'txtInpBitData1
		'
		Me.txtInpBitData1.Location = New System.Drawing.Point(131, 37)
		Me.txtInpBitData1.Name = "txtInpBitData1"
		Me.txtInpBitData1.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData1.TabIndex = 1
		Me.txtInpBitData1.Text = "TextBox2"
		'
		'txtInpBitData0
		'
		Me.txtInpBitData0.Location = New System.Drawing.Point(99, 37)
		Me.txtInpBitData0.Name = "txtInpBitData0"
		Me.txtInpBitData0.Size = New System.Drawing.Size(29, 20)
		Me.txtInpBitData0.TabIndex = 0
		Me.txtInpBitData0.Text = "TextBox1"
		'
		'GroupBox1
		'
		Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnInpMultiByte, Me.Label10, Me.Label9, Me.Label8, Me.Label7, Me.Label6, Me.Label5, Me.Label4, Me.Label3, Me.Label2, Me.txtInpPortData7, Me.txtInpPortData6, Me.txtInpPortData5, Me.txtInpPortData4, Me.txtInpPortData3, Me.txtInpPortData2, Me.txtInpPortData1, Me.txtInpPortData0})
		Me.GroupBox1.Location = New System.Drawing.Point(7, 58)
		Me.GroupBox1.Name = "GroupBox1"
		Me.GroupBox1.Size = New System.Drawing.Size(496, 74)
		Me.GroupBox1.TabIndex = 32
		Me.GroupBox1.TabStop = False
		Me.GroupBox1.Text = "MultiPort Input"
		'
		'btnInpMultiByte
		'
		Me.btnInpMultiByte.Location = New System.Drawing.Point(369, 31)
		Me.btnInpMultiByte.Name = "btnInpMultiByte"
		Me.btnInpMultiByte.Size = New System.Drawing.Size(105, 25)
		Me.btnInpMultiByte.TabIndex = 20
		Me.btnInpMultiByte.Text = "DioInpMultiByte"
		'
		'Label10
		'
		Me.Label10.Location = New System.Drawing.Point(9, 41)
		Me.Label10.Name = "Label10"
		Me.Label10.Size = New System.Drawing.Size(72, 18)
		Me.Label10.TabIndex = 19
		Me.Label10.Text = "Port Data :"
		'
		'Label9
		'
		Me.Label9.Location = New System.Drawing.Point(332, 16)
		Me.Label9.Name = "Label9"
		Me.Label9.Size = New System.Drawing.Size(8, 14)
		Me.Label9.TabIndex = 15
		Me.Label9.Text = "7"
		'
		'Label8
		'
		Me.Label8.Location = New System.Drawing.Point(300, 16)
		Me.Label8.Name = "Label8"
		Me.Label8.Size = New System.Drawing.Size(8, 14)
		Me.Label8.TabIndex = 14
		Me.Label8.Text = "6"
		'
		'Label7
		'
		Me.Label7.Location = New System.Drawing.Point(268, 16)
		Me.Label7.Name = "Label7"
		Me.Label7.Size = New System.Drawing.Size(8, 14)
		Me.Label7.TabIndex = 13
		Me.Label7.Text = "5"
		'
		'Label6
		'
		Me.Label6.Location = New System.Drawing.Point(236, 16)
		Me.Label6.Name = "Label6"
		Me.Label6.Size = New System.Drawing.Size(8, 14)
		Me.Label6.TabIndex = 12
		Me.Label6.Text = "4"
		'
		'Label5
		'
		Me.Label5.Location = New System.Drawing.Point(205, 16)
		Me.Label5.Name = "Label5"
		Me.Label5.Size = New System.Drawing.Size(8, 14)
		Me.Label5.TabIndex = 11
		Me.Label5.Text = "3"
		'
		'Label4
		'
		Me.Label4.Location = New System.Drawing.Point(172, 16)
		Me.Label4.Name = "Label4"
		Me.Label4.Size = New System.Drawing.Size(8, 14)
		Me.Label4.TabIndex = 10
		Me.Label4.Text = "2"
		'
		'Label3
		'
		Me.Label3.Location = New System.Drawing.Point(140, 16)
		Me.Label3.Name = "Label3"
		Me.Label3.Size = New System.Drawing.Size(8, 14)
		Me.Label3.TabIndex = 9
		Me.Label3.Text = "1"
		'
		'Label2
		'
		Me.Label2.Location = New System.Drawing.Point(109, 16)
		Me.Label2.Name = "Label2"
		Me.Label2.Size = New System.Drawing.Size(8, 14)
		Me.Label2.TabIndex = 8
		Me.Label2.Text = "0"
		'
		'txtInpPortData7
		'
		Me.txtInpPortData7.Location = New System.Drawing.Point(323, 37)
		Me.txtInpPortData7.Name = "txtInpPortData7"
		Me.txtInpPortData7.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData7.TabIndex = 7
		Me.txtInpPortData7.Text = "TextBox8"
		'
		'txtInpPortData6
		'
		Me.txtInpPortData6.Location = New System.Drawing.Point(291, 37)
		Me.txtInpPortData6.Name = "txtInpPortData6"
		Me.txtInpPortData6.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData6.TabIndex = 6
		Me.txtInpPortData6.Text = "TextBox7"
		'
		'txtInpPortData5
		'
		Me.txtInpPortData5.Location = New System.Drawing.Point(259, 37)
		Me.txtInpPortData5.Name = "txtInpPortData5"
		Me.txtInpPortData5.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData5.TabIndex = 5
		Me.txtInpPortData5.Text = "TextBox6"
		'
		'txtInpPortData4
		'
		Me.txtInpPortData4.Location = New System.Drawing.Point(227, 37)
		Me.txtInpPortData4.Name = "txtInpPortData4"
		Me.txtInpPortData4.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData4.TabIndex = 4
		Me.txtInpPortData4.Text = "TextBox5"
		'
		'txtInpPortData3
		'
		Me.txtInpPortData3.Location = New System.Drawing.Point(195, 37)
		Me.txtInpPortData3.Name = "txtInpPortData3"
		Me.txtInpPortData3.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData3.TabIndex = 3
		Me.txtInpPortData3.Text = "TextBox4"
		'
		'txtInpPortData2
		'
		Me.txtInpPortData2.Location = New System.Drawing.Point(163, 37)
		Me.txtInpPortData2.Name = "txtInpPortData2"
		Me.txtInpPortData2.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData2.TabIndex = 2
		Me.txtInpPortData2.Text = "TextBox3"
		'
		'txtInpPortData1
		'
		Me.txtInpPortData1.Location = New System.Drawing.Point(131, 37)
		Me.txtInpPortData1.Name = "txtInpPortData1"
		Me.txtInpPortData1.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData1.TabIndex = 1
		Me.txtInpPortData1.Text = "TextBox2"
		'
		'txtInpPortData0
		'
		Me.txtInpPortData0.Location = New System.Drawing.Point(99, 37)
		Me.txtInpPortData0.Name = "txtInpPortData0"
		Me.txtInpPortData0.Size = New System.Drawing.Size(29, 20)
		Me.txtInpPortData0.TabIndex = 0
		Me.txtInpPortData0.Text = "TextBox1"
		'
		'btnDioInit
		'
		Me.btnDioInit.Location = New System.Drawing.Point(376, 11)
		Me.btnDioInit.Name = "btnDioInit"
		Me.btnDioInit.Size = New System.Drawing.Size(105, 25)
		Me.btnDioInit.TabIndex = 31
		Me.btnDioInit.Text = "DioInit"
		'
		'cboDeviceName
		'
		Me.cboDeviceName.Location = New System.Drawing.Point(80, 12)
		Me.cboDeviceName.Name = "cboDeviceName"
		Me.cboDeviceName.Size = New System.Drawing.Size(213, 21)
		Me.cboDeviceName.TabIndex = 40
		'
		'Label1
		'
		Me.Label1.Location = New System.Drawing.Point(7, 15)
		Me.Label1.Name = "Label1"
		Me.Label1.Size = New System.Drawing.Size(81, 18)
		Me.Label1.TabIndex = 30
		Me.Label1.Text = "Device name :"
		'
		'MultiIO
		'
		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
		Me.ClientSize = New System.Drawing.Size(510, 469)
		Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtReturnCode, Me.Label38, Me.btnExit, Me.btnDioExit, Me.GroupBox4, Me.GroupBox3, Me.GroupBox2, Me.GroupBox1, Me.btnDioInit, Me.cboDeviceName, Me.Label1})
		Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
		Me.MaximizeBox = False
		Me.MinimizeBox = False
		Me.Name = "MultiIO"
		Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
		Me.Text = "Multi_port/Multi_bit I/O"
		Me.GroupBox4.ResumeLayout(False)
		Me.GroupBox3.ResumeLayout(False)
		Me.GroupBox2.ResumeLayout(False)
		Me.GroupBox1.ResumeLayout(False)
		Me.ResumeLayout(False)

	End Sub

#End Region
	Private Const DIO_MAX_ACCS_PORTS As Short = 8		' Maxinum number of access ports in this sample
	Private Const DIO_MAX_ACCS_BITS As Short = 8		' Maxinum number of access bits in this sample

	Dim Id As Short										' Device ID
	Dim Ret As Integer									' Return value
	Dim InpPortNum As Short								' Number of input ports
	Dim OutPortNum As Short								' Number of output ports
	Dim InpBitNum As Short								' Number of input bits
	Dim OutBitNum As Short								' Number of output bits
	Dim szError As New System.Text.StringBuilder(256)	' Error string
	Dim szText As New String("", 100)
	Dim txtInpPort(7) As TextBox
	Dim txtInpBit(7) As TextBox
	Dim txtOutPort(7) As TextBox
	Dim txtOutBit(7) As TextBox

	'---------------------------------------------------------
	'	Initialize dialog
	'---------------------------------------------------------
	Private Sub MultiIO_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

		'-----------------------------------
		' Detect device
		'-----------------------------------
		Dim Index As Short
		Dim GroupID, UnitID, DeviceID As Short
		Dim DeviceName As New System.Text.StringBuilder(256)
		Dim Device As New System.Text.StringBuilder(256)
		Index = 0
		Do
			Ret = DioQueryDeviceName(Index, GroupID, UnitID, DeviceID, DeviceName, Device)
			If Ret <> DIO_ERR_SUCCESS Then
				Exit Do
			End If
			cboDeviceName.Items.Add(DeviceName.ToString())
			Index += 1
		Loop
		cboDeviceName.SelectedIndex = 0
		'-----------------------------------
		' Initialize screen items
		'-----------------------------------
		' Port input
		txtInpPortData0.Text = ""
		txtInpPortData1.Text = ""
		txtInpPortData2.Text = ""
		txtInpPortData3.Text = ""
		txtInpPortData4.Text = ""
		txtInpPortData5.Text = ""
		txtInpPortData6.Text = ""
		txtInpPortData7.Text = ""
		txtInpPort(0) = txtInpPortData0
		txtInpPort(1) = txtInpPortData1
		txtInpPort(2) = txtInpPortData2
		txtInpPort(3) = txtInpPortData3
		txtInpPort(4) = txtInpPortData4
		txtInpPort(5) = txtInpPortData5
		txtInpPort(6) = txtInpPortData6
		txtInpPort(7) = txtInpPortData7
		' Bit input
		txtInpBitData0.Text = ""
		txtInpBitData1.Text = ""
		txtInpBitData2.Text = ""
		txtInpBitData3.Text = ""
		txtInpBitData4.Text = ""
		txtInpBitData5.Text = ""
		txtInpBitData6.Text = ""
		txtInpBitData7.Text = ""
		txtInpBit(0) = txtInpBitData0
		txtInpBit(1) = txtInpBitData1
		txtInpBit(2) = txtInpBitData2
		txtInpBit(3) = txtInpBitData3
		txtInpBit(4) = txtInpBitData4
		txtInpBit(5) = txtInpBitData5
		txtInpBit(6) = txtInpBitData6
		txtInpBit(7) = txtInpBitData7
		' Port output
		txtOutPortData0.Text = "11"
		txtOutPortData1.Text = "22"
		txtOutPortData2.Text = "33"
		txtOutPortData3.Text = "44"
		txtOutPortData4.Text = "55"
		txtOutPortData5.Text = "66"
		txtOutPortData6.Text = "77"
		txtOutPortData7.Text = "88"
		txtOutPort(0) = txtOutPortData0
		txtOutPort(1) = txtOutPortData1
		txtOutPort(2) = txtOutPortData2
		txtOutPort(3) = txtOutPortData3
		txtOutPort(4) = txtOutPortData4
		txtOutPort(5) = txtOutPortData5
		txtOutPort(6) = txtOutPortData6
		txtOutPort(7) = txtOutPortData7
		' Bit output
		txtOutBitData0.Text = "1"
		txtOutBitData1.Text = "0"
		txtOutBitData2.Text = "1"
		txtOutBitData3.Text = "0"
		txtOutBitData4.Text = "1"
		txtOutBitData5.Text = "0"
		txtOutBitData6.Text = "1"
		txtOutBitData7.Text = "0"
		txtOutBit(0) = txtOutBitData0
		txtOutBit(1) = txtOutBitData1
		txtOutBit(2) = txtOutBitData2
		txtOutBit(3) = txtOutBitData3
		txtOutBit(4) = txtOutBitData4
		txtOutBit(5) = txtOutBitData5
		txtOutBit(6) = txtOutBitData6
		txtOutBit(7) = txtOutBitData7
		' Return value
		txtReturnCode.Text = ""

	End Sub

	'---------------------------------------------------------
	'	Initialization
	'---------------------------------------------------------
	Private Sub btnDioInit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDioInit.Click

		Dim szDeviceName As New String("", 100)
		Dim i As Short
		'-----------------------------
		' Get device name from screen
		'-----------------------------
		szDeviceName = cboDeviceName.Text
		'-----------------------------
		' Initialize and get ID
		'-----------------------------
		Ret = DioInit(szDeviceName, Id)
		'-----------------------------
		' Process error
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioInit : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' Get maximum number of ports
		'-----------------------------
		Ret = DioGetMaxPorts(Id, InpPortNum, OutPortNum)
		If Ret <> DIO_ERR_SUCCESS Then
			DioGetErrorString(Ret, szError)
			txtReturnCode.Text = "DioGetMaxPorts : " & szError.ToString()
			Exit Sub
		End If
		' Up to 8 ports in this sample
		If InpPortNum > DIO_MAX_ACCS_PORTS Then
			InpPortNum = DIO_MAX_ACCS_PORTS
		End If
		If OutPortNum > DIO_MAX_ACCS_PORTS Then
			OutPortNum = DIO_MAX_ACCS_PORTS
		End If
		'-----------------------------
		' Get maximum number of bits
		'-----------------------------
		Ret = DioGetMaxBits(Id, InpBitNum, OutBitNum)
		If Ret <> DIO_ERR_SUCCESS Then
			DioGetErrorString(Ret, szError)
			txtReturnCode.Text = "DioGetMaxBits : " & szError.ToString()
			Exit Sub
		End If
		' Up to 8 bits in this sample
		If InpBitNum > DIO_MAX_ACCS_BITS Then
			InpBitNum = DIO_MAX_ACCS_BITS
		End If
		If OutBitNum > DIO_MAX_ACCS_BITS Then
			OutBitNum = DIO_MAX_ACCS_BITS
		End If
		'-----------------------------
		' Mask screen
		'-----------------------------
		For i = 0 To (DIO_MAX_ACCS_PORTS - 1)
			If i < InpPortNum Then
				txtInpPort(i).Enabled = True
			Else
				txtInpPort(i).Enabled = False
			End If
		Next i
		For i = 0 To (DIO_MAX_ACCS_BITS - 1)
			If i < InpBitNum Then
				txtInpBit(i).Enabled = True
			Else
				txtInpBit(i).Enabled = False
			End If
		Next i
		For i = 0 To (DIO_MAX_ACCS_PORTS - 1)
			If i < OutPortNum Then
				txtOutPort(i).Enabled = True
			Else
				txtOutPort(i).Enabled = False
			End If
		Next i
		For i = 0 To (DIO_MAX_ACCS_BITS - 1)
			If i < OutBitNum Then
				txtOutBit(i).Enabled = True
			Else
				txtOutBit(i).Enabled = False
			End If
		Next i

	End Sub

	'---------------------------------------------------------
	'	MultiPort input
	'---------------------------------------------------------
	Private Sub btnInpMultiByte_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInpMultiByte.Click

		Dim InpPortNo(DIO_MAX_ACCS_PORTS - 1) As Short
		Dim InpPortData(DIO_MAX_ACCS_PORTS - 1) As Byte
		Dim i As Short
		'-----------------------------
		' Set port No.
		'-----------------------------
		For i = 0 To (InpPortNum - 1)
			InpPortNo(i) = i
		Next i
		'-----------------------------
		' Port input
		'-----------------------------
        Ret = DioInpMultiByte(Id, InpPortNo, InpPortNum, InpPortData)
		'-----------------------------
		' Process error
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioInpMultiByte : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' Display data
		'-----------------------------
		For i = 0 To (InpPortNum - 1)
			txtInpPort(i).Text = String.Format("{0:X2}", InpPortData(i))
		Next

	End Sub

	'---------------------------------------------------------
	'	MultiBit input
	'---------------------------------------------------------
	Private Sub btnInpMultiBit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInpMultiBit.Click

		Dim InpBitNo(DIO_MAX_ACCS_BITS - 1) As Short
		Dim InpBitData(DIO_MAX_ACCS_BITS - 1) As Byte
		Dim i As Short
		'-----------------------------
		' Set bit No.
		'-----------------------------
		For i = 0 To (InpBitNum - 1)
			InpBitNo(i) = i
		Next i
		'-----------------------------
		' Bit input
		'-----------------------------
        Ret = DioInpMultiBit(Id, InpBitNo, InpBitNum, InpBitData)
		'-----------------------------
		' Process error
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioInpMultiBit : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' Display data
		'-----------------------------
		For i = 0 To (InpBitNum - 1)
			txtInpBit(i).Text = String.Format("{0:X}", InpBitData(i))
		Next i

	End Sub

	'---------------------------------------------------------
	'	MultiPort output
	'---------------------------------------------------------
	Private Sub btnOutMultiByte_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutMultiByte.Click

		Dim OutPortNo(DIO_MAX_ACCS_PORTS - 1) As Short
		Dim OutPortData(DIO_MAX_ACCS_PORTS - 1) As Byte
		Dim i As Short
		'-----------------------------
		' Set port No. and port data
		'-----------------------------
		For i = 0 To (OutPortNum - 1)
			OutPortNo(i) = i
			szText = txtOutPort(i).Text
			OutPortData(i) = Val("&H" & szText)
		Next i
		'-----------------------------
		' Port output
		'-----------------------------
        Ret = DioOutMultiByte(Id, OutPortNo, OutPortNum, OutPortData)
		'-----------------------------
		' Process error
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioOutMultiByte : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If

	End Sub

	'---------------------------------------------------------
	'	MultiBit output
	'---------------------------------------------------------
	Private Sub btnOutMultiBit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutMultiBit.Click

		Dim OutBitNo(DIO_MAX_ACCS_BITS - 1) As Short
		Dim OutBitData(DIO_MAX_ACCS_BITS - 1) As Byte
		Dim i As Short
		'-----------------------------
		' Set bit No. and bit data
		'-----------------------------
		For i = 0 To (OutBitNum - 1)
			OutBitNo(i) = i
			szText = txtOutBit(i).Text
			OutBitData(i) = Val("&H" & szText)
		Next i
		'-----------------------------
		' Bit output
		'-----------------------------
        Ret = DioOutMultiBit(Id, OutBitNo, OutBitNum, OutBitData)
		'-----------------------------
		' Process error
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioOutMultiBit : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If

	End Sub

	'---------------------------------------------------------
	'	Termination
	'---------------------------------------------------------
	Private Sub btnDioExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDioExit.Click

		'-----------------------------
		' Termination
		'-----------------------------
		Ret = DioExit(Id)
		'-----------------------------
		' Process error
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioExit : " & szError.ToString()

	End Sub

	'---------------------------------------------------------
	'	Exit dialog
	'---------------------------------------------------------
	Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click

		'-----------------------------
		' Termination
		'-----------------------------
		Ret = DioExit(Id)
		'-----------------------------
		' Exit dialog
		'-----------------------------
		End

	End Sub

	Private Sub MultiIO_Closed(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Closed

		' Termination
		Ret = DioExit(Id)

	End Sub
End Class
