Get components from a window that is not opened?

Is there a way to get component properties from a window that is not opened?


As far as I know you can’t. maybe try to open the window first then grab the component. When the window is not open the component value is not updated so even if there was some way to get it the value wouldn’t be correct if I’m not mistaken.

Thanks for the response Mr.K001.

Understood that the component value is not update if the window is not open.

However, if the component value is static, it shouldn’t matter for what I’m trying to do. What I’m trying to do is create a tag that is based upon set component values within the window. The created/expression tag is then evaluated based upon realtime OPC tags that are expressed based on those set component values. If that makes any sense… …I’m trying to not have to manually specify all the realtime tags in the created/expression tag, especially since there are a lot of windows.

I’ve thought about a time based script on the Client that opens the window, grabs the components, writes to the tag and then closes the window. However, to do that periodically and for many windows wouldn’t work well.

if you want to do that then how about this, I assume the component value can be changed by user correct? or does it always stay the same?
If it can be changed by user then I’d create a folder with memory tags and when the user changes the value of the component I’d write it to that tag as well so you would never have to worry about grabbing the component value because you can just grab the memory tag value since it will always be the same as the last value of the component.
Do you think this will help you?
Unless you are talking about like 1000 windows and 1000 different components then it will be annoying but if the number is not too big I’d just write them to a memory tag so they are always available to you.

1 Like

Thanks again.

This might help or at least gives me ideas for other avenues.

Yes, the user would be able to change the component value. Although, once it has been changed, more than likely it will stay the same for the life of the project.

There could be upwards of 100 windows and 1000 components or more, depending on the application. I’m trying to create a program that could be used across multiple projects. In doing so, there could be different amounts of components on each window depending on the project. This is why I was originally trying to stick with getting the components from the windows.

another idea, what about inserting it in a DB table? if its only going to be changed once just insert it there and have a column with say the window name and one for the component name that way you can put them all in there and don’t even have to worry about making a 1000 tags… this way you can always query the data.

True. Thanks for the idea. I just don’t have DB connected yet.

Consider using Client tags for these properties. You can bidirectionally bind them in some “configuration” window that you only use in the designer, and unidirectionally bind them in all other windows. Client tags are part of the project, not global for the gateway, so different projects can have different configurations without clashing. Client tags are also instantiated during client startup before windows are opened, and are always present, so no funky operations with closed windows are needed (you really don’t want to mess with the serialization stuff).