Accessing custom parameter of a UDT instance inside a popup window

From the dataset editor I observe that the dynamic tag binding using indirection is working fine, but the tag historian is storing the data only for Tank 1 (PV & SV), not for other tanks Tank 2 on wards, although i have enabled history for these two tags in the Tank UDT for Tank itself!

I was getting the chart displayed only for the first Tank, but when I opened the popup window for other Tanks by clicking on the respective template instance, I was not getting any chart displayed! So I thought there is an error in dynamic tag binding! I never suspected the data for only one tank1 is getting historised not for others? Any clue why it might be happening?

I need to open the data base and see what’s getting stored there. Any hint whats the easiest way to check the contents of the historian tables thru designer?! Or do I have to see only thru the SQL manager tool?

Found the problem! I had not selected the Storage Provider for the two tags in the UDT! So the tables for the two tags didn’t exist in DB! Now everything is working as expected! The Indirection for Tag Pens works as demonstrated in the IU video for Indirect chart display!

(But I wonder how the chart for Tank 1 was working without the selection of Storage Provider!)

Thanks all for your time in helping me out. It was my mistake!

regards

Perhaps tag editing menu should not allow leaving Storage Provider blank when history is enabled on a tag in the editor to disable erroneous data entering in the tag configuration. The history enabled without specifying storage provider doesn’t make sense!

How to achieve the same in perspective? That is, when you pass a UDT as a Parameter in a template view, then how to access the udt number (such as tankNumber in above example) which is its internal parameter in the UDT?

No differently than in Vision

I created a custom property for the TankNum in the Template View and tried to bind it with the TankUDT which is defined as an Input/Output parameter in the Template View, I get InvalidPathSyntax error! How to specify the path I tried {view.params.TankUDT}::Meta.TagPath but that too doesn’t work! (gives syntax error invalid character “:”!)

I am stuck!

I’ve never used udt types in Perspective at all, but can you select the meta tagpath from the UDT type param from the property selector?
Screenshot_20220125-170238_Chrome
I’d expect it would be a part of the {}
Eg
{view.params.TankUDT::Meta.TagPath} or something

No, it gives configuration error!

8.X’s tag system actually has access to more meta information than 7.X Vision, though we don’t do a great job exposing it in the tag system. Try, e.g.:

attrs = [
	"nodeDescription",
	"topLevelPath",
	"udtRootPath",
	"parameterModel",
	"typeStructure"
]
values = system.tag.readBlocking(["New Instance.%s" % attr for attr in attrs])

for attr, qv in zip(attrs, values):
	print attr, qv.value
>>> 
nodeDescription TagDescription [name=New Instance, dataType=null, currentValue=[null, Bad_Unsupported, Mon Jan 24 08:45:11 PST 2022 (1643042711614)], objectType=UdtInstance, subTypeId=UDT, attributes=null, hasChildren=true, displayFormat=null, tooltip=null]
topLevelPath [default]New Instance
udtRootPath UDT
parameterModel com.inductiveautomation.ignition.common.tags.browsing.ParameterModel@a0b5d36
typeStructure com.inductiveautomation.ignition.common.tags.model.TagStructureTree@17c7f346
1 Like

But the question is, how to access the meta data TagPath for the thru designer? I don’t believe that no one came across this requirement. How did they achieve it in perspective?

Basically I am trying to get the internal parameter - serial number of a UDT that is passed to a view (which is acting as a template)!

Looks like there is no solution available in perspective thru designer right now that allows you to access meta data of a UDT without scripting!

If someone has, please let me know, I am stuck!

The types passed around Perspective aren’t ‘rich’. They’re JSON types - strings, numbers, booleans, objects, arrays, or null. If you pass the path to a UDT in to a view, and you know what the parameter’s name is, you just read the appropriate parameter. I agree that the design experience has some rough edges, but that’s the functionality. There is no equivalent to Vision’s parameters “with” a UDT as a type, because that’s not how Perspective or JSON work.

I could see exposing a node like UDT Instance.Parameters, where we automatically give you the name and value of each parameter; that might be an interesting feature.

1 Like

I will think it over, how to do this.

Yes it will be a nice feature to have in future versions. Then this becomes compatible with vision version.

Thanks a lot.

This seems like a bit of a hamstring as it is at the moment; definitely glad I don’t use UDTType parameters!

UDT passing to popups/templates is in my opinion inevitable if you want to achieve a high degree of re usability of complex objects like motor , pumps etc. How else would one pass so many grouped and related parameters to popups and templates without UDT’s! Passing thru page or session props could perhaps be the only solution but its like making all tags global, which is against principles of object orientation!

Pass the tag path to the UDT, then from there you can append any tags you want to read onto that, including parameters.

E.g.
pass:

view.params.deviceName: 'Motor 1'
view.params.deviceParentPath: 'Area 1/Sub Area 4'

then have a custom prop bound to create:

view.custom.deviceTagPath: {view.params.deviceParentPath} + '/' + {view.params.deviceName}

which evaluates to:

'Area 1/Sub Area 4/Motor 1'

Then you can create your bindings to your tags using custom.deviceTagPath
e.g. a tag indirect binding:

{1}/Parameters.DeviceName

{1} = {view.custom.deviceTagPath}

** partial pseudo-code

3 Likes

While assigning ViewPaths to a view , the list of parameters displays old parameters which were created but deleted subsequently. Can the list display only currently available parameters defined the custom properties? Please see the enclosed screen shot where only tankUDT parameter is remaining, others are deleted and non existent. Why are non existent parameters retained in the list and they are selectable as well! What do sync and syns & reset options do?

image

What version of Ignition are you using?

There's a bug that was fixed.

I am using 8.1.11 (b2021101912)

I will upgrade to 8.1.14 soon. Glad that its fixed in new versions as it causes lots of confusion!

Another problem I am facing in perspective while using the multi-state button component from a template_view is that the button doesn’t change the state when pressed! The DB is R/W state and the authentication is available to the user logged in!

Could it be due to a tankUDT parameter passing issue due to which the button state is a not getting passed property in the view! The UDT is made R/W in the props list!