Configure bindings via script
J
Josh Borgemenke
Many of my projects require me to bind derived tags to embedded svgs with 100s of elements. These svgs often need to be re-embedded over the course of a project, therefore, their elements require binding all over again.
I use scripts that autoconfigure the tags. It would be a HUGE time saver if I could configure the bindings too.
Log In
`
`james Baker
I like what Josh has asked for. It will make things more dynamic. We currently have many different types of switches on site. They have many different fast Ethernet/Gigabit/TenGigabit variations let a lone the amount of ports per switch. Then there are different amounts of stacks of switches and not to mention that vendor name ports differently when trying to interface. So making a template using an SVG is difficult when you want make the view efficient by binding visual image of a port to a tag.
n
nick.minchin
You can technically do this already if you copy the json of the component (or the View itself), edit it and add in your bindings, then paste back over the top. You could also parse the view's resource json file as well and do the same thing.
Each component has a
propsConfig
object where the bindings are configured: "propConfig": {
"custom.prop1": {
"binding": {
"type": "expr",
"config": {
"expression": "'Awesome!'"
}
}
}
}
J
Josh Borgemenke
nick.minchin: While this might allow me to configure a component outside the designer, it doesn't sound like I'd be able to integrate the binding process into the ignition script that makes all the status tags used for said binding. Or does ignition offer the ability to copy, manipulate, and replace a component's json?
n
nick.minchin
Josh Borgemenke: You can manipulate any View's view.json resource to make edits to your views. Just note that the gateway only checks for external file edits every x minutes (default is every 5 mins).