FSEIPEL
Member
I'm trying to update our antiquated trending. I'm still relatively new to A/B having worked with it only for about a year. What I WANT is DeltaV Trendbuilder-like functionality, where operators can click on a tag on the screen, and add it to a plot with a single click, without needing to browse for it in the datalog. I am working on achieving this using the TrendX Wrapper control, since it can be manipulated programatically/dynamically. So I was able to add a pen using a command such as:
Invoke CustomTrend.RSView32RSTrendXWrapper1.Pens_Add("TE242","DescriptorForLegend","Units e.g. deg F",0,100,"Datalog9")
where CustomTrend = Screen Name, RSView32RSTrendXWrapper1 = ActiveX RSTREND Wrapper Object, TE242 = Tag, 0, 100 = min and max, and Datalog 9 = Datalog name.
I wanted my generic faceplate to display 'add to plot' and 'plot this tag alone' buttons. 'Add to plot' will of course, add that tag with whatever tags are already on the trend, when clicked. I can use
Invoke CustomTrend.RSView32RSTrendXWrapper1.Pens_RemoveAll to clear the pens before adding 1st pen so this isn't a problem either. I'm running on a dual-headed display (just updated project to handle that ourselves), so plot appears on lower screen, and operator graphics on upper screen.
Issues I am having:
1.) How does one insert a double quote character? I realize this is a very basic question. Absent any guidance, best I could come up with, was to set a memory tag equal to double quotes, and then invoke with my placeholders, for instance, using
Invoke CustomTrend.RSView32RSTrendXWrapper1.Pens_Add($DQ$#1$DQ$,$DQ$#2$DQ$,$DQ$#3$DQ$,#4,#5,$DQ$#6$DQ$)
where DQ = tag set to double quotes. Is there a better way? This works but is hard to read. Above call is that made by the button you click on the faceplate of a given tag to add it to trend.
2.) This doesn't exactly relate to plotting, but since we programmed two sets of screens, faceplates always open on first monitor, is there a way to automatically determine which monitor a user is on and open screen on that monitor or must we hard-code it for each screen using DISPLAY with the coordinate parameters?
3.) Even with quotes, I still can't seem to use spaces in legends. I can use underscores, but any spaces in the channel descriptors causes the Invoke to fail. Can one pass spaces, and if so, how do you experts do it?
4.) I'd like legend to appear at bottom of plot. I'm not a total idiot and realize how to set this in the properties. However, with the wrapper control, the legend shows up at the bottom, instead of top left, but as soon as I save document, it moves to top left! Can I set this programatically with INVOKE, LOAD a template with screen, or some other workaround? Or is there something obvious I'm missing?
5.) I've been experimenting with other plotting solutions; I have a large datalog logging to a SQL server. It dumps ~350 points every minute. I can then query them in Excel and have Excel generate an HTML file to allow me to view the data using the open source dygraphs library allowing panning and zooming & turning trends on and off. I'd like to move this completely to a webserver & was wondering if anyone had done that before, e.g. select tag names & have it plot them with dygraphs? I don't have much experience executing the SQL query in a web scripting language but I can probably cobble something together... But if it's been done before, I'll take your code!
I've also been learning how to use my old 1756-eWeb card. I was able to write an Excel VBA function to retrieve the present value of any tag when passed the tag name and it works great, albeit it isn't terribly fast. Has anyone made any updates/upgrades to the 1756 Data Toolkit they'd be willing to share?
Invoke CustomTrend.RSView32RSTrendXWrapper1.Pens_Add("TE242","DescriptorForLegend","Units e.g. deg F",0,100,"Datalog9")
where CustomTrend = Screen Name, RSView32RSTrendXWrapper1 = ActiveX RSTREND Wrapper Object, TE242 = Tag, 0, 100 = min and max, and Datalog 9 = Datalog name.
I wanted my generic faceplate to display 'add to plot' and 'plot this tag alone' buttons. 'Add to plot' will of course, add that tag with whatever tags are already on the trend, when clicked. I can use
Invoke CustomTrend.RSView32RSTrendXWrapper1.Pens_RemoveAll to clear the pens before adding 1st pen so this isn't a problem either. I'm running on a dual-headed display (just updated project to handle that ourselves), so plot appears on lower screen, and operator graphics on upper screen.
Issues I am having:
1.) How does one insert a double quote character? I realize this is a very basic question. Absent any guidance, best I could come up with, was to set a memory tag equal to double quotes, and then invoke with my placeholders, for instance, using
Invoke CustomTrend.RSView32RSTrendXWrapper1.Pens_Add($DQ$#1$DQ$,$DQ$#2$DQ$,$DQ$#3$DQ$,#4,#5,$DQ$#6$DQ$)
where DQ = tag set to double quotes. Is there a better way? This works but is hard to read. Above call is that made by the button you click on the faceplate of a given tag to add it to trend.
2.) This doesn't exactly relate to plotting, but since we programmed two sets of screens, faceplates always open on first monitor, is there a way to automatically determine which monitor a user is on and open screen on that monitor or must we hard-code it for each screen using DISPLAY with the coordinate parameters?
3.) Even with quotes, I still can't seem to use spaces in legends. I can use underscores, but any spaces in the channel descriptors causes the Invoke to fail. Can one pass spaces, and if so, how do you experts do it?
4.) I'd like legend to appear at bottom of plot. I'm not a total idiot and realize how to set this in the properties. However, with the wrapper control, the legend shows up at the bottom, instead of top left, but as soon as I save document, it moves to top left! Can I set this programatically with INVOKE, LOAD a template with screen, or some other workaround? Or is there something obvious I'm missing?
5.) I've been experimenting with other plotting solutions; I have a large datalog logging to a SQL server. It dumps ~350 points every minute. I can then query them in Excel and have Excel generate an HTML file to allow me to view the data using the open source dygraphs library allowing panning and zooming & turning trends on and off. I'd like to move this completely to a webserver & was wondering if anyone had done that before, e.g. select tag names & have it plot them with dygraphs? I don't have much experience executing the SQL query in a web scripting language but I can probably cobble something together... But if it's been done before, I'll take your code!
I've also been learning how to use my old 1756-eWeb card. I was able to write an Excel VBA function to retrieve the present value of any tag when passed the tag name and it works great, albeit it isn't terribly fast. Has anyone made any updates/upgrades to the 1756 Data Toolkit they'd be willing to share?