You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 21st, 2016, 01:33 PM   #1
phuz
Member
United States

phuz is offline
 
Join Date: Jun 2008
Location: Mohnton, PA
Posts: 777
Writing to HMI Tags in VBA (FactoryTalk View SE)

Is this example really the easiest way to write to an HMI tag in VBA?
I've been playing with this for a couple hours and so far this is the only thing I can get to actually work.

Code:
Public WithEvents MyGroup As TagGroup
Public oTag As Tag

Private Sub Display_AnimationStart()
Set MyGroup = Application.CreateTagGroup(Me.AreaName)
MyGroup.Add ("MyHMITag")
Set oTag = MyGroup.Item("MyHMITag")
oTag.Value = 0
End Sub
Even in IFIX this can be accomplished with a single line of:
writevalue 1, "Node.tagname.F_CV"
  Reply With Quote
Old April 21st, 2016, 05:02 PM   #2
AshleyParr
Member
United Kingdom

AshleyParr is offline
 
AshleyParr's Avatar
 
Join Date: Dec 2008
Location: Midlands, UK
Posts: 177
Yeh pretty much, there's a few threads on this with how different people have done this. But basically your stuck with that!

Ash
  Reply With Quote
Old April 21st, 2016, 05:21 PM   #3
phuz
Member
United States

phuz is offline
 
Join Date: Jun 2008
Location: Mohnton, PA
Posts: 777
Ouch! For shame, Rockwell.
  Reply With Quote
Old April 21st, 2016, 06:01 PM   #4
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,693
That's actually about the best, neatest, most streamlined version of "how to write a tag in FTView SE with VBA" I've seen yet
  Reply With Quote
Old August 10th, 2018, 09:42 AM   #5
Tanquen
Member
United States

Tanquen is offline
 
Join Date: Jul 2014
Location: CA
Posts: 88
I was looking for a way to write to tags and also how to in a popup with parameters and found the ExecuteCommand function. It seems to work.

Code:
Private Sub Button_Released()
    Dim TagName As String
    Dim sCmd As String
  
    TagName = Me.TagParameters(1)
        
    sCmd = "Toggle {" & TagName & "}"
    Me.Application.ExecuteCommand sCmd
End Sub
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
FactoryTalk View SE View Client smohamed LIVE PLC Questions And Answers 11 June 14th, 2015 11:19 PM
FactoryTalk View SE Tags value in Excel bansodevb LIVE PLC Questions And Answers 0 June 13th, 2012 12:03 PM
Redundant HMI Server FactoryTalk SE Issue josh_d LIVE PLC Questions And Answers 2 March 15th, 2012 07:06 AM
indirect referencing of PLC tags in Factorytalk (V 6.0) HMI makarand LIVE PLC Questions And Answers 1 March 6th, 2012 10:32 AM
Running FactoryTalk View SE V5.0 to work with FactoryTalk Service Platform 2.40 ? alpine LIVE PLC Questions And Answers 15 December 15th, 2011 07:49 PM


All times are GMT -5. The time now is 08:25 AM.


.