Factory Talk View Studio VBA for Private Sub ComboBox_DropButtonClick()

prakasha

Member
Join Date
Dec 2022
Location
Davangere, Karnataka, India
Posts
75
Hi I hope all are doing good

I have some doubt on FTV VBA coding for Drop down list. I wanted to know how to build a VBA code for Drop down list selection in SCADA. Pleaselet me know if anybody online.
 
Private Sub ComboBox2_DropButtonClick()
ComboBox3.List = Array("Renukaiah", "Savithramma", "Kotresh", "Dharani", "Sanvi", "Prakash", "Ramya", "yashas")
ComboBox4.List = Array("Renukaiah", "Savithramma", "Kotresh", "Dharani", "Sanvi", "Prakash", "Ramya", "yashas")
ComboBox5.List = Array("Renukaiah", "Savithramma", "Kotresh", "Dharani", "Sanvi", "Prakash", "Ramya", "yashas")
ComboBox6.List = Array("Renukaiah", "Savithramma", "Kotresh", "Dharani", "Sanvi", "Prakash", "Ramya", "yashas")
ComboBox7.List = Array("Renukaiah", "Savithramma", "Kotresh", "Dharani", "Sanvi", "Prakash", "Ramya", "yashas")
ComboBox8.List = Array("Renukaiah", "Savithramma", "Kotresh", "Dharani", "Sanvi", "Prakash", "Ramya", "yashas")
End Sub

These are the sample code I have written in VBA but I am not getting how to implement in FTV
 
I'm not a VBA guy, but I was able to go back to a project that used the ComboBox as created by our VBA expert. The key for you might be:

Application.ExecuteCommand (<however you pass the ComboBox click to this command>)

In my project it was Application.ExecuteCommand ("Display /DS::" & file), where 'file' was a variable holding the name of the .gfx file. There was automation that looked for patterns in .gfx file names within Area "DS" and got that data into "file"...so way more complicated than it seems you are doing. FWIW...
 
I really don't use VBA very often, but I used a drop down box to allow an operator to select a display. This is the short version of the code we used

The top part lists the actions to be taken and the bottom section defines the text that appears in the combo box.

Code:
Private Sub ComboBox1_Change()

If ComboBox1.Text = "Main Menu" Then Application.ShowDisplay "Main Menu"

If ComboBox1.Text = "Maintenance" Then Application.ShowDisplay "Maintenace"
    
If ComboBox1.Text = "Login" Then Application.ShowDisplay "Login"

End Sub

Private Sub Display_AnimationStart()

ComboBox1.Clear
ComboBox1.AddItem "Main Menu"
ComboBox1.AddItem "Maintenance"
ComboBox1.AddItem "Login"

End Sub

OG
 

Similar Topics

I am using Factory Talk view Machine Edition Runtime HMI. I want to configure on button in such way that when i press this button I want to...
Replies
3
Views
113
Hi all, Attached below is an example of what is happening to our existing SCADA. It seems after patching some Rockwell Software that I thought...
Replies
9
Views
326
The client has an application that when communication between the PLC and the Factory Talk VIEW supervisory fails, the object in the supervisory...
Replies
5
Views
290
Hello all, I am looking for a way to have a user get logged out after an X amount of time because to default so that user privilages are no...
Replies
4
Views
593
Hello everybody. I was wondering if there is a way in FTVIEW Studio to close ) view after x min without interaction . My issue is the following...
Replies
2
Views
369
Back
Top Bottom