VBA Code Controlling PLC Tags in Studio 5000 Through FactoryTalk View Studio Site Edition

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • Using VBA code in FactoryTalk View Studio to control PLC tags in Studio 5000. This video is just an example of a best practice to get VBA to communicate to a PLC processor but is not limited to just this one example.
    Treat this video as an eye-opener of many different applications that you could use this technique.
    Private Sub VBACodeTrigger_Change()
    On Error GoTo ErrorHandler
    If Not IsError(VBACodeTrigger.Value) Then
    If VBACodeTrigger.Value = 1 Then
    ExecuteCommand "VBAmacro"
    End If
    End If
    Exit Sub
    ErrorHandler:
    LogDiagnosticsMessage Err.Description, FTDiagSeverityError
    End Sub
    0:00 Example of VBA controlling PLC tags
    1:00 HMI memory tag for VBA control
    1:50 Adding a numeric display
    2:25 Reason we change the name of the numeric display
    2:50 Expose To VBA to VBA Control
    3:40 Adding an HMI button
    4:05 Using the &Set feature in button
    5:05 Ladder Logic Seal In Circuit For Testing
    7:11 Setting up FactoryTalk Linx shortcuts for HMI communications
    7:59 Making a Macro in FactoryTalk View Studio
    9:36 Opening VBA Code
    10:25 Writing the VBA Code
    14:46 Adding a second macro
    16:45 Testing the VBA code
    17:36 Creating an HMI Client for testing
    19:05 VBA Code Testing through the HMI Client
    20:30 Recommended videos for you
    I hope it helped.
    Thank you for watching the video.
    Learn, Implement, Succeed
    Visit:
    www.allen-bradley-plc-trainin...
    Other social media:
    LinkedIn: / shane-welcher-sr
    Facebook: / onlineplcsupport
    #VBAcode #ExposeToVBA #VBAcontrol #FactoryTalk

Komentáře • 12

  • @ShaneWelcher
    @ShaneWelcher  Před 2 lety +1

    Subscribe: mmini.me/Subscribe-4-Updates
    Other socials:
    Facebook: facebook.com/OnlinePLCSupport
    LinkedIn: www.linkedin.com/in/shane-welcher-sr/

  • @ArvindKumar-sz1pc
    @ArvindKumar-sz1pc Před 4 měsíci +1

    🎉❤

  • @muon537
    @muon537 Před rokem +1

    Excellent Video and clearly explained

  • @elizeusimoes490
    @elizeusimoes490 Před 2 lety +1

    👏👏👏👏👏👏👏👏

  • @philliptwin326
    @philliptwin326 Před 2 lety +2

    Have you ever programmed in CVI LabWindows? If yes, could you make a videos explaining how to do the communication with a PLC, please? Regards

    • @ShaneWelcher
      @ShaneWelcher  Před 2 lety +1

      Actually no, I just looked into this for you & it seems like a script editor type software.
      Best to learn structured to if so.
      I have structured text videos

    • @philliptwin326
      @philliptwin326 Před 2 lety

      @@ShaneWelcher thanks sir, I will search for your structured text videos, regards

  • @ashishkhare3070
    @ashishkhare3070 Před rokem +1

    How can i read FTView SCADA user in Controller tag?

    • @ShaneWelcher
      @ShaneWelcher  Před rokem

      If you are referring to the computer name then watch this video.
      czcams.com/video/g_RYAJkaMww/video.html
      If you are referring to the actual signed-in user then you will have to add a lot more code.

  • @EstebanLopez-ol6bg
    @EstebanLopez-ol6bg Před rokem +1

    Can this be used to write values into PLC tags using a ComboBox??

    • @ShaneWelcher
      @ShaneWelcher  Před rokem

      VBA can be used in many ways, let me know what you want to learn from