📄 flag.frm
字号:
VERSION 5.00
Begin VB.Form FLAG_FRM
Caption = "MERKER/FLAGS"
ClientHeight = 3645
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3645
ScaleWidth = 4680
StartUpPosition = 3 'Windows-Standard
Begin VB.TextBox ID_VALUE
Height = 375
Left = 2520
TabIndex = 14
Top = 1560
Width = 255
End
Begin VB.TextBox IDBITNO
Height = 375
Left = 1920
TabIndex = 10
Top = 1560
Width = 255
End
Begin VB.TextBox IDNO
Height = 375
Left = 1200
TabIndex = 9
Top = 1560
Width = 495
End
Begin VB.CommandButton IDBITTEST
Caption = "mb_bittest"
Height = 375
Left = 3120
TabIndex = 8
Top = 2280
Width = 1215
End
Begin VB.CommandButton IDRESETBIT
Caption = "mb_resetbit"
Height = 375
Left = 3120
TabIndex = 7
Top = 1680
Width = 1215
End
Begin VB.CommandButton IDSETBIT
Caption = "mb_setbit"
Height = 375
Left = 3120
TabIndex = 6
Top = 1080
Width = 1215
End
Begin VB.CommandButton IDCANCEL
Caption = "zur點k/cancel"
Height = 375
Left = 240
TabIndex = 0
Top = 3000
Width = 1335
End
Begin VB.Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Verbindung/connection"
Height = 615
Left = 600
TabIndex = 1
Top = 120
Width = 2415
Begin VB.OptionButton VERB
Caption = "1"
Height = 255
Index = 0
Left = 120
TabIndex = 5
Top = 240
Width = 495
End
Begin VB.OptionButton VERB
Caption = "2"
Height = 255
Index = 1
Left = 600
TabIndex = 4
Top = 240
Width = 495
End
Begin VB.OptionButton VERB
Caption = "3"
Height = 255
Index = 2
Left = 1200
TabIndex = 3
Top = 240
Width = 495
End
Begin VB.OptionButton VERB
Caption = "4"
Height = 255
Index = 3
Left = 1800
TabIndex = 2
Top = 240
Width = 495
End
End
Begin VB.Label Label3
Caption = "="
Height = 255
Left = 2280
TabIndex = 13
Top = 1680
Width = 135
End
Begin VB.Label Label2
Caption = "Merker/Flag"
Height = 255
Left = 120
TabIndex = 12
Top = 1560
Width = 975
End
Begin VB.Label Label1
Caption = "."
Height = 375
Left = 1800
TabIndex = 11
Top = 1680
Width = 135
End
End
Attribute VB_Name = "FLAG_FRM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Activate()
VERB(VerbIdx).value = True
End Sub
Private Sub IDBITTEST_Click()
Dim msg
Static value As Byte
On Error GoTo error_handler
no = IDNO.Text
bitno = IDBITNO.Text
res = new_ss(VerbIdx + 1)
If (res = 0) Then
#If S7_300 Then
res = mb_bittest(no, bitno, value)
#End If
#If S7_200 Then
res = as200_mb_bittest(no, bitno, value)
#End If
End If
ID_VALUE.Text = value
If (res <> 0) Then
ERROR_FRM.Show 1, Me
ID_VALUE.Text = ""
End If
Exit Sub
error_handler:
IDNO.Text = no
IDBITNO.Text = bitno
msg = "value not correct"
MsgBox msg
Resume Next
End Sub
Private Sub IDCANCEL_Click()
FLAG_FRM.Visible = False
End Sub
Private Sub IDRESETBIT_Click()
Dim msg
Static value As Byte
On Error GoTo error_handler
no = IDNO.Text
bitno = IDBITNO.Text
res = new_ss(VerbIdx + 1)
If (res = 0) Then
#If S7_300 Then
res = mb_resetbit(no, bitno)
#End If
#If S7_200 Then
res = as200_mb_resetbit(no, bitno)
#End If
ID_VALUE.Text = 0
End If
If (res <> 0) Then
ERROR_FRM.Show 1, Me
ID_VALUE.Text = ""
End If
Exit Sub
error_handler:
IDNO.Text = no
IDBITNO.Text = bitno
msg = "value not correct"
MsgBox msg
Resume Next
End Sub
Private Sub IDSETBIT_Click()
Dim msg
Static value As Byte
On Error GoTo error_handler
no = IDNO.Text
bitno = IDBITNO.Text
res = new_ss(VerbIdx + 1)
If (res = 0) Then
#If S7_300 Then
res = mb_setbit(no, bitno)
#End If
#If S7_200 Then
res = as200_mb_setbit(no, bitno)
#End If
ID_VALUE.Text = 1
End If
If (res <> 0) Then
ERROR_FRM.Show 1, Me
ID_VALUE.Text = ""
End If
Exit Sub
error_handler:
IDNO.Text = no
IDBITNO.Text = bitno
msg = "value not correct"
MsgBox msg
Resume Next
End Sub
Private Sub VERB_Click(Index As Integer)
VerbIdx = Index
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -