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

#Region " Windows tH[ fUCiŐꂽR[h "

    Public Sub New()
        MyBase.New()

        ' ̌Ăяo Windows tH[ fUCiŕKvłB
        InitializeComponent()

        ' InitializeComponent() Ăяǒɏǉ܂B

    End Sub

    ' Form  dispose I[o[ChăR|[lgꗗ܂B
    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

    ' Windows tH[ fUCiŕKvłB
    Private components As System.ComponentModel.IContainer

    '  : ȉ̃vV[ẂAWindows tH[ fUCiŕKvłB
    ' Windows tH[ fUCigĕύXĂB  
    ' R[h GfB^͎gpȂłB
	Friend WithEvents Label1 As System.Windows.Forms.Label
	Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
	Friend WithEvents Label2 As System.Windows.Forms.Label
	Friend WithEvents Label3 As System.Windows.Forms.Label
	Friend WithEvents Label4 As System.Windows.Forms.Label
	Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
	Friend WithEvents Label6 As System.Windows.Forms.Label
	Friend WithEvents Label7 As System.Windows.Forms.Label
	Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
	Friend WithEvents Label8 As System.Windows.Forms.Label
	Friend WithEvents Label9 As System.Windows.Forms.Label
	Friend WithEvents Label10 As System.Windows.Forms.Label
	Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
	Friend WithEvents Label12 As System.Windows.Forms.Label
	Friend WithEvents Label13 As System.Windows.Forms.Label
	Friend WithEvents Label5 As System.Windows.Forms.Label
	Friend WithEvents cboDeviceName As System.Windows.Forms.ComboBox
	Friend WithEvents btnInpByte As System.Windows.Forms.Button
	Friend WithEvents txtInpPortData As System.Windows.Forms.TextBox
	Friend WithEvents txtInpPortNo As System.Windows.Forms.TextBox
	Friend WithEvents btnInpBit As System.Windows.Forms.Button
	Friend WithEvents txtInpBitData As System.Windows.Forms.TextBox
	Friend WithEvents txtInpBitNo As System.Windows.Forms.TextBox
	Friend WithEvents btnEchoBackByte As System.Windows.Forms.Button
	Friend WithEvents btnOutByte As System.Windows.Forms.Button
	Friend WithEvents txtOutPortData As System.Windows.Forms.TextBox
	Friend WithEvents txtOutPortNo As System.Windows.Forms.TextBox
	Friend WithEvents btnEchoBackBit As System.Windows.Forms.Button
	Friend WithEvents btnOutBit As System.Windows.Forms.Button
	Friend WithEvents txtOutBitData As System.Windows.Forms.TextBox
	Friend WithEvents txtOutBitNo As System.Windows.Forms.TextBox
	Friend WithEvents btnDioInit As System.Windows.Forms.Button
	Friend WithEvents btnDioExit As System.Windows.Forms.Button
	Friend WithEvents btnExit As System.Windows.Forms.Button
	Friend WithEvents txtReturnCode As System.Windows.Forms.TextBox
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Me.Label1 = New System.Windows.Forms.Label()
		Me.cboDeviceName = New System.Windows.Forms.ComboBox()
		Me.GroupBox1 = New System.Windows.Forms.GroupBox()
		Me.btnInpByte = New System.Windows.Forms.Button()
		Me.txtInpPortData = New System.Windows.Forms.TextBox()
		Me.txtInpPortNo = New System.Windows.Forms.TextBox()
		Me.Label4 = New System.Windows.Forms.Label()
		Me.Label3 = New System.Windows.Forms.Label()
		Me.Label2 = New System.Windows.Forms.Label()
		Me.GroupBox2 = New System.Windows.Forms.GroupBox()
		Me.btnInpBit = New System.Windows.Forms.Button()
		Me.txtInpBitData = New System.Windows.Forms.TextBox()
		Me.txtInpBitNo = New System.Windows.Forms.TextBox()
		Me.Label6 = New System.Windows.Forms.Label()
		Me.Label7 = New System.Windows.Forms.Label()
		Me.GroupBox3 = New System.Windows.Forms.GroupBox()
		Me.btnEchoBackByte = New System.Windows.Forms.Button()
		Me.btnOutByte = New System.Windows.Forms.Button()
		Me.txtOutPortData = New System.Windows.Forms.TextBox()
		Me.txtOutPortNo = New System.Windows.Forms.TextBox()
		Me.Label8 = New System.Windows.Forms.Label()
		Me.Label9 = New System.Windows.Forms.Label()
		Me.Label10 = New System.Windows.Forms.Label()
		Me.GroupBox4 = New System.Windows.Forms.GroupBox()
		Me.btnEchoBackBit = New System.Windows.Forms.Button()
		Me.btnOutBit = New System.Windows.Forms.Button()
		Me.txtOutBitData = New System.Windows.Forms.TextBox()
		Me.txtOutBitNo = New System.Windows.Forms.TextBox()
		Me.Label12 = New System.Windows.Forms.Label()
		Me.Label13 = New System.Windows.Forms.Label()
		Me.btnDioInit = New System.Windows.Forms.Button()
		Me.btnDioExit = New System.Windows.Forms.Button()
		Me.btnExit = New System.Windows.Forms.Button()
		Me.Label5 = New System.Windows.Forms.Label()
		Me.txtReturnCode = New System.Windows.Forms.TextBox()
		Me.GroupBox1.SuspendLayout()
		Me.GroupBox2.SuspendLayout()
		Me.GroupBox3.SuspendLayout()
		Me.GroupBox4.SuspendLayout()
		Me.SuspendLayout()
		'
		'Label1
		'
		Me.Label1.Location = New System.Drawing.Point(8, 12)
		Me.Label1.Name = "Label1"
		Me.Label1.Size = New System.Drawing.Size(72, 16)
		Me.Label1.TabIndex = 0
		Me.Label1.Text = "foCXF"
		'
		'cboDeviceName
		'
		Me.cboDeviceName.Location = New System.Drawing.Point(80, 8)
		Me.cboDeviceName.Name = "cboDeviceName"
		Me.cboDeviceName.Size = New System.Drawing.Size(213, 20)
		Me.cboDeviceName.TabIndex = 18
		'
		'GroupBox1
		'
		Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnInpByte, Me.txtInpPortData, Me.txtInpPortNo, Me.Label4, Me.Label3, Me.Label2})
		Me.GroupBox1.Location = New System.Drawing.Point(8, 40)
		Me.GroupBox1.Name = "GroupBox1"
		Me.GroupBox1.Size = New System.Drawing.Size(580, 60)
		Me.GroupBox1.TabIndex = 1
		Me.GroupBox1.TabStop = False
		Me.GroupBox1.Text = "P|[g"
		'
		'btnInpByte
		'
		Me.btnInpByte.Location = New System.Drawing.Point(352, 21)
		Me.btnInpByte.Name = "btnInpByte"
		Me.btnInpByte.Size = New System.Drawing.Size(105, 24)
		Me.btnInpByte.TabIndex = 3
		Me.btnInpByte.Text = "DioInpByte"
		'
		'txtInpPortData
		'
		Me.txtInpPortData.Location = New System.Drawing.Point(236, 24)
		Me.txtInpPortData.Name = "txtInpPortData"
		Me.txtInpPortData.Size = New System.Drawing.Size(48, 19)
		Me.txtInpPortData.TabIndex = 2
		Me.txtInpPortData.Text = "TextBox2"
		'
		'txtInpPortNo
		'
		Me.txtInpPortNo.Location = New System.Drawing.Point(100, 23)
		Me.txtInpPortNo.Name = "txtInpPortNo"
		Me.txtInpPortNo.Size = New System.Drawing.Size(48, 19)
		Me.txtInpPortNo.TabIndex = 1
		Me.txtInpPortNo.Text = "TextBox1"
		'
		'Label4
		'
		Me.Label4.Location = New System.Drawing.Point(290, 27)
		Me.Label4.Name = "Label4"
		Me.Label4.Size = New System.Drawing.Size(56, 16)
		Me.Label4.TabIndex = 3
		Me.Label4.Text = "(16i)"
		'
		'Label3
		'
		Me.Label3.Location = New System.Drawing.Point(170, 27)
		Me.Label3.Name = "Label3"
		Me.Label3.Size = New System.Drawing.Size(72, 16)
		Me.Label3.TabIndex = 2
		Me.Label3.Text = "̓f[^F"
		'
		'Label2
		'
		Me.Label2.Location = New System.Drawing.Point(10, 27)
		Me.Label2.Name = "Label2"
		Me.Label2.Size = New System.Drawing.Size(96, 16)
		Me.Label2.TabIndex = 1
		Me.Label2.Text = "_|[gԍF"
		'
		'GroupBox2
		'
		Me.GroupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnInpBit, Me.txtInpBitData, Me.txtInpBitNo, Me.Label6, Me.Label7})
		Me.GroupBox2.Location = New System.Drawing.Point(8, 112)
		Me.GroupBox2.Name = "GroupBox2"
		Me.GroupBox2.Size = New System.Drawing.Size(580, 60)
		Me.GroupBox2.TabIndex = 2
		Me.GroupBox2.TabStop = False
		Me.GroupBox2.Text = "Prbg"
		'
		'btnInpBit
		'
		Me.btnInpBit.Location = New System.Drawing.Point(352, 21)
		Me.btnInpBit.Name = "btnInpBit"
		Me.btnInpBit.Size = New System.Drawing.Size(105, 24)
		Me.btnInpBit.TabIndex = 6
		Me.btnInpBit.Text = "DioInpBit"
		'
		'txtInpBitData
		'
		Me.txtInpBitData.Location = New System.Drawing.Point(236, 24)
		Me.txtInpBitData.Name = "txtInpBitData"
		Me.txtInpBitData.Size = New System.Drawing.Size(48, 19)
		Me.txtInpBitData.TabIndex = 5
		Me.txtInpBitData.Text = "TextBox2"
		'
		'txtInpBitNo
		'
		Me.txtInpBitNo.Location = New System.Drawing.Point(100, 23)
		Me.txtInpBitNo.Name = "txtInpBitNo"
		Me.txtInpBitNo.Size = New System.Drawing.Size(48, 19)
		Me.txtInpBitNo.TabIndex = 4
		Me.txtInpBitNo.Text = "TextBox1"
		'
		'Label6
		'
		Me.Label6.Location = New System.Drawing.Point(170, 27)
		Me.Label6.Name = "Label6"
		Me.Label6.Size = New System.Drawing.Size(72, 16)
		Me.Label6.TabIndex = 2
		Me.Label6.Text = "̓f[^F"
		'
		'Label7
		'
		Me.Label7.Location = New System.Drawing.Point(10, 27)
		Me.Label7.Name = "Label7"
		Me.Label7.Size = New System.Drawing.Size(96, 16)
		Me.Label7.TabIndex = 1
		Me.Label7.Text = "_rbgԍF"
		'
		'GroupBox3
		'
		Me.GroupBox3.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnEchoBackByte, Me.btnOutByte, Me.txtOutPortData, Me.txtOutPortNo, Me.Label8, Me.Label9, Me.Label10})
		Me.GroupBox3.Location = New System.Drawing.Point(8, 184)
		Me.GroupBox3.Name = "GroupBox3"
		Me.GroupBox3.Size = New System.Drawing.Size(580, 60)
		Me.GroupBox3.TabIndex = 3
		Me.GroupBox3.TabStop = False
		Me.GroupBox3.Text = "P|[go"
		'
		'btnEchoBackByte
		'
		Me.btnEchoBackByte.Location = New System.Drawing.Point(464, 21)
		Me.btnEchoBackByte.Name = "btnEchoBackByte"
		Me.btnEchoBackByte.Size = New System.Drawing.Size(105, 24)
		Me.btnEchoBackByte.TabIndex = 10
		Me.btnEchoBackByte.Text = "DioEchoBackByte"
		'
		'btnOutByte
		'
		Me.btnOutByte.Location = New System.Drawing.Point(352, 21)
		Me.btnOutByte.Name = "btnOutByte"
		Me.btnOutByte.Size = New System.Drawing.Size(105, 24)
		Me.btnOutByte.TabIndex = 9
		Me.btnOutByte.Text = "DioOutByte"
		'
		'txtOutPortData
		'
		Me.txtOutPortData.Location = New System.Drawing.Point(236, 24)
		Me.txtOutPortData.Name = "txtOutPortData"
		Me.txtOutPortData.Size = New System.Drawing.Size(48, 19)
		Me.txtOutPortData.TabIndex = 8
		Me.txtOutPortData.Text = "TextBox2"
		'
		'txtOutPortNo
		'
		Me.txtOutPortNo.Location = New System.Drawing.Point(100, 23)
		Me.txtOutPortNo.Name = "txtOutPortNo"
		Me.txtOutPortNo.Size = New System.Drawing.Size(48, 19)
		Me.txtOutPortNo.TabIndex = 7
		Me.txtOutPortNo.Text = "TextBox1"
		'
		'Label8
		'
		Me.Label8.Location = New System.Drawing.Point(290, 27)
		Me.Label8.Name = "Label8"
		Me.Label8.Size = New System.Drawing.Size(56, 16)
		Me.Label8.TabIndex = 3
		Me.Label8.Text = "(16i)"
		'
		'Label9
		'
		Me.Label9.Location = New System.Drawing.Point(170, 27)
		Me.Label9.Name = "Label9"
		Me.Label9.Size = New System.Drawing.Size(72, 16)
		Me.Label9.TabIndex = 2
		Me.Label9.Text = "o̓f[^F"
		'
		'Label10
		'
		Me.Label10.Location = New System.Drawing.Point(10, 27)
		Me.Label10.Name = "Label10"
		Me.Label10.Size = New System.Drawing.Size(96, 16)
		Me.Label10.TabIndex = 1
		Me.Label10.Text = "_|[gԍF"
		'
		'GroupBox4
		'
		Me.GroupBox4.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnEchoBackBit, Me.btnOutBit, Me.txtOutBitData, Me.txtOutBitNo, Me.Label12, Me.Label13})
		Me.GroupBox4.Location = New System.Drawing.Point(8, 256)
		Me.GroupBox4.Name = "GroupBox4"
		Me.GroupBox4.Size = New System.Drawing.Size(580, 60)
		Me.GroupBox4.TabIndex = 4
		Me.GroupBox4.TabStop = False
		Me.GroupBox4.Text = "Prbgo"
		'
		'btnEchoBackBit
		'
		Me.btnEchoBackBit.Location = New System.Drawing.Point(464, 21)
		Me.btnEchoBackBit.Name = "btnEchoBackBit"
		Me.btnEchoBackBit.Size = New System.Drawing.Size(105, 24)
		Me.btnEchoBackBit.TabIndex = 14
		Me.btnEchoBackBit.Text = "DioEchoBackBit"
		'
		'btnOutBit
		'
		Me.btnOutBit.Location = New System.Drawing.Point(352, 21)
		Me.btnOutBit.Name = "btnOutBit"
		Me.btnOutBit.Size = New System.Drawing.Size(105, 24)
		Me.btnOutBit.TabIndex = 13
		Me.btnOutBit.Text = "DioOutBit"
		'
		'txtOutBitData
		'
		Me.txtOutBitData.Location = New System.Drawing.Point(236, 24)
		Me.txtOutBitData.Name = "txtOutBitData"
		Me.txtOutBitData.Size = New System.Drawing.Size(48, 19)
		Me.txtOutBitData.TabIndex = 12
		Me.txtOutBitData.Text = "TextBox2"
		'
		'txtOutBitNo
		'
		Me.txtOutBitNo.Location = New System.Drawing.Point(100, 23)
		Me.txtOutBitNo.Name = "txtOutBitNo"
		Me.txtOutBitNo.Size = New System.Drawing.Size(48, 19)
		Me.txtOutBitNo.TabIndex = 11
		Me.txtOutBitNo.Text = "TextBox1"
		'
		'Label12
		'
		Me.Label12.Location = New System.Drawing.Point(170, 27)
		Me.Label12.Name = "Label12"
		Me.Label12.Size = New System.Drawing.Size(72, 16)
		Me.Label12.TabIndex = 2
		Me.Label12.Text = "o̓f[^F"
		'
		'Label13
		'
		Me.Label13.Location = New System.Drawing.Point(10, 27)
		Me.Label13.Name = "Label13"
		Me.Label13.Size = New System.Drawing.Size(96, 16)
		Me.Label13.TabIndex = 1
		Me.Label13.Text = "_rbgԍF"
		'
		'btnDioInit
		'
		Me.btnDioInit.Location = New System.Drawing.Point(360, 8)
		Me.btnDioInit.Name = "btnDioInit"
		Me.btnDioInit.Size = New System.Drawing.Size(105, 24)
		Me.btnDioInit.TabIndex = 0
		Me.btnDioInit.Text = "DioInit"
		'
		'btnDioExit
		'
		Me.btnDioExit.Location = New System.Drawing.Point(360, 328)
		Me.btnDioExit.Name = "btnDioExit"
		Me.btnDioExit.Size = New System.Drawing.Size(105, 24)
		Me.btnDioExit.TabIndex = 15
		Me.btnDioExit.Text = "DioExit"
		'
		'btnExit
		'
		Me.btnExit.Location = New System.Drawing.Point(360, 360)
		Me.btnExit.Name = "btnExit"
		Me.btnExit.Size = New System.Drawing.Size(105, 24)
		Me.btnExit.TabIndex = 16
		Me.btnExit.Text = "Exit"
		'
		'Label5
		'
		Me.Label5.Location = New System.Drawing.Point(8, 336)
		Me.Label5.Name = "Label5"
		Me.Label5.Size = New System.Drawing.Size(72, 16)
		Me.Label5.TabIndex = 12
		Me.Label5.Text = "߂lF"
		'
		'txtReturnCode
		'
		Me.txtReturnCode.Location = New System.Drawing.Point(64, 333)
		Me.txtReturnCode.Name = "txtReturnCode"
		Me.txtReturnCode.Size = New System.Drawing.Size(288, 19)
		Me.txtReturnCode.TabIndex = 17
		Me.txtReturnCode.Text = ""
		'
		'SimpleIO
		'
		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
		Me.ClientSize = New System.Drawing.Size(608, 397)
		Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtReturnCode, Me.Label5, Me.btnExit, Me.btnDioExit, Me.btnDioInit, Me.GroupBox4, Me.GroupBox2, Me.GroupBox1, Me.cboDeviceName, Me.Label1, Me.GroupBox3})
		Me.Font = New System.Drawing.Font("lr oSVbN", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
		Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
		Me.MaximizeBox = False
		Me.MinimizeBox = False
		Me.Name = "SimpleIO"
		Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
		Me.Text = "Po"
		Me.GroupBox1.ResumeLayout(False)
		Me.GroupBox2.ResumeLayout(False)
		Me.GroupBox3.ResumeLayout(False)
		Me.GroupBox4.ResumeLayout(False)
		Me.ResumeLayout(False)

	End Sub

#End Region
	Dim Id As Short						' foCXID
	Dim Ret As Integer					' ߂l
	Dim szError As New System.Text.StringBuilder("", 256) ' G[
	Dim szText As New String("", 100)

	'---------------------------------------------------------
	'	_CAO
	'---------------------------------------------------------
	Private Sub SimpleIO_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

		'-----------------------------------
		' foCX̌o
		'-----------------------------------
		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
		'-----------------------------------
		' ʃACȅ
		'-----------------------------------
		txtInpPortNo.Text = "0"
		txtInpBitNo.Text = "0"
		txtOutPortNo.Text = "0"
		txtOutBitNo.Text = "0"
		txtOutPortData.Text = "55"
		txtOutBitData.Text = "1"
		txtReturnCode.Text = ""
		txtInpPortData.Text = ""
		txtInpBitData.Text = ""

	End Sub

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

		Dim szDeviceName As New String("", 100)
		'-----------------------------
		' ʂfoCX擾
		'-----------------------------
		szDeviceName = cboDeviceName.Text
		'-----------------------------
		' sȂAID擾
		'-----------------------------
		Ret = DioInit(szDeviceName, Id)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioInit : " & szError.ToString()

	End Sub

	'---------------------------------------------------------
	'	P|[g
	'---------------------------------------------------------
	Private Sub btnInpByte_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInpByte.Click

		Dim InpPortNo As Short
		Dim InpPortData As Byte
		'-----------------------------
		' ʂ|[gԍ擾
		'-----------------------------
		InpPortNo = Val(txtInpPortNo.Text)
		'-----------------------------
		' |[g
		'-----------------------------
		Ret = DioInpByte(Id, InpPortNo, InpPortData)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioInpByte : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' f[^\
		'-----------------------------
		txtInpPortData.Text = String.Format("{0:X2}", InpPortData)

	End Sub

	'---------------------------------------------------------
	'	Prbg
	'---------------------------------------------------------
	Private Sub btnInpBit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInpBit.Click

		Dim InpBitNo As Short
		Dim InpBitData As Byte
		'-----------------------------
		' ʂrbgԍ擾
		'-----------------------------
		InpBitNo = Val(txtInpBitNo.Text)
		'-----------------------------
		' rbg
		'-----------------------------
		Ret = DioInpBit(Id, InpBitNo, InpBitData)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioInpBit : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' f[^\
		'-----------------------------
		txtInpBitData.Text = String.Format("{0:X}", InpBitData)

	End Sub

	'---------------------------------------------------------
	'	P|[go
	'---------------------------------------------------------
	Private Sub btnOutByte_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutByte.Click

		Dim OutPortNo As Short
		Dim OutPortData As Byte
		'-----------------------------
		' ʂ|[gԍƏo̓f[^擾
		'-----------------------------
		szText = txtOutPortNo.Text
		OutPortNo = Val(szText)
		szText = txtOutPortData.Text
		OutPortData = Val("&H" & szText)
		'-----------------------------
		' |[go
		'-----------------------------
		Ret = DioOutByte(Id, OutPortNo, OutPortData)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioOutByte : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If

	End Sub

	'---------------------------------------------------------
	'	Prbgo
	'---------------------------------------------------------
	Private Sub btnOutBit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutBit.Click

		Dim OutBitNo As Short
		Dim OutBitData As Byte
		'-----------------------------
		' ʂrbgԍƏo̓f[^擾
		'-----------------------------
		szText = txtOutBitNo.Text
		OutBitNo = Val(szText)
		szText = txtOutBitData.Text
		OutBitData = Val("&H" & szText)
		'-----------------------------
		' rbgo
		'-----------------------------
		Ret = DioOutBit(Id, OutBitNo, OutBitData)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioOutBit : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If

	End Sub

	'---------------------------------------------------------
	'	P|[gGR[obN
	'---------------------------------------------------------
	Private Sub btnEchoBackByte_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEchoBackByte.Click

		Dim OutPortNo As Short
		Dim OutPortData As Byte
		'-----------------------------
		' ʂ|[gԍ擾
		'-----------------------------
		OutPortNo = Val(txtOutPortNo.Text)
		'-----------------------------
		' |[gGR[obN
		'-----------------------------
		Ret = DioEchoBackByte(Id, OutPortNo, OutPortData)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioEchoBackByte : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' f[^\
		'-----------------------------
		txtOutPortData.Text = String.Format("{0:X2}", OutPortData)

	End Sub

	'---------------------------------------------------------
	'	PrbgGR[obN
	'---------------------------------------------------------
	Private Sub btnEchoBackBit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEchoBackBit.Click

		Dim OutBitNo As Short
		Dim OutBitData As Byte
		'-----------------------------
		' ʂrbgԍ擾
		'-----------------------------
		OutBitNo = Val(txtOutBitNo.Text)
		'-----------------------------
		' rbgGR[obN
		'-----------------------------
		Ret = DioEchoBackBit(Id, OutBitNo, OutBitData)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioEchoBackBit : " & szError.ToString()
		If Ret <> DIO_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' f[^\
		'-----------------------------
		txtOutBitData.Text = String.Format("{0:X}", OutBitData)

	End Sub

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

		' Is
		'-----------------------------
		Ret = DioExit(Id)
		'-----------------------------
		' G[
		'-----------------------------
		DioGetErrorString(Ret, szError)
		txtReturnCode.Text = "DioExit : " & szError.ToString()

	End Sub

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

		'-----------------------------
		' Is
		'-----------------------------
		Ret = DioExit(Id)
		'-----------------------------
		' _CAOI
		'-----------------------------
		End

	End Sub

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

		' Is
		Ret = DioExit(Id)

	End Sub
End Class