cancel
Showing results for 
Search instead for 
Did you mean: 

Can i use a tag as a paramater in a query template?

Former Member
0 Kudos

Hi,

I have to create a display template bar chart using 5 tags in a tag query which are Run time, Setup time, Green Light time, Red Light time and Yellow light time. This is no problem to do. But I have to duplicate the chart for 24 machines or nodes.

My question is, do I have to create 24 query templates and 24 display templates for each node or can I paramaterize the node number which in the case below is 11 inside my tag query template?

An example of a tag is OPCSERVER.USBtoCAN.Node 11.RunMinutes

Any info will help as this will be 1 of many sweet charts and graphs I will need to create per node.

Thanks

Mike

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jeremy,

I am really close to having this situation squared away. The page opens fine and I can see the bar graph layout and the title. I am not however seeing any info for the bar graph. It seems the problem starts with the Tagname.x lines.

I created a Query Template (iHistorian/Minutes/TurnMinutesTagname )and for

param1= TagName.1

param2= TagName.2

param3= TagName.3

param4= TagName.4

param5= TagName.5

I also created Display Template (iHistorian/Minutes/AllTurnMinutes) and used TagName.1,TagName.2,TagName.3,TagName.4,TagName.5 from Query Template

(iHistorian/Minutes/TurnMinutesTagname) for Value columns. To me it seems correct, but do you see any problems?

Thanks

Mike

<APPLET NAME="NodeChart" CODEBASE="/Illuminator/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="640" HEIGHT="400" MAYSCRIPT> <PARAM NAME="QueryTemplate" VALUE="iHistorian/Minutes/TurnMinutesTagname"> <PARAM NAME="DisplayTemplate" VALUE="iHistorian/Minutes/AllTurnMinutes"> <PARAM NAME="ChartType" VALUE="Bar"> <PARAM NAME="Title" VALUE="Node Chart">

<PARAM NAME="Server" VALUE="iHistorianPST">

<PARAM NAME="Mode" VALUE="Current">

<PARAM NAME="TagName.1" VALUE="OPCSERVER.USBtoCAN.Node .AmberMinutes"> <PARAM NAME="TagName.2" VALUE="OPCSERVER.USBtoCAN.Node .GreenMinutes">

<PARAM NAME="TagName.3" VALUE="OPCSERVER.USBtoCAN.Node .RedMinutes"> <PARAM NAME="TagName.4" VALUE="OPCSERVER.USBtoCAN.Node .RunMinutes">

<PARAM NAME="TagName.5" VALUE="OPCSERVER.USBtoCAN.Node .SetupMinutes">

</APPLET>

jcgood25
Active Contributor
0 Kudos

Mike,

Don't map anything into the ValueColumns, since your query template is a TagQuery the iChart will automatically bar chart all of your tags. This will actually work against you.

In a Tag query template the Param.x's are not used, so don't even bother, the indexed TagName.x's come from the one you map into the list of selected tags on the right when you map them over.

Your query template will contain the Server and Mode, so you don't need them in the APPLET PARAM's (just remove the lines). Your display template will contain the ChartType, so you can remove that extra PARAM line too. These were only there so the original example I posted worked for you.

Besides the querytemplate and displaytemplate lines, the only ones you really need are the ones including the token number (assuming the query and display do what you want them to).

Regards,

Jeremy

Answers (4)

Answers (4)

Former Member
0 Kudos

Jeremy,

Ok, it makes sense now. I was mapping to the value columns in my Display template. All is good. Thanks for your help.

Mike

jcgood25
Active Contributor
0 Kudos

Mike,

Create a simple web page with an irpt file extension with this in the body:

<APPLET NAME="Node<b></b>Chart" CODEBASE="/Illuminator/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="640" HEIGHT="400" MAYSCRIPT> <PARAM NAME="QueryTemplate" VALUE="Defaults/TagQuery"> <PARAM NAME="DisplayTemplate" VALUE="Defaults/iChart"> <PARAM NAME="ChartType" VALUE="Bar"> <PARAM NAME="Title" VALUE="Node <b></b> Chart">

<PARAM NAME="Server" VALUE="Simulator">

<PARAM NAME="Mode" VALUE="Current">

<PARAM NAME="TagName.1" VALUE="L<b></b>Speed"> <PARAM NAME="TagName.2" VALUE="L<b></b>Yield">

