Unable to import vwin file

I’m trying to import the “Click to Graph” files into our Ignition project and the only thing I can’t do is import the ctg.vwin file. I’ve tried this with version 8.0.3, 8.0.4 RC1 and the current nightly 8.0.5 as of today, but no difference.

I’m importing as instructed, where I right click on the “Windows” menu section under Vision in the Designer, > Import > change “Files of Type:” to “All files” (to see the vwin), select “ctg.vwin”, and click open, but nothing imports and no errors. Any ideas? Thanks

We dropped some legacy upgrade code in 8.0 - you should be able to import the .vwin files into a 7.9 Designer, then export them as 7.9 .proj files, and import those into 8.0. It’s not ideal, but minimizing the number of possible inputs lets us simplify our code (and eliminate a lot of bugs).

Generally speaking, in this specific case, the ‘Click to Graph’ files are replaceable with the ‘Ad-Hoc Trending’ template created by our sales engineering department that’s available via the Cloud Template Browser in the designer.

1 Like

I’ve been checking out the AdHoc Trend template, but the problem is that it basically uses a tag dropping instead of being able to click on what you visually see on screen to be able to trend, which would be more intuitive. We have around 200 locations with tens of thousands of tags, and would be very difficult for an operator to go through the tree to find what they need, even if they performed a search. A modern click to graph would seem to be a better option. I’ll will install a version 7.9 somewhere and convert the “Click to Graph” files to see if we can do anything with it.

1 Like

There is a way to have the AdHoc load a single tag.
Create a custom method called LoadSingleTag on the Easy Chart inside of the AdHoc Template called
LoadSingleTag with a parameter called path
Then put this code in it


	#clear chart pens
	self.parent.getComponent('Chart Pens Table').deleteAll()
	
	#clear table pens
	pens = self.parent.getComponent('Easy Chart').tagPens
	pens = system.dataset.deleteRows(pens, range(0, pens.rowCount))
	self.parent.getComponent('Easy Chart').tagPens = pens
	
	#clear engUnitsAxes template property
	engUnitsAxes = self.parent.engUnitsAxes
	engUnitsAxes = system.dataset.deleteRows(engUnitsAxes, range(0, engUnitsAxes.rowCount))
	self.parent.engUnitsAxes = engUnitsAxes
	
	#refresh Chart Pens Table
	self.parent.getComponent('Chart Pens Table').columnAttributesData = self.parent.getComponent('Chart Pens Table').columnAttributesData
	#refresh Axes Table
	self.parent.getComponent('Axes Container').getComponent('Axes Table').data = self.parent.getComponent('Easy Chart').axes
	#deselect modes
	self.parent.getComponent('Axis').deselect()
	self.parent.getComponent('Single Axis').deselect()
	if path != '':
		historyProvider = None
		tagProvider = None
		tagPath = None
		
		if path.find("histprov:") > -1:
			splitPath = path.split(":/")
			for pathPart in path:
				pathPartType = pathPart.split(":")[0]
				pathPartValue = pathPart.split(":")[1]
				
				if pathPartType == "tag":
					tagPath = pathPartValue
				elif pathPartType == "histprov":
					historyProvider = pathPartValue
				elif pathPartType == "prov":
					tagProvider = pathPartValue
		else:
			splitPath = path.split("]")
			historyProvider = splitPath[0][1:].split("/")[0]
			tagProvider = splitPath[0][1:].split("/")[1].split(":")[1]
			tagPath = splitPath[1]
		self.parent.addPen(path, tagPath, tagProvider, 3,path.split("]")[1])

Create a custom property on the root of AdHoc Template called TagToLoad as a string

In the PropertyChange event of the Adhoc Template put the following code

if event.propertyName=='componentRunning':
	if len(event.source.TagToLoad)>0:
		tp = str(event.source.TagToLoad)
		event.source.getComponent('Easy Chart').LoadSingleTag(tp)

Then on whatever window you have the template on, create a custom property called singleTag as a string, and bind the TagToLoad custom property on the template to that custom property.

Now when you call the window just pass it a full historian tag path and it will load the single value.

> window = system.nav.openWindow('Trending/Historical Trend', {'singleTag' : '[TagSource/ServerName:default]Path/To/Your/Trend/Tag'})
> system.nav.centerWindow(window)

Just whipped this up so it might be a bit buggy but is working in testing.
You will also probably want to blank TagToLoad on close of the template.

1 Like

Does this just work on one tag, is it possible or much work involved to do on multiple tags, something like iterating through a “selection” of tags from numeric labels? Thanks for the detailed help.

Yes it would, just pass them as a dataset or comma separated and then do a for loop around the bottom part adding each tag to the chart dataset,

We've gotten further, but have one issue. On a window that we are clicking the numeric labels with values, we have a button with a script that we then click that "trends" those values passing their paths to the ad-hoc trending popup window (which has the ad-hoc trend template). However, we get the following error when clicking on the button:

Traceback (most recent call last):
File "event:actionPerformed", line 78, in
AttributeError: 'com.inductiveautomation.factorypmi.application.com' object has no attribute 'LoadTagList'

LoadTagList is a custom method in the Template Ad-Hoc Trend, and we believe we are unable to reach it with this code in the button script:

window = system.nav.openWindow('Popups/Trend Chart',{'GraphTagPath' : '[Path\to\tag\omited'})
system.nav.centerWindow(window)
tp = str(event.source.parent.GraphList)
window.getRootContainer().getComponent('AdHoc Trend').getComponent(0).getComponent('Easy Chart').LoadTagList(tp)

Are we using the right syntax to get from a button to pass tag paths to a popup window that houses the ah-hoc trend template?