⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 melsecqsw.frm

📁 MelsecQ Serial communication Switch setting
💻 FRM
📖 第 1 页 / 共 3 页
字号:
   Begin VB.Label Label12 
      Caption         =   "Tel:0769-2652352  Fax:0769-2652353"
      Height          =   375
      Left            =   120
      TabIndex        =   69
      Top             =   7320
      Width           =   2775
   End
   Begin VB.Label Label11 
      Caption         =   "光景工業有限公司大陸辦事處"
      Height          =   255
      Left            =   4320
      TabIndex        =   68
      Top             =   6960
      Width           =   3855
   End
   Begin VB.Label Label10 
      Caption         =   "KWANGCHING INDUSTRIAL CO .,LTD"
      Height          =   255
      Left            =   120
      TabIndex        =   67
      Top             =   6960
      Width           =   3735
   End
   Begin VB.Label Label9 
      Caption         =   "MelsecQ Serial Communication Switch Setting Software"
      Height          =   495
      Left            =   1320
      TabIndex        =   66
      Top             =   120
      Width           =   8415
   End
   Begin VB.Label Label8 
      Caption         =   "Author:Ronron Long"
      ForeColor       =   &H000040C0&
      Height          =   375
      Left            =   8520
      TabIndex        =   65
      Top             =   7320
      Width           =   1455
   End
   Begin VB.Label Label7 
      Caption         =   "     Version 1.0"
      Height          =   255
      Left            =   8520
      TabIndex        =   64
      Top             =   6960
      Width           =   1335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim OperationB0 As String
Dim DataBitB1 As String
Dim ParityB2 As String
Dim CheckB3 As String
Dim StopBitB4 As String
Dim CheckSumB5 As String
Dim WriteRunB6 As String
Dim ChangeSettingB7 As String


Dim ResultLow As String
Dim ResultHi As String
Dim Result As String
Dim ResultHexLow As String
Dim ResultHexHi As String


Dim Protocol As String
Dim Baud As String
Dim CH As String


Private Sub EXITSYSTEM_Click()
Unload Me
End Sub

Private Sub Form_Load()

'OperationB0 = "0"
'DataBitB1 = "0"
'ParityB2 = "0"
'CheckB3 = "0"
'StopBitB4 = "0"
'CheckSumB5 = "0"
'WriteRunB6 = "0"
'ChangeSettingB7 = "0"

'Baud = "05H"
'
'Protocol = "0004H"
Frame2.FontBold = True
Frame3.FontBold = True
Frame4.FontBold = True
Frame5.FontBold = True
Frame6.FontBold = True
Frame7.FontBold = True
Frame8.FontBold = True
Frame9.FontBold = True
Frame10.FontBold = True
Frame11.FontBold = True
Frame13.FontBold = True
Frame14.FontBold = True

EXITSYSTEM.FontBold = True



Label9.FontBold = True
Label9.FontSize = 15

Label10.FontBold = True
Label10.ForeColor = RGB(255, 0, 0)

Label11.FontBold = True

OptnFt4.Value = True

ResultHi = ChangeSettingB7 & WriteRunB6 & CheckSumB5 & StopBitB4

ResultLow = CheckB3 & ParityB2 & DataBitB1 & OperationB0

OpnIndep.Value = True
OptnData8.Value = True
OptnParityYes.Value = True
OptnCheckODD.Value = True
OptnStop1.Value = True
OptnSumYes.Value = True
OptnWriteRunEn.Value = True
OptnChgSetDis.Value = True

OptnBaud9600.Value = True

OptnCH1.Value = True

'TxtSwitch1.Enabled = False
'TxtSwitch2.Enabled = False
'TxtSwitch3.Enabled = False
'TxtSwitch4.Enabled = False
'TxtSwitch5.Enabled = False
TxtSwitch1.FontBold = True
TxtSwitch1.ForeColor = RGB(255, 0, 0)
TxtSwitch2.FontBold = True
TxtSwitch2.ForeColor = RGB(255, 0, 0)

TxtSwitch3.FontBold = True
TxtSwitch3.ForeColor = RGB(255, 0, 255)
TxtSwitch4.FontBold = True
TxtSwitch4.ForeColor = RGB(255, 0, 255)

TxtSwitch5.FontBold = True


'Result = Baud & ResultHi & ResultLow
End Sub

Private Sub OpnData7_Click()

DataBitB1 = "0"
ResultLow = CheckB3 & ParityB2 & DataBitB1 & OperationB0

ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OpnIndep_Click()
OperationB0 = "0"
ResultLow = CheckB3 & ParityB2 & DataBitB1 & OperationB0

ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OpnLinK_Click()
OperationB0 = "1"
ResultLow = CheckB3 & ParityB2 & DataBitB1 & OperationB0

ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud115200_Click()
Baud = "0B"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud1200_Click()
Baud = "02"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud14400_Click()
Baud = "06"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud19200_Click()
Baud = "07"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud2400_Click()
Baud = "03"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud28800_Click()
Baud = "08"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud38400_Click()
Baud = "09"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud4800_Click()
Baud = "04"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud57600_Click()
Baud = "0A"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnBaud9600_Click()
Baud = "05"
ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnCH1_Click()
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch2.Text = Protocol
TxtSwitch3.Text = ""
TxtSwitch4.Text = ""
End Sub

Private Sub OptnCH1CH2_Click()
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch2.Text = Protocol

TxtSwitch3.Text = Baud & Result & "H"
TxtSwitch4.Text = Protocol
End Sub

Private Sub OptnCH2_Click()
TxtSwitch3.Text = Baud & Result & "H"
TxtSwitch4.Text = Protocol
TxtSwitch1.Text = ""
TxtSwitch2.Text = ""
End Sub

Private Sub OptnCheckEven_Click()
CheckB3 = "1"

ResultLow = CheckB3 & ParityB2 & DataBitB1 & OperationB0

ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnCheckODD_Click()
CheckB3 = "0"
ResultLow = CheckB3 & ParityB2 & DataBitB1 & OperationB0

ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnChgSetDis_Click()
ChangeSettingB7 = "0"
ResultHi = ChangeSettingB7 & WriteRunB6 & CheckSumB5 & StopBitB4

ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnChgSetEn_Click()
ChangeSettingB7 = "1"
ResultHi = ChangeSettingB7 & WriteRunB6 & CheckSumB5 & StopBitB4

ResultHexLow = Str4BinToHex(ResultLow)
ResultHexHi = Str4BinToHex(ResultHi)
Result = ResultHexHi & ResultHexLow

If OptnCH1.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
End If

If OptnCH2.Value = True Then
TxtSwitch3.Text = Baud & Result & "H"
End If

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -