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

📄 melsecqsw.frm

📁 MelsecQ Serial communication Switch setting
💻 FRM
📖 第 1 页 / 共 3 页
字号:
If OptnCH1CH2.Value = True Then
TxtSwitch1.Text = Baud & Result & "H"
TxtSwitch3.Text = Baud & Result & "H"
End If

End Sub

Private Sub OptnData8_Click()

DataBitB1 = "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 OptnFt1_Click()
Protocol = "0001H"

OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If


End Sub

Private Sub OptnFt2_Click()
Protocol = "0002H"
OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If


End Sub

Private Sub OptnFt3_Click()
Protocol = "0003H"

OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If


End Sub

Private Sub OptnFt4_Click()
Protocol = "0004H"

OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If


End Sub

Private Sub OptnFt5_Click()
Protocol = "0005H"

OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If


End Sub

Private Sub OptnNoProt_Click()
Protocol = "0006H"

OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If


End Sub

Private Sub OptnParityNo_Click()

ParityB2 = "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 OptnParityYes_Click()
ParityB2 = "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 OptnProtBi_Click()
Protocol = "0007H"

OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If


End Sub

Private Sub OptnProtLink_Click()
Protocol = "0008H"

OpnLinK.Enabled = True
OpnData7.Enabled = True
OptnParityNo.Enabled = True
OptnCheckEven.Enabled = True

OptnStop2.Enabled = True
OptnSumNo.Enabled = True
OptnWriteRunDis.Enabled = True
OptnChgSetDis.Enabled = True


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If

End Sub

Private Sub OptnProtocelGx_Click()
Protocol = "0000H"

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

OpnLinK.Enabled = False
OpnData7.Enabled = False
OptnParityNo.Enabled = False
OptnCheckEven.Enabled = False

OptnStop2.Enabled = False
OptnSumNo.Enabled = False
OptnWriteRunDis.Enabled = False
OptnChgSetDis.Enabled = False


If OptnCH1.Value = True Then
TxtSwitch2.Text = Protocol
End If
If OptnCH2.Value = True Then
TxtSwitch4.Text = Protocol
End If
If OptnCH1CH2.Value = True Then
TxtSwitch2.Text = Protocol
TxtSwitch4.Text = Protocol
End If

End Sub

Private Sub OptnStop1_Click()
StopBitB4 = "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 OptnStop2_Click()
StopBitB4 = "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

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

End Sub

Private Sub OptnSumNo_Click()
CheckSumB5 = "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 OptnSumYes_Click()
CheckSumB5 = "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

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

End Sub

Private Sub OptnWriteRunDis_Click()
WriteRunB6 = "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 OptnWriteRunEn_Click()
WriteRunB6 = "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

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

End Sub

Function Str4BinToHex(ByVal temp As String) As String
Dim tempf As String
tempf = Trim(temp)

If tempf = "0000" Then
Str4BinToHex = "0"
End If

If tempf = "0001" Then
Str4BinToHex = "1"
End If

If tempf = "0010" Then
Str4BinToHex = "2"
End If

If tempf = "0011" Then
Str4BinToHex = "3"
End If

If tempf = "0100" Then
Str4BinToHex = "4"
End If

If tempf = "0101" Then
Str4BinToHex = "5"
End If

If tempf = "0110" Then
Str4BinToHex = "6"
End If

If tempf = "0111" Then
Str4BinToHex = "7"
End If

If tempf = "1000" Then
Str4BinToHex = "8"
End If

If tempf = "1001" Then
Str4BinToHex = "9"
End If

If tempf = "1010" Then
Str4BinToHex = "A"
End If

If tempf = "1011" Then
Str4BinToHex = "B"
End If

If tempf = "1100" Then
Str4BinToHex = "C"
End If

If tempf = "1101" Then
Str4BinToHex = "D"
End If

If tempf = "1110" Then
Str4BinToHex = "E"
End If

If tempf = "1111" Then
Str4BinToHex = "F"
End If

End Function

⌨️ 快捷键说明

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