📄 load.frm
字号:
VERSION 5.00
Begin VB.Form LOAD_FRM
Caption = "LOAD"
ClientHeight = 4740
ClientLeft = 1650
ClientTop = 1470
ClientWidth = 3690
LinkTopic = "LOAD"
ScaleHeight = 4740
ScaleWidth = 3690
Begin VB.CommandButton IDCANCEL
Caption = "zur點k/cancel"
Height = 375
Left = 360
TabIndex = 7
Top = 4200
Width = 1335
End
Begin VB.CommandButton IDOK
Caption = "鰂fnen/open"
Height = 375
Left = 2040
TabIndex = 6
Top = 4200
Width = 1215
End
Begin VB.Frame Frame2
Caption = "LOAD"
Height = 2535
Left = 480
TabIndex = 5
Top = 1320
Width = 2415
Begin VB.TextBox SLOTNO
Height = 285
Left = 1440
TabIndex = 11
Top = 1920
Width = 735
End
Begin VB.TextBox SEGMENTID
Height = 285
Left = 1440
TabIndex = 10
Top = 960
Width = 735
End
Begin VB.TextBox RACKNO
Height = 285
Left = 1440
TabIndex = 9
Top = 1440
Width = 735
End
Begin VB.TextBox STATIONADR
Height = 285
Left = 1440
TabIndex = 8
Top = 480
Width = 735
End
Begin VB.Label Label4
Caption = "slot no"
Height = 255
Left = 240
TabIndex = 15
Top = 1920
Width = 855
End
Begin VB.Label Label3
Caption = "rack no"
Height = 255
Left = 240
TabIndex = 14
Top = 1440
Width = 975
End
Begin VB.Label Label2
Caption = "segment id"
Height = 255
Left = 240
TabIndex = 13
Top = 960
Width = 975
End
Begin VB.Label Label1
Caption = "station adr"
Height = 255
Left = 240
TabIndex = 12
Top = 480
Width = 975
End
End
Begin VB.OptionButton VERB
Caption = "4"
Height = 255
Index = 3
Left = 2280
TabIndex = 3
Top = 600
Width = 495
End
Begin VB.OptionButton VERB
Caption = "3"
Height = 255
Index = 2
Left = 1680
TabIndex = 2
Top = 600
Width = 495
End
Begin VB.OptionButton VERB
Caption = "2"
Height = 255
Index = 1
Left = 1080
TabIndex = 1
Top = 600
Width = 495
End
Begin VB.OptionButton VERB
Caption = "1"
Height = 255
Index = 0
Left = 600
TabIndex = 0
Top = 600
Width = 495
End
Begin VB.Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Verbindung/connection"
Height = 615
Left = 480
TabIndex = 4
Top = 360
Width = 2415
End
End
Attribute VB_Name = "LOAD_FRM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
STATIONADR.Text = plcadr(0).adr
SEGMENTID.Text = plcadr(0).SEGMENTID
RACKNO.Text = plcadr(0).RACKNO
SLOTNO.Text = plcadr(0).SLOTNO
VerbIdx = 0
End Sub
Private Sub Form_Activate()
VERB(VerbIdx).value = True
End Sub
Private Sub IDCANCEL_Click()
LOAD_FRM.Visible = False
End Sub
Private Sub IDOK_Click()
VerbIdx = 0
res = load_tool(1, "S7ONLINE", plcadr(0))
If (res <> 0) Then ERROR_FRM.Show 1, Me
LOAD_FRM.Visible = False
End Sub
Private Sub RACKNO_Change()
Dim msg
On Error GoTo error_handler
plcadr(VerbIdx).RACKNO = RACKNO.Text
Exit Sub
error_handler:
RACKNO.Text = plcadr(VerbIdx).RACKNO
msg = "value not correct"
MsgBox msg
Resume Next
End Sub
Private Sub SEGMENTID_Change()
Dim msg
On Error GoTo error_handler
plcadr(VerbIdx).SEGMENTID = SEGMENTID.Text
Exit Sub
error_handler:
SEGMENTID.Text = plcadr(VerbIdx).SEGMENTID
msg = "value not correct"
MsgBox msg
Resume Next
End Sub
Private Sub SLOTNO_Change()
Dim msg
On Error GoTo error_handler
plcadr(VerbIdx).SLOTNO = SLOTNO.Text
Exit Sub
error_handler:
SLOTNO.Text = plcadr(VerbIdx).SLOTNO
msg = "value not correct"
MsgBox msg
Resume Next
End Sub
Private Sub STATIONADR_Change()
Dim msg
On Error GoTo error_handler
plcadr(VerbIdx).adr = STATIONADR.Text
Exit Sub
error_handler:
STATIONADR.Text = plcadr(VerbIdx).adr
msg = "value not correct"
MsgBox msg
Resume Next
End Sub
Private Sub VERB_Click(Index As Integer)
VerbIdx = Index
STATIONADR.Text = plcadr(Index).adr
SEGMENTID.Text = plcadr(Index).SEGMENTID
RACKNO.Text = plcadr(Index).RACKNO
SLOTNO.Text = plcadr(Index).SLOTNO
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -