Imports cVfd256.clsVfd256
Public Class VFD256Sample
'ボーレートは固定値
Dim baud
As Integer = 38400
Private
Sub VFD256Sample_Load(ByVal
sender As System.Object,
ByVal e
As System.EventArgs)
Handles MyBase.Load
'接続方法の選択肢をコンボボックスに追加
CmbAcsMth.Items.Add("USB")
CmbAcsMth.Items.Add("COM1")
End Sub
'表示ボタン押下時
Private Sub BtnDisp_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
BtnDisp.Click
Try
'VFD256に書き込む文字を設定
Vfd2561.Msg0 = Text1.Text
Vfd2561.Msg1 = Text2.Text
Vfd2561.Msg2 = Text3.Text
Vfd2561.Msg3 = Text4.Text
'書き込む前にクリア処理
Vfd2561.AutoInit = True
'接続方法、ボーレートを設定
Vfd2561.Port = CmbAcsMth.Text
Vfd2561.BaudRate = baud
'VFD256に書き込む(表示モードはVFDサンプルプログラム説明書の「2.3
表示モード」参照)
Vfd2561.DrawMode = CType(typeTextDrawMode.WorkMem,
cVfd256.clsVfd256.typeTextDrawMode)
Vfd2561.DispVFD(cVfd256.clsVfd256.typeDispMode.c_3_16_16_16)
Catch ex
As Exception
MsgBox(ex.Message)
End Try
End Sub
'クリアボタン押下時
Private Sub BtnClr_Click(ByVal
sender As
System.Object, ByVal e
As System.EventArgs)
Handles BtnClr.Click
Text1.Text = ""
Text2.Text =
""
Text3.Text =
""
Text4.Text =
""
'VFD256の表示を消す
Vfd2561.CLS()
End Sub
'終了ボタン押下時
Private Sub BtnExit_Click(ByVal
sender As
System.Object, ByVal e
As System.EventArgs)
Handles BtnExit.Click
Application.Exit()
End Sub
End Class |