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

📄 exampleslave.bas

📁 PLC相关-656M.zip
💻 BAS
字号:
Attribute VB_Name = "ExampleSlave"
Option Explicit


Public Sub AllSlaveData(Sla As S7Slave)
Dim str As String

On Error Resume Next
    str = "Name: " & Sla.Name & Chr(13) & _
        "Logical Path: " & Sla.LogPath & Chr(13) & _
        "MLFB: " & Sla.MLFB & Chr(13) & _
        "Index: " & Sla.Index & Chr(13) & _
        "PROFIBUSAddress: " & Sla.PROFIBUSAddress & Chr(13)
    If CatchError Then Exit Sub

    str = str & "Anzahl LocalInAddresses: "
    str = str & Sla.LocalInAddresses.count & Chr(13)
    If CatchError(False) Then
        str = str & "Nothing" & Chr(13)
    End If
    
    str = str & "Anzahl Modules: " & Sla.Modules.count & Chr(13)
    
    str = str & "Anzahl TerminalBlocks: " & Sla.TerminalBlocks.count & Chr(13)
    If CatchError(False) Then
        str = str & "Anzahl TerminalBlocks: Nothing" & Chr(13)
    End If
            
    MsgBox str, vbInformation, "Daten des Slaves " & Sla.Name
End Sub


Public Sub ExampleSlave1()
    Dim SubS As S7SubSystem
    Dim Sla As S7Slave
    Dim dlg As New AttributesDlg
    
    ' Ermittle das SubSystem 1 der Station "relativity"
On Error Resume Next
    Set SubS = S.Projects("reptiles").Stations("relativity").SubSystems(1)
    If CatchError Then
        MsgBox "Es wird das Project 'Reptiles' und die Station " _
            & "'Relativity' benoetigt. Au遝rdem mu

⌨️ 快捷键说明

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