[Bug 15520] OPC-HDA Data in a Perspective Chart

I’m trying to pull data out of a PI historical system to use in a perspective Time Series or XY Chart. I’m having a hard time getting it cooperate since I can’t browse the HDA sources under the tag history tab on the bindings.

What I did manage to do was make use the system.tag.queryTagHistory command with the HDA provider and got a dataset back that was like 500 rows and 2 columns (Timestamp and value great news!). I thought I was off to a good start so I built a generic script you feed the PI tag path back and it pulls the history into a dataset.

Then I went to bind this to the time series chart and was met with an error…The dataset pulls in correctly but I was met with a blank chart and my dataset example object was changed into a value:Dataset[2108x2]. So now my question is: How do you bind datasets to play nicely with the new perspective charts?

Can I also request a feature to add HDA browsing back to the Tag History binding like in vision?

image

image

You need to change the xAxes, yAxes, and series props to match your incoming data

Hi @Tbthomps, I was wondering if you were able to make this work?

I’m working on the exact same issue right now… existing GE Proficy Historian connected via OPC-HDA, but I’m also struggling to bring this data into Perspective.

I second the request to add an OPC-HDA browsing feature into Perspective!

It’s on the list - probably fairly soon.

3 Likes

To help anyone in future, I solved my issue, although I’m not sure if this is the same issue @Tbthomps had above.

I was also able to bind an OPC-HDA historical tag dataset to the time-series chart and when previewing the dataset it displayed all the correct time stamps and values, but the chart was still blank (I double checked my chart config multiple times).

I finally found the issue was the dataset header name for the tag value column. The OPC-HDA server tags contained “.” (periods) in the tagname. Apparently Ignition datasets don’t like this. I added some script to change any “.” to “_” and the chart showed up immediately.

Here’s an example of the script:

    endTime = system.date.now()
	startTime = system.date.addMinutes(endTime, -1)
	dataSet = system.tag.queryTagHistory(paths=['[Matrikon]Random.Real4'], startDate=startTime, endDate=endTime, returnSize=1, aggregationMode="Maximum", returnFormat='Wide')
	
	headersIn = system.dataset.getColumnHeaders(dataSet)	#get all column headers
	headersOut = [h.replace('.', '_') for h in headersIn]	#look through headers and replace "." with "_"
	
	datasetOut = system.tag.queryTagHistory(paths=['[Matrikon]Random.Real4'],columnNames=headersOut, startDate=startTime, endDate=endTime, returnSize=-1, aggregationMode="Maximum", returnFormat='Wide')
	return datasetOut

Thank you Jeffcd, I bet I run into the same problem as my tag names do have a “.” in them. Thanks for the script!!!

Hi @PGriffith, I’ve run into this problem, and while looking through the forums I’ve found a few other posts dealing with this specific topic of browsing historical tags in perspective.

You’ve said it’s on the shortlist but I was wondering if it would be beneficial or useful to put it up on the Ignition Features and Ideas page, or not because it’s already on the ‘shortlist.’

Thank you