My company is working on an iFix to Ignition migration procedure and we are trying to automate as much of that process as possible through scripting. We have scripts that automatically configure the drivers, build our tags and place all the components in a window. I am now attempting to automate the creation of component property bindings. I have a table that identifies the tags that should be bound to each component property but as far as I can tell there is no way to create this binding via scripting. I can write to the component properties via scripting, but the bindings are not exposed in this way. Am I missing something? We are trying to avoid having to manually bind thousands of component properties across hundreds of pictures if at all possible.
Well, nothing documented or supported, but if you start here, and study the various implementing classes, you’ll get an idea how bindings work. Note that they are stored in the Window’s InteractionController, not in the component. Be sure to use the component’s own AppContext to construct the binding or relative references won’t work.
Fair warning: you will be in a maze of twisty passages, all alike.
One thing to note, don’t get hung up on how to make something work like you are used to in another platform. Maybe there is a better way of doing things. I’m at a loss and can’t visualize you binding thousands of component properties across hundreds of pictures. That sounds silly to me on any platform.
Hi David,
Did you manage it? We also are looking for similar example/materials to bind properties through scripting, we created some modules but it is not documented either so we are falling back to use scripting too.
If you could share what you’ve discovered it would great.
Thanks, Damien
The starting point I linked has all the information you need. Given the unsupported nature, you probably should make sure you understand it all. Note that you don’t need to make a module to use SDK classes and interfaces–jython can call just about anything in the platform. You might want to use the introspect()
function from my inspect.py script module to help you enumerate the undocumented methods of various Ignition objects you encounter. (You will find that much is documented, but as part of the java platform.)
You might find these topics helpful as you dig around under the hood:
You’re far better off creating templates and then just using bulk tools to add the templates to the page and write static values in your template params than to try to add bindings yourself imo
Thanks again @pturmel for your help, I will definitively have a look at introspect()
The advantage of using Modules is the convenience for small update/upgrade on site, when we only have to send a new version and install it on the gateway. Scripting seems to be more convenient during development, I thought it has limitations regarding SDK classes but obviously I was wrong.
I still need to adapt to the java platform because I come from C# so I am still unfamiliar with the methodologies sometimes.
I have noticed templates are way easier but they do not draw properly on the screen unfortunately, in our case our components are extending PathBasedVisionShape
and generated from Autocad drawings, so unless I discover a way to create templates with PathBasedVisionShape
we can not use them. But yes, templates are far better to encapsulate the logic we need.
Thanks @nminchin