Vision chart named query parameter inside a template for udt tag

Hi, I’m new to this forum. I’m trying to bind my parameters {Inst_Name} and {Inst_Table} using a named query chart to pass my udt tag values; Although it is working during runtime, when I open my template, I got a cyclic error popup in my parameter. My Named Query “Query_Inst“ is very simple:

Select
t_stamp,
{Inst_Name}
From {Inst_Table}

Inst_Name and Inst_Table are my column and table names of type QueryString in SQL Server; When I bind my UDT Tags in the value field in the chart - {INST_PT_Projeção_P.Dados::CONF.TAG} for Inst_Name and - {INST_PT_Projeção_P.Dados::CONF.Hist} for Inst_Table I get this error:

java.lang.Exception: Error running query:com.inductiveautomation.factorypmi.application.gateway.NQuery@16b700a4@6000msOn: INST_PT_Projeção_P.INST_PT_Projeção_P.Chart.Dataat com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:311)at java.base/java.lang.Thread.run(Unknown Source)Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: java.lang.Exception: Missing value for query parameter {Inst_Name}

any help would be greatly appreciated!

In simplest terms, cyclic binding error/warning means you have some how bound something to itself, either directly or through a chain of bindings. We'll need to see how your template/table is actually set up to be able to help further.

Show a picture (or multiple) of your table setup and the binding configurations on the table/template.

Based on this error it seems you aren't passing a value to one of the query parameters. Double check your binding configuration. The cyclic binding error might be causing the value to not be passed.

Also, edit your post to have the stack trace as preformatted text, see Wiki - how to post code on this forum. You can edit your post by clicking the pencil icon in the bottom right.

Edit: Misunderstood the cyclic error

1 Like

Ensure that the parameters match exactly - same case, no leading/trailing spaces, that you've saved in the designer since making changes, etc.

1 Like

@paul-griffith,
The error only occurs in edition mode when I open my template. In runtime my chart works ok. I took these prints to ilustrate how I built my template and the SQL query:

Can you also show your template's parameter setup/config? Cyclic error is something that should not be happening, full stop.

Also, on the query binding dialog, select the value box for each parameter and press enter. I've seen where just clicking outside of the box does not apply the expression.

Completely different (but related) topic, based on your query, each device has a separate DB table in the database, correct? Is there a reason why you don't have a single tall table with a column for value, deviceId and timestamp? That would allow you to filter on just the device ID, and maybe timespan, instead of using query strings in a named query. It also allows you to add/remove devices without having to deal with adding or removing tables.

I would hazard a guess that it's a combination of UDT type parameters and query string parameters in your named query. You should contact our support department to make an official bug report: https://support.inductiveautomation.com/hc/en-us

1 Like

I tried that, unsuccessfully…

Let me try to clarify on my end, as I realize I might be misunderstanding something. When you say cyclic error popup do you mean:
A) The popup shows an error with something along the lines of circular reference or similar?
B) The popup keeps reappearing at a set rate with the same error, which is the error that you posted?

I would advise against using UDT parameters, and instead pass the tag path to the UDT instance you want to target/use as a string to your template. From there, bind template custom properties indirectly to necessary UDT members, using the tag path passed to build the full path.

You can find plenty of posts on the forums on why using UDT parameters on views/templates is not recommended.

1 Like

B → Once I configure my NamedQuery parameter value inside my template chart as {INST_PT_Projeção_P.Dados::CONF.TAG} for {Inst_Name} and - {INST_PT_Projeção_P.Dados::CONF.Hist} for {Inst_Table}, the error popup keeps reappearing at a set rate.

{INST_PT_Projeção_P.Dados::CONF.TAG} and {INST_PT_Projeção_P.Dados::CONF.Hist} are the paths built by the “Insert Property“ button, Insert_Property pointing to my template custom parameter “Dados“ in wich we found .CONF.TAG and .CONF.Hist members, from my UDT.

Okay, that it is from the query attempting to re-execute at whatever rate and having that error each execution. I originally thought you were getting an error regarding a circular reference.

1 Like