Is it possible to inspect .bin files for e.g. vision windows programmatically?

E.g. if I want to, given a window.bin file, figure out 'what objects are in this file and what tags are they tied to'.

EDIT: The best way for me to do this might be via the scripting API inside the designer, rather than from the BIN files. Is there an easy way to have a script inside the designer e.g. wait for a file to be written on the host filesystem, then based on the contents of that file do some programmatic analysis/modification of the project?

No, but modern Ignition can be told to save windows/templates in the underlying XML format. You may need to open and then save every resource involved, though.

Where is that setting in the gateway?
Also, can gateway backups be modified to use that setting as well?

It's in the project settings.

A gateway backup simply grabs all the files in the filesystem, so you'll get XML for those that have been opened and re-saved.

Terrific, thanks

Sorry, where in the project settings?
Not seeing it either in the gateway or the designer

Project Properties -> Vision -> General -> Resource Encoding

By default it is set to Auto, but you can set it to either Binary or XML.

1 Like

Terrific, thanks -- that worked for me.

I'm assuming there's no documentation on the contents of this file/how to read stuff out of it?

Correct. It's format is an implementation detail and rather convoluted. It helps if you notice that any component that has a binding gets encoded with the window's InteractionController instead of producing a simple tree of containers and components.

:frowning_face:

If i wanted to do programmatic reading/manipulation of this, am I better suited to go via designer scripting, rather than the XML?

In the designer, you have to open the window to script against it. If that's ok, then scripting the actual Swing objects is much easier than the XML.

Is there any way for me to automatically run scripts (assuming the designer is open)?

No.

(But I've thought about adding something to my Integration Toolkit for pure designer events, defined outside any project. Hmm. After I'm ready for v8.3, perhaps.)

What about to have scripts run on a particular project (to e.g. read/modify windows) based on e.g. the presence of a particular file in a directory which contains params

You'll have to explain further. The designer doesn't have to be on the same computer where project resources are stored.

Sure -- I want to have a script on the designer in a specific project that e.g.

"Watches for a file on its host filesystem containing a list of objects to create in a window"

"When it receives those files, it checks the window for all objects, then modifies the objects that match to have the params from the file, and adds the objects that don't match, then saves the project"

Yeah, no, nothing like that is possible out of the box.

Alright, thanks. Even this XML gives me something to start with.