VBA Code Controlling PLC Tags in Studio 5000 Through FactoryTalk View Studio Site Edition
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
Subscribe: mmini.me/Subscribe-4-Updates
Other socials:
Facebook: facebook.com/OnlinePLCSupport
LinkedIn: www.linkedin.com/in/shane-welcher-sr/
🎉❤
Excellent Video and clearly explained
Thank you
👏👏👏👏👏👏👏👏
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
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
@@ShaneWelcher thanks sir, I will search for your structured text videos, regards
How can i read FTView SCADA user in Controller tag?
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.
Can this be used to write values into PLC tags using a ComboBox??
VBA can be used in many ways, let me know what you want to learn from