﻿Option Strict Off
Option Explicit On 
Imports System.Text

Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows フォーム デザイナによって生成されたコード"
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'スタートアップ フォームについては、最初に作成されたインスタンスが既定インスタンスになります。
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'この呼び出しは、Windows フォーム デザイナで必要です。
		InitializeComponent()
	End Sub
	'Form は、コンポーネント一覧に後処理を実行するために dispose をオーバーライドします。
	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 フォーム デザイナで必要です。
	Private components As System.ComponentModel.IContainer
	Public ToolTip1 As System.Windows.Forms.ToolTip
	Public WithEvents Button_Exit As System.Windows.Forms.Button
	Public WithEvents Button_DioExit As System.Windows.Forms.Button
	Public WithEvents Edit_ReturnCode As System.Windows.Forms.TextBox
	Public WithEvents Edit_OutBitData As System.Windows.Forms.TextBox
	Public WithEvents Edit_OutBitNo As System.Windows.Forms.TextBox
	Public WithEvents Button_EchoBackBit As System.Windows.Forms.Button
	Public WithEvents Button_OutBit As System.Windows.Forms.Button
	Public WithEvents Label11 As System.Windows.Forms.Label
	Public WithEvents Label8 As System.Windows.Forms.Label
	Public WithEvents Frame4 As System.Windows.Forms.GroupBox
	Public WithEvents Edit_OutPortData As System.Windows.Forms.TextBox
	Public WithEvents Edit_OutPortNo As System.Windows.Forms.TextBox
	Public WithEvents Button_EchoBackByte As System.Windows.Forms.Button
	Public WithEvents Button_OutByte As System.Windows.Forms.Button
	Public WithEvents Label12 As System.Windows.Forms.Label
	Public WithEvents Label10 As System.Windows.Forms.Label
	Public WithEvents Label7 As System.Windows.Forms.Label
	Public WithEvents Frame3 As System.Windows.Forms.GroupBox
	Public WithEvents Edit_InpBitData As System.Windows.Forms.TextBox
	Public WithEvents Edit_InpBitNo As System.Windows.Forms.TextBox
	Public WithEvents Button_InpBit As System.Windows.Forms.Button
	Public WithEvents Label9 As System.Windows.Forms.Label
	Public WithEvents Label6 As System.Windows.Forms.Label
	Public WithEvents Frame2 As System.Windows.Forms.GroupBox
	Public WithEvents Button_InpByte As System.Windows.Forms.Button
	Public WithEvents Edit_InpPortData As System.Windows.Forms.TextBox
	Public WithEvents Edit_InpPortNo As System.Windows.Forms.TextBox
	Public WithEvents Label4 As System.Windows.Forms.Label
	Public WithEvents Label3 As System.Windows.Forms.Label
	Public WithEvents Label2 As System.Windows.Forms.Label
	Public WithEvents Frame1 As System.Windows.Forms.GroupBox
	Public WithEvents Button_DioInit As System.Windows.Forms.Button
	Public WithEvents Edit_DeviceName As System.Windows.Forms.TextBox
	Public WithEvents Label5 As System.Windows.Forms.Label
	Public WithEvents Label1 As System.Windows.Forms.Label
	'メモ : 以下のプロシージャは Windows フォーム デザイナで必要です。
	'Windows フォーム デザイナを使って変更できます。
	'コードエディタを使って修正しないでください。
	Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
	Public WithEvents Label13 As System.Windows.Forms.Label
	Public WithEvents Edit_DirData As System.Windows.Forms.TextBox
	Public WithEvents Button_SetIoDirection As System.Windows.Forms.Button


	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Me.components = New System.ComponentModel.Container()
		Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
		Me.Button_Exit = New System.Windows.Forms.Button()
		Me.Button_DioExit = New System.Windows.Forms.Button()
		Me.Edit_ReturnCode = New System.Windows.Forms.TextBox()
		Me.Frame4 = New System.Windows.Forms.GroupBox()
		Me.Edit_OutBitData = New System.Windows.Forms.TextBox()
		Me.Edit_OutBitNo = New System.Windows.Forms.TextBox()
		Me.Button_EchoBackBit = New System.Windows.Forms.Button()
		Me.Button_OutBit = New System.Windows.Forms.Button()
		Me.Label11 = New System.Windows.Forms.Label()
		Me.Label8 = New System.Windows.Forms.Label()
		Me.Frame3 = New System.Windows.Forms.GroupBox()
		Me.Edit_OutPortData = New System.Windows.Forms.TextBox()
		Me.Edit_OutPortNo = New System.Windows.Forms.TextBox()
		Me.Button_EchoBackByte = New System.Windows.Forms.Button()
		Me.Button_OutByte = New System.Windows.Forms.Button()
		Me.Label12 = New System.Windows.Forms.Label()
		Me.Label10 = New System.Windows.Forms.Label()
		Me.Label7 = New System.Windows.Forms.Label()
		Me.Frame2 = New System.Windows.Forms.GroupBox()
		Me.Edit_InpBitData = New System.Windows.Forms.TextBox()
		Me.Edit_InpBitNo = New System.Windows.Forms.TextBox()
		Me.Button_InpBit = New System.Windows.Forms.Button()
		Me.Label9 = New System.Windows.Forms.Label()
		Me.Label6 = New System.Windows.Forms.Label()
		Me.Frame1 = New System.Windows.Forms.GroupBox()
		Me.Button_InpByte = New System.Windows.Forms.Button()
		Me.Edit_InpPortData = New System.Windows.Forms.TextBox()
		Me.Edit_InpPortNo = 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.Button_DioInit = New System.Windows.Forms.Button()
		Me.Edit_DeviceName = New System.Windows.Forms.TextBox()
		Me.Label5 = New System.Windows.Forms.Label()
		Me.Label1 = New System.Windows.Forms.Label()
		Me.GroupBox1 = New System.Windows.Forms.GroupBox()
		Me.Button_SetIoDirection = New System.Windows.Forms.Button()
		Me.Edit_DirData = New System.Windows.Forms.TextBox()
		Me.Label13 = New System.Windows.Forms.Label()
		Me.Frame4.SuspendLayout()
		Me.Frame3.SuspendLayout()
		Me.Frame2.SuspendLayout()
		Me.Frame1.SuspendLayout()
		Me.GroupBox1.SuspendLayout()
		Me.SuspendLayout()
		'
		'Button_Exit
		'
		Me.Button_Exit.BackColor = System.Drawing.SystemColors.Control
		Me.Button_Exit.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_Exit.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_Exit.Location = New System.Drawing.Point(328, 376)
		Me.Button_Exit.Name = "Button_Exit"
		Me.Button_Exit.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_Exit.Size = New System.Drawing.Size(104, 25)
		Me.Button_Exit.TabIndex = 19
		Me.Button_Exit.Text = "Exit"
		'
		'Button_DioExit
		'
		Me.Button_DioExit.BackColor = System.Drawing.SystemColors.Control
		Me.Button_DioExit.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_DioExit.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_DioExit.Location = New System.Drawing.Point(328, 336)
		Me.Button_DioExit.Name = "Button_DioExit"
		Me.Button_DioExit.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_DioExit.Size = New System.Drawing.Size(104, 25)
		Me.Button_DioExit.TabIndex = 18
		Me.Button_DioExit.Text = "DioExit"
		'
		'Edit_ReturnCode
		'
		Me.Edit_ReturnCode.AcceptsReturn = True
		Me.Edit_ReturnCode.AutoSize = False
		Me.Edit_ReturnCode.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_ReturnCode.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_ReturnCode.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_ReturnCode.Location = New System.Drawing.Point(80, 336)
		Me.Edit_ReturnCode.MaxLength = 0
		Me.Edit_ReturnCode.Name = "Edit_ReturnCode"
		Me.Edit_ReturnCode.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_ReturnCode.Size = New System.Drawing.Size(209, 25)
		Me.Edit_ReturnCode.TabIndex = 13
		Me.Edit_ReturnCode.Text = "Text4"
		'
		'Frame4
		'
		Me.Frame4.BackColor = System.Drawing.SystemColors.Control
		Me.Frame4.Controls.AddRange(New System.Windows.Forms.Control() {Me.Edit_OutBitData, Me.Edit_OutBitNo, Me.Button_EchoBackBit, Me.Button_OutBit, Me.Label11, Me.Label8})
		Me.Frame4.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame4.Location = New System.Drawing.Point(8, 272)
		Me.Frame4.Name = "Frame4"
		Me.Frame4.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame4.Size = New System.Drawing.Size(569, 49)
		Me.Frame4.TabIndex = 12
		Me.Frame4.TabStop = False
		Me.Frame4.Text = "１ビット出力"
		'
		'Edit_OutBitData
		'
		Me.Edit_OutBitData.AcceptsReturn = True
		Me.Edit_OutBitData.AutoSize = False
		Me.Edit_OutBitData.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_OutBitData.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_OutBitData.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_OutBitData.Location = New System.Drawing.Point(232, 24)
		Me.Edit_OutBitData.MaxLength = 0
		Me.Edit_OutBitData.Name = "Edit_OutBitData"
		Me.Edit_OutBitData.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_OutBitData.Size = New System.Drawing.Size(33, 18)
		Me.Edit_OutBitData.TabIndex = 27
		Me.Edit_OutBitData.Text = "Text6"
		'
		'Edit_OutBitNo
		'
		Me.Edit_OutBitNo.AcceptsReturn = True
		Me.Edit_OutBitNo.AutoSize = False
		Me.Edit_OutBitNo.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_OutBitNo.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_OutBitNo.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_OutBitNo.Location = New System.Drawing.Point(104, 24)
		Me.Edit_OutBitNo.MaxLength = 0
		Me.Edit_OutBitNo.Name = "Edit_OutBitNo"
		Me.Edit_OutBitNo.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_OutBitNo.Size = New System.Drawing.Size(49, 18)
		Me.Edit_OutBitNo.TabIndex = 26
		Me.Edit_OutBitNo.Text = "Text5"
		'
		'Button_EchoBackBit
		'
		Me.Button_EchoBackBit.BackColor = System.Drawing.SystemColors.Control
		Me.Button_EchoBackBit.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_EchoBackBit.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_EchoBackBit.Location = New System.Drawing.Point(440, 16)
		Me.Button_EchoBackBit.Name = "Button_EchoBackBit"
		Me.Button_EchoBackBit.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_EchoBackBit.Size = New System.Drawing.Size(105, 25)
		Me.Button_EchoBackBit.TabIndex = 21
		Me.Button_EchoBackBit.Text = "DioEchoBackBit"
		'
		'Button_OutBit
		'
		Me.Button_OutBit.BackColor = System.Drawing.SystemColors.Control
		Me.Button_OutBit.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_OutBit.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_OutBit.Location = New System.Drawing.Point(320, 16)
		Me.Button_OutBit.Name = "Button_OutBit"
		Me.Button_OutBit.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_OutBit.Size = New System.Drawing.Size(104, 25)
		Me.Button_OutBit.TabIndex = 17
		Me.Button_OutBit.Text = "DioOutBit"
		'
		'Label11
		'
		Me.Label11.BackColor = System.Drawing.SystemColors.Control
		Me.Label11.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label11.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label11.Location = New System.Drawing.Point(160, 24)
		Me.Label11.Name = "Label11"
		Me.Label11.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label11.Size = New System.Drawing.Size(65, 17)
		Me.Label11.TabIndex = 33
		Me.Label11.Text = "出力データ："
		'
		'Label8
		'
		Me.Label8.BackColor = System.Drawing.SystemColors.Control
		Me.Label8.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label8.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label8.Location = New System.Drawing.Point(16, 24)
		Me.Label8.Name = "Label8"
		Me.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label8.Size = New System.Drawing.Size(89, 17)
		Me.Label8.TabIndex = 30
		Me.Label8.Text = "論理ビット番号："
		'
		'Frame3
		'
		Me.Frame3.BackColor = System.Drawing.SystemColors.Control
		Me.Frame3.Controls.AddRange(New System.Windows.Forms.Control() {Me.Edit_OutPortData, Me.Edit_OutPortNo, Me.Button_EchoBackByte, Me.Button_OutByte, Me.Label12, Me.Label10, Me.Label7})
		Me.Frame3.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame3.Location = New System.Drawing.Point(8, 216)
		Me.Frame3.Name = "Frame3"
		Me.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame3.Size = New System.Drawing.Size(569, 49)
		Me.Frame3.TabIndex = 11
		Me.Frame3.TabStop = False
		Me.Frame3.Text = "１ポート出力"
		'
		'Edit_OutPortData
		'
		Me.Edit_OutPortData.AcceptsReturn = True
		Me.Edit_OutPortData.AutoSize = False
		Me.Edit_OutPortData.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_OutPortData.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_OutPortData.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_OutPortData.Location = New System.Drawing.Point(232, 24)
		Me.Edit_OutPortData.MaxLength = 0
		Me.Edit_OutPortData.Name = "Edit_OutPortData"
		Me.Edit_OutPortData.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_OutPortData.Size = New System.Drawing.Size(33, 18)
		Me.Edit_OutPortData.TabIndex = 25
		Me.Edit_OutPortData.Text = "Text4"
		'
		'Edit_OutPortNo
		'
		Me.Edit_OutPortNo.AcceptsReturn = True
		Me.Edit_OutPortNo.AutoSize = False
		Me.Edit_OutPortNo.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_OutPortNo.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_OutPortNo.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_OutPortNo.Location = New System.Drawing.Point(104, 24)
		Me.Edit_OutPortNo.MaxLength = 0
		Me.Edit_OutPortNo.Name = "Edit_OutPortNo"
		Me.Edit_OutPortNo.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_OutPortNo.Size = New System.Drawing.Size(49, 18)
		Me.Edit_OutPortNo.TabIndex = 24
		Me.Edit_OutPortNo.Text = "Text3"
		'
		'Button_EchoBackByte
		'
		Me.Button_EchoBackByte.BackColor = System.Drawing.SystemColors.Control
		Me.Button_EchoBackByte.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_EchoBackByte.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_EchoBackByte.Location = New System.Drawing.Point(440, 16)
		Me.Button_EchoBackByte.Name = "Button_EchoBackByte"
		Me.Button_EchoBackByte.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_EchoBackByte.Size = New System.Drawing.Size(105, 25)
		Me.Button_EchoBackByte.TabIndex = 20
		Me.Button_EchoBackByte.Text = "DioEchoBackByte"
		'
		'Button_OutByte
		'
		Me.Button_OutByte.BackColor = System.Drawing.SystemColors.Control
		Me.Button_OutByte.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_OutByte.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_OutByte.Location = New System.Drawing.Point(320, 16)
		Me.Button_OutByte.Name = "Button_OutByte"
		Me.Button_OutByte.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_OutByte.Size = New System.Drawing.Size(104, 25)
		Me.Button_OutByte.TabIndex = 16
		Me.Button_OutByte.Text = "DioOutByte"
		'
		'Label12
		'
		Me.Label12.BackColor = System.Drawing.SystemColors.Control
		Me.Label12.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label12.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label12.Location = New System.Drawing.Point(272, 24)
		Me.Label12.Name = "Label12"
		Me.Label12.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label12.Size = New System.Drawing.Size(49, 17)
		Me.Label12.TabIndex = 34
		Me.Label12.Text = "(16進数)"
		'
		'Label10
		'
		Me.Label10.BackColor = System.Drawing.SystemColors.Control
		Me.Label10.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label10.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label10.Location = New System.Drawing.Point(160, 24)
		Me.Label10.Name = "Label10"
		Me.Label10.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label10.Size = New System.Drawing.Size(73, 17)
		Me.Label10.TabIndex = 32
		Me.Label10.Text = "出力データ："
		'
		'Label7
		'
		Me.Label7.BackColor = System.Drawing.SystemColors.Control
		Me.Label7.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label7.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label7.Location = New System.Drawing.Point(16, 24)
		Me.Label7.Name = "Label7"
		Me.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label7.Size = New System.Drawing.Size(89, 17)
		Me.Label7.TabIndex = 29
		Me.Label7.Text = "論理ポート番号："
		'
		'Frame2
		'
		Me.Frame2.BackColor = System.Drawing.SystemColors.Control
		Me.Frame2.Controls.AddRange(New System.Windows.Forms.Control() {Me.Edit_InpBitData, Me.Edit_InpBitNo, Me.Button_InpBit, Me.Label9, Me.Label6})
		Me.Frame2.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame2.Location = New System.Drawing.Point(8, 160)
		Me.Frame2.Name = "Frame2"
		Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame2.Size = New System.Drawing.Size(569, 49)
		Me.Frame2.TabIndex = 10
		Me.Frame2.TabStop = False
		Me.Frame2.Text = "１ビット入力"
		'
		'Edit_InpBitData
		'
		Me.Edit_InpBitData.AcceptsReturn = True
		Me.Edit_InpBitData.AutoSize = False
		Me.Edit_InpBitData.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_InpBitData.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_InpBitData.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_InpBitData.Location = New System.Drawing.Point(232, 24)
		Me.Edit_InpBitData.MaxLength = 0
		Me.Edit_InpBitData.Name = "Edit_InpBitData"
		Me.Edit_InpBitData.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_InpBitData.Size = New System.Drawing.Size(33, 18)
		Me.Edit_InpBitData.TabIndex = 23
		Me.Edit_InpBitData.Text = "Text2"
		'
		'Edit_InpBitNo
		'
		Me.Edit_InpBitNo.AcceptsReturn = True
		Me.Edit_InpBitNo.AutoSize = False
		Me.Edit_InpBitNo.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_InpBitNo.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_InpBitNo.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_InpBitNo.Location = New System.Drawing.Point(104, 24)
		Me.Edit_InpBitNo.MaxLength = 0
		Me.Edit_InpBitNo.Name = "Edit_InpBitNo"
		Me.Edit_InpBitNo.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_InpBitNo.Size = New System.Drawing.Size(49, 18)
		Me.Edit_InpBitNo.TabIndex = 22
		Me.Edit_InpBitNo.Text = "Text1"
		'
		'Button_InpBit
		'
		Me.Button_InpBit.BackColor = System.Drawing.SystemColors.Control
		Me.Button_InpBit.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_InpBit.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_InpBit.Location = New System.Drawing.Point(320, 16)
		Me.Button_InpBit.Name = "Button_InpBit"
		Me.Button_InpBit.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_InpBit.Size = New System.Drawing.Size(104, 25)
		Me.Button_InpBit.TabIndex = 15
		Me.Button_InpBit.Text = "DioInpBit"
		'
		'Label9
		'
		Me.Label9.BackColor = System.Drawing.SystemColors.Control
		Me.Label9.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label9.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label9.Location = New System.Drawing.Point(160, 24)
		Me.Label9.Name = "Label9"
		Me.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label9.Size = New System.Drawing.Size(65, 17)
		Me.Label9.TabIndex = 31
		Me.Label9.Text = "入力データ："
		'
		'Label6
		'
		Me.Label6.BackColor = System.Drawing.SystemColors.Control
		Me.Label6.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label6.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label6.Location = New System.Drawing.Point(16, 24)
		Me.Label6.Name = "Label6"
		Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label6.Size = New System.Drawing.Size(88, 17)
		Me.Label6.TabIndex = 28
		Me.Label6.Text = "論理ビット番号："
		'
		'Frame1
		'
		Me.Frame1.BackColor = System.Drawing.SystemColors.Control
		Me.Frame1.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button_InpByte, Me.Edit_InpPortData, Me.Edit_InpPortNo, Me.Label4, Me.Label3, Me.Label2})
		Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame1.Location = New System.Drawing.Point(8, 104)
		Me.Frame1.Name = "Frame1"
		Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame1.Size = New System.Drawing.Size(569, 49)
		Me.Frame1.TabIndex = 3
		Me.Frame1.TabStop = False
		Me.Frame1.Text = "１ポート入力"
		'
		'Button_InpByte
		'
		Me.Button_InpByte.BackColor = System.Drawing.SystemColors.Control
		Me.Button_InpByte.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_InpByte.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_InpByte.Location = New System.Drawing.Point(320, 16)
		Me.Button_InpByte.Name = "Button_InpByte"
		Me.Button_InpByte.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_InpByte.Size = New System.Drawing.Size(104, 25)
		Me.Button_InpByte.TabIndex = 9
		Me.Button_InpByte.Text = "DioInpByte"
		'
		'Edit_InpPortData
		'
		Me.Edit_InpPortData.AcceptsReturn = True
		Me.Edit_InpPortData.AutoSize = False
		Me.Edit_InpPortData.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_InpPortData.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_InpPortData.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_InpPortData.Location = New System.Drawing.Point(232, 24)
		Me.Edit_InpPortData.MaxLength = 0
		Me.Edit_InpPortData.Name = "Edit_InpPortData"
		Me.Edit_InpPortData.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_InpPortData.Size = New System.Drawing.Size(33, 18)
		Me.Edit_InpPortData.TabIndex = 7
		Me.Edit_InpPortData.Text = "Text3"
		'
		'Edit_InpPortNo
		'
		Me.Edit_InpPortNo.AcceptsReturn = True
		Me.Edit_InpPortNo.AutoSize = False
		Me.Edit_InpPortNo.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_InpPortNo.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_InpPortNo.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_InpPortNo.Location = New System.Drawing.Point(104, 24)
		Me.Edit_InpPortNo.MaxLength = 0
		Me.Edit_InpPortNo.Name = "Edit_InpPortNo"
		Me.Edit_InpPortNo.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_InpPortNo.Size = New System.Drawing.Size(49, 18)
		Me.Edit_InpPortNo.TabIndex = 4
		Me.Edit_InpPortNo.Text = "Text2"
		'
		'Label4
		'
		Me.Label4.BackColor = System.Drawing.SystemColors.Control
		Me.Label4.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label4.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label4.Location = New System.Drawing.Point(272, 24)
		Me.Label4.Name = "Label4"
		Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label4.Size = New System.Drawing.Size(57, 17)
		Me.Label4.TabIndex = 8
		Me.Label4.Text = "(16進数)"
		'
		'Label3
		'
		Me.Label3.BackColor = System.Drawing.SystemColors.Control
		Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label3.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label3.Location = New System.Drawing.Point(160, 24)
		Me.Label3.Name = "Label3"
		Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label3.Size = New System.Drawing.Size(73, 17)
		Me.Label3.TabIndex = 6
		Me.Label3.Text = "入力データ："
		'
		'Label2
		'
		Me.Label2.BackColor = System.Drawing.SystemColors.Control
		Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label2.Location = New System.Drawing.Point(16, 24)
		Me.Label2.Name = "Label2"
		Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label2.Size = New System.Drawing.Size(89, 17)
		Me.Label2.TabIndex = 5
		Me.Label2.Text = "論理ポート番号："
		'
		'Button_DioInit
		'
		Me.Button_DioInit.BackColor = System.Drawing.SystemColors.Control
		Me.Button_DioInit.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_DioInit.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_DioInit.Location = New System.Drawing.Point(328, 11)
		Me.Button_DioInit.Name = "Button_DioInit"
		Me.Button_DioInit.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_DioInit.Size = New System.Drawing.Size(104, 25)
		Me.Button_DioInit.TabIndex = 1
		Me.Button_DioInit.Text = "DioInit"
		'
		'Edit_DeviceName
		'
		Me.Edit_DeviceName.AcceptsReturn = True
		Me.Edit_DeviceName.AutoSize = False
		Me.Edit_DeviceName.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_DeviceName.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_DeviceName.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_DeviceName.Location = New System.Drawing.Point(104, 19)
		Me.Edit_DeviceName.MaxLength = 0
		Me.Edit_DeviceName.Name = "Edit_DeviceName"
		Me.Edit_DeviceName.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_DeviceName.Size = New System.Drawing.Size(97, 18)
		Me.Edit_DeviceName.TabIndex = 0
		Me.Edit_DeviceName.Text = "Text1"
		'
		'Label5
		'
		Me.Label5.BackColor = System.Drawing.SystemColors.Control
		Me.Label5.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label5.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label5.Location = New System.Drawing.Point(24, 336)
		Me.Label5.Name = "Label5"
		Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label5.Size = New System.Drawing.Size(49, 17)
		Me.Label5.TabIndex = 14
		Me.Label5.Text = "戻り値："
		'
		'Label1
		'
		Me.Label1.BackColor = System.Drawing.SystemColors.Control
		Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label1.Location = New System.Drawing.Point(24, 19)
		Me.Label1.Name = "Label1"
		Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label1.Size = New System.Drawing.Size(73, 17)
		Me.Label1.TabIndex = 2
		Me.Label1.Text = "デバイス名："
		'
		'GroupBox1
		'
		Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button_SetIoDirection, Me.Edit_DirData, Me.Label13})
		Me.GroupBox1.Location = New System.Drawing.Point(8, 48)
		Me.GroupBox1.Name = "GroupBox1"
		Me.GroupBox1.Size = New System.Drawing.Size(569, 49)
		Me.GroupBox1.TabIndex = 20
		Me.GroupBox1.TabStop = False
		Me.GroupBox1.Text = "入出力設定"
		'
		'Button_SetIoDirection
		'
		Me.Button_SetIoDirection.BackColor = System.Drawing.SystemColors.Control
		Me.Button_SetIoDirection.Cursor = System.Windows.Forms.Cursors.Default
		Me.Button_SetIoDirection.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Button_SetIoDirection.Location = New System.Drawing.Point(320, 15)
		Me.Button_SetIoDirection.Name = "Button_SetIoDirection"
		Me.Button_SetIoDirection.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Button_SetIoDirection.Size = New System.Drawing.Size(104, 25)
		Me.Button_SetIoDirection.TabIndex = 10
		Me.Button_SetIoDirection.Text = "DioSetIoDirection"
		'
		'Edit_DirData
		'
		Me.Edit_DirData.AcceptsReturn = True
		Me.Edit_DirData.AutoSize = False
		Me.Edit_DirData.BackColor = System.Drawing.SystemColors.Window
		Me.Edit_DirData.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Edit_DirData.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Edit_DirData.Location = New System.Drawing.Point(104, 20)
		Me.Edit_DirData.MaxLength = 0
		Me.Edit_DirData.Name = "Edit_DirData"
		Me.Edit_DirData.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Edit_DirData.Size = New System.Drawing.Size(88, 18)
		Me.Edit_DirData.TabIndex = 7
		Me.Edit_DirData.Text = "Text1"
		'
		'Label13
		'
		Me.Label13.BackColor = System.Drawing.SystemColors.Control
		Me.Label13.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label13.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label13.Location = New System.Drawing.Point(16, 23)
		Me.Label13.Name = "Label13"
		Me.Label13.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label13.Size = New System.Drawing.Size(89, 17)
		Me.Label13.TabIndex = 6
		Me.Label13.Text = "入出力方向："
		'
		'Form1
		'
		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
		Me.ClientSize = New System.Drawing.Size(586, 406)
		Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.GroupBox1, Me.Button_Exit, Me.Button_DioExit, Me.Edit_ReturnCode, Me.Frame4, Me.Frame3, Me.Frame2, Me.Frame1, Me.Button_DioInit, Me.Edit_DeviceName, Me.Label5, Me.Label1})
		Me.Location = New System.Drawing.Point(4, 23)
		Me.MaximizeBox = False
		Me.MinimizeBox = False
		Me.Name = "Form1"
		Me.Text = "単純入出力"
		Me.Frame4.ResumeLayout(False)
		Me.Frame3.ResumeLayout(False)
		Me.Frame2.ResumeLayout(False)
		Me.Frame1.ResumeLayout(False)
		Me.GroupBox1.ResumeLayout(False)
		Me.ResumeLayout(False)

	End Sub
