How to get components in Tag events?

I want to get component Table’s data in Tag events
How I can get it
just like ’ event.source.parent.getcomponent()’ function.

If what you are attempting to do is access a component directly from a tag event:

Short answer - you can’t.

Slightly longer answer:

Tag Events have no context to the GUI as they are gateway scoped. At any time there could be multiple clients/sessions open it would be impossible for a tag event to resolve which session you’re attempting to access the component in.

If what you are attempting to do is access a dataset which originates from a table, then what you need to do is create tag of type dataset which is bidirectionally bound to the table’s data property.

That’s a broad answer, but your question has left out quite a bit of needed detail for a better answer, IMHO.

OK thank you very much.
I mean that if OPC Tag is triggered i will initialize the table component and write data to the Table and also read some Table data.
So I can’t do that ,right?

Create a custom property on your window/view and bind it to your tag. Then use an on change script in that property to fire your client script


You can’t do it in a tag event.

You can do it in other ways. @nminchin has shown one of those.

Thank you very very very much :blush: