Handle einer SPS-Variablen löschen
In diesem Beispiel wird gezeigt, wie das Handle einer SPS-Variablen gelöscht werden kann:
Visual Basic 6 Programm
Dim handle As Long
'--- Is called at the start ---
Private Sub Form_Load()
txtHandle.Text = handle
End Sub
' --- Is called when "Get Handle" is pressed ---
Private Sub btnGetHandle_Click()
Call AdsOcx1.AdsCreateVarHandle("MAIN.PLCVar", handle)
txtHandle.Text = handle
End Sub
' --- Is called when "Release Handle" is pressed ---
Private Sub btnReleaseHandle_Click()
Call AdsOcx1.AdsDeleteVarHandle(handle)
handle = 0
txtHandle.Text = handle
End Sub
Sprache / IDE | Beispielprogramm auspacken |
---|---|
Visual Basic 6 |