#End Region 
#Region "アップグレード ウィザードのサポート コード"
	Private Shared m_vb6FormDefInstance As Form1
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As Form1
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New Form1()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	
    Dim Id As Short                     ' デバイスID
    Dim Ret As Integer                  ' 戻り値
    Dim szError As New StringBuilder("", 256)  ' エラー文字列
    Dim szText As New String("", 100)

    '---------------------------------------------------------
	' ダイアログ初期化
	'---------------------------------------------------------
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		
        Me.Left = (Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2
        Me.Top = (Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2
		
		' 画面アイテムの初期化
		Edit_DeviceName.Text = "DIO000"
		Edit_DirData.Text = ""
		Edit_InpPortNo.Text = "0"
		Edit_InpBitNo.Text = "0"
		Edit_OutPortNo.Text = "0"
		Edit_OutBitNo.Text = "0"
		Edit_InpPortData.Text = ""
		Edit_InpBitData.Text = ""
		Edit_OutPortData.Text = "55"
		Edit_OutBitData.Text = "1"
		Edit_ReturnCode.Text = ""
		
	End Sub
	
	'---------------------------------------------------------
	' 初期化処理
	'---------------------------------------------------------
	Private Sub Button_DioInit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_DioInit.Click
		
		Dim szDeviceName As String
		
		' 画面からデバイス名を取得する
		szDeviceName = Edit_DeviceName.Text
		
		' 初期化処理を行ない、IDを取得する
		Ret = DioInit(szDeviceName, Id)
		
		' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()

    End Sub

    '---------------------------------------------------------
    ' 終了処理
    '---------------------------------------------------------
    Private Sub Button_DioExit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_DioExit.Click

        ' 終了処理を行う
        Ret = DioExit(Id)

        ' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()

    End Sub

    '---------------------------------------------------------
    ' ダイアログ終了
    '---------------------------------------------------------
    Private Sub Button_Exit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_Exit.Click

        ' 終了処理を行う
        Ret = DioExit(Id)

        ' ダイアログを終了する
        End

    End Sub

    '---------------------------------------------------------
    ' １ポート入力
    '---------------------------------------------------------
    Private Sub Button_InpByte_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_InpByte.Click

        Dim InpPortNo As Short
        Dim InpPortData As Byte

        ' 画面からポート番号を取得する
        szText = Edit_InpPortNo.Text
        InpPortNo = Val(szText)

        ' ポート入力
        Ret = DioInpByte(Id, InpPortNo, InpPortData)

        ' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()
        If (Ret <> DIO_ERR_SUCCESS) Then
            Exit Sub
        End If

        ' データ表示
        Edit_InpPortData.Text = Hex(InpPortData)

    End Sub

    '---------------------------------------------------------
    ' １ビット入力
    '---------------------------------------------------------
    Private Sub Button_InpBit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_InpBit.Click

        Dim InpBitNo As Short
        Dim InpBitData As Byte

        ' 画面からビット番号を取得する
        szText = Edit_InpBitNo.Text
        InpBitNo = Val(szText)

        ' ポート入力
        Ret = DioInpBit(Id, InpBitNo, InpBitData)

        ' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()
        If (Ret <> DIO_ERR_SUCCESS) Then
            Exit Sub
        End If

        ' データ表示
        Edit_InpBitData.Text = CStr(InpBitData)

    End Sub

    '---------------------------------------------------------
    ' １ポート出力
    '---------------------------------------------------------
    Private Sub Button_OutByte_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_OutByte.Click

        Dim OutPortNo As Short
        Dim OutPortData As Byte

        ' 画面からポート番号と出力データを取得する
        szText = Edit_OutPortNo.Text
        OutPortNo = Val(szText)
        szText = Edit_OutPortData.Text
        OutPortData = Val("&H" & szText)

        ' ポート出力
        Ret = DioOutByte(Id, OutPortNo, OutPortData)

        ' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()
        If (Ret <> DIO_ERR_SUCCESS) Then
            Exit Sub
        End If

    End Sub

    '---------------------------------------------------------
    ' １ビット出力
    '---------------------------------------------------------
    Private Sub Button_OutBit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_OutBit.Click

        Dim OutBitNo As Short
        Dim OutBitData As Byte

        ' 画面からポート番号と出力データを取得する
        szText = Edit_OutBitNo.Text
        OutBitNo = Val(szText)
        szText = Edit_OutBitData.Text
        OutBitData = Val("&H" & szText)

        ' ポート出力
        Ret = DioOutBit(Id, OutBitNo, OutBitData)

        ' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()
        If (Ret <> DIO_ERR_SUCCESS) Then
            Exit Sub
        End If

    End Sub

    '---------------------------------------------------------
    ' １ポートエコーバック
    '---------------------------------------------------------
    Private Sub Button_EchoBackByte_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_EchoBackByte.Click

        Dim OutPortNo As Short
        Dim OutPortData As Byte

        ' 画面からポート番号を取得する
        szText = Edit_OutPortNo.Text
        OutPortNo = Val(szText)

        ' ポートエコーバック
        Ret = DioEchoBackByte(Id, OutPortNo, OutPortData)

        ' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()
        If (Ret <> DIO_ERR_SUCCESS) Then
            Exit Sub
        End If

        ' データ表示
        Edit_OutPortData.Text = Hex(OutPortData)            '-----------%02X

    End Sub

    '---------------------------------------------------------
    ' １ビットエコーバック
    '---------------------------------------------------------
    Private Sub Button_EchoBackBit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_EchoBackBit.Click

        Dim OutBitNo As Short
        Dim OutBitData As Byte

        ' 画面からビット番号を取得する
        szText = Edit_OutBitNo.Text
        OutBitNo = Val(szText)

        ' ポート入力
        Ret = DioEchoBackBit(Id, OutBitNo, OutBitData)

        ' エラー処理
        Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()
        If (Ret <> DIO_ERR_SUCCESS) Then
            Exit Sub
        End If

        ' データ表示
        Edit_OutBitData.Text = Hex(OutBitData)              '----------%02X

    End Sub

	'---------------------------------------------------------
	' 入出力方向設定
	' この機能をサポートしているデバイスでのみ使用可能です。
	'---------------------------------------------------------
	Private Sub Button_SetIoDirection_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_SetIoDirection.Click
		Dim dwDir As Integer

		'-----------------------------
		' 入出力方向を取得
		'-----------------------------
		szText = Edit_DirData.Text
		dwDir = Val("&H" & szText)
		'-----------------------------
		' 入出力方向を設定
		'-----------------------------
		Ret = DioSetIoDirection(Id, dwDir)
		'-----------------------------
		' エラー処理
		'-----------------------------
		Call DioGetErrorString(Ret, szError)
        Edit_ReturnCode.Text = "Ret = " & Ret & ":" & szError.ToString()
		If (Ret <> DIO_ERR_SUCCESS) Then
			Exit Sub
		End If
	End Sub
End Class