Adding a Pen during runtime using vba

DanK99

Member
Join Date
Aug 2012
Location
Appleton
Posts
13
I have been scouring the forum and I am very sorry if I accidentally missed the answer already. First of all, I am using FactoryTalk View SE for my HMI. But my question is how to add a Pen to a trend (using a push button or something) during runtime. I figured this probably needs to be done using vba, but other solutions are welcome. I found Trend.Pens.Add() but when I try that I get an error stating that I have an invalid argument option. I figure this is the function that I need to use, but do I need to make a pen type and add that, or make a tag type variable and add that. "Add" wants a string, and I tried just using the string that I would place in the "expression" field when adding a pen in the studio, but I get an error that way as well. Any help would be great! Sorry if I neglected to provide any information, just let me know and I will update. Thank you!

-Dan
 
Going from memory here and I'll try to dig out the application where I used it when I get home..

Trend.Pens.Add("SOMETAG", "MyPenName")

...maybe..it's been a while :s
 
Thank you for the quick response randomFire. I tried: Trend.Pens.Add("SOMETAG", "MyPenName")
and when I hit enter for a new line, i get an error saying that it expected an equal sign
So then I took away the parentheses and I didn't get that error. However, when I ran the client to test it out, I got an error that said "VBA Code has been halted. Reason: Compile error - Argument not optional"
 
OK good news, I got it to work. I ended up having to provide a minimum and a maximum for it, but now it works properly. Thank you randomFire for pointing me in the right direction
 

Similar Topics

Hi, I need help adding a new interlock switch to an existing circuit. I have never done on the existing circuit. I did set it up on the...
Replies
6
Views
290
Hi all I’m looking at adding a RFID card reader to comfort panel pro , how do you set the rfid up can you connect to existing users and password...
Replies
0
Views
100
Hello all! So I have one project with a S7-1214 and a MTP1500 "Project1" and one project with another S7-1214 "Project2". Both of these PLC:s need...
Replies
6
Views
169
Hi Everyone, Currently we have three plants running with Controllogix PLCs (L72, L73, L74). In each of these plants we have 2 FTView SE...
Replies
0
Views
127
Hello, Im building project with 1756-L82ES controller and 1756-IB16S card but i cant find it when trying to add the card to IO configuration...
Replies
3
Views
208
Back
Top Bottom