<PARAM NAME="TagName.3" VALUE="L<b></b>OEE"> <PARAM NAME="TagName.4" VALUE="L<b></b>Availability">

<PARAM NAME="TagName.5" VALUE="L<b></b>Performance"> </APPLET> Then call the page such as http://server:port/path/Hamel.irpt?Node=1 You can vary the Node number in the URL request (perfect for a drill down popup page, etc.) which will in turn dynamically adjust the Simulator chart name, title, and values from Line 1, 2, 3, 4. I made this sample for you without any special templates, but for simplicity I would recommend setting up your base query and display how you like them in the editors and then only including the actual PARAM statements above that incorporate the <b></b> token.

Notice that the Chart will display them automatically (no need to make separate query or display templates).

This way if your tags are named exactly the same except for the node number you have an infinite number of possibilities, but only one page.

Regards,

Jeremy

Former Member
0 Kudos

Jeremy,

Your posts helps, as I am working on a similar issue but I still have a few questions. From what I can tell, the tag query must be set up with the tags pre-selected on the Tag Query Details tab.

Is it possible to set up a tag query pointing to a particular server (IP21 in our case) and pass in the tag names dynamically from the UI w/out selecting any tags in the query?

In my testing so far, I can set up the tag query with say 5 tags, and then use any of those values dynamically from the page, but I cannot add a 6th tag.

My overall Idea is to create a BLS transaction w/ Tagnames as inputs from the UI...pass these from BLS into the Tag Query(Current Value) and then build one XML file with the results for display on the UI (bound to a grid)

The XML returned from a current tag query has one table/rowset for each tag.

let me know if this doesn't make sense

thanks in advance

Jeff

jcgood25
Active Contributor
0 Kudos

Jeff,

You don't need BLS for this - that's what the example I shared was to demonstrate. In your scenario, with 1 or more tags in a given IP21 query template, the <PARAM/> line with TagName.x will override the value in the template. So, if your query template has a tag called FOO in it, and in your html page in the applet definition you have <PARAM NAME="TagName.1" VALUE="xMIIRules"> the query will hit IP21 for a tag called: xMIIRules since it has overloaded what was in the original query template.

Don't be concerned with the separate Rowset structures (one per current tag), because the iChart and iGrid applets will deal with this just fine.

Regards,

Jeremy

Former Member
0 Kudos

first of all, can you respond quicker...I mean 9 minutes is unacceptable.

I understand the concept using the iGrid, but I am using a different UI control(.Net of course), so I will be calling the query via URL and binding the returned XML to a gridview..

My hope was that I could just build a generic Tag query(w/out any tags selected, only connection info) and then pass in the tag values from the UI. This will allow me to handle the tag names(which will vary from page to page and site to site) outside of the Query.

Is my design wrong and/or is this possible..

thanks

Jeff

I'll check back in 8 minutes

Former Member
0 Kudos

I got it working, was having some caching issues...basically using this URL call will allow me to dynamically pass in the tags. and I don't have to have the tags selected in the query

http://<server>/Lighthammer/Illuminator?QueryTemplate=UserTemplates//Queries/IP21CurrentVal&Content-...

jcgood25
Active Contributor
0 Kudos

Jeff,

Note, that this might be easier for you to construct the URL, and using the TagName comma delimited list only works when calling the servlet directly (since the query template has indexed tagnames). A query template is just another name/value pair that just happens to contain other name/value pairs.

http://<server>/Lighthammer/Illuminator?Server=IP21&Mode=Current&IllumLoginName=XXX&IllumLoginPasswo...

Regards,

Jeremy

Former Member
0 Kudos

Hamel,

Create a transaction BLS

1. Store the output of tag Query (5 tags in a tag query which are Run time, Setup time, Green Light time, Red Light time and Yellow light time) for all the 24 nodes into a document.

2.Use a repeater to to read rowwise the output of the all the 24 nodes.

3.Than u can display the output (Run time, Setup time, Green Light time, Red Light time and Yellow light time) for all 24 nodes in a grid.

Hopes this helps.

Regards

Raman

Former Member
0 Kudos

Hamel

Suppose u hv 24 nodes with their own node numbers say 1,2,3, ..,24.

Then u better to pass the node number to the created Tag Query for that machine/node accordingly, then with that Tag Query, u can display chart (as display template) for each node with node number passing to Tag Query.

Regards

Som