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

2 years ago
24

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:
https://www.allen-bradley-plc-training.com/

Other social media:
LinkedIn: https://www.linkedin.com/in/shane-welcher-sr/
Facebook: https://www.facebook.com/OnlinePLCSupport

#VBAcode #ExposeToVBA #VBAcontrol #FactoryTalk

Loading comments...