Where to import libraries used on Perspective Components

I'm running Ignition 8.1 with a Trial License and I have a general question regarding importing libraries. In general, say I want to use a library in a script called by a component event. There are several instances of this component so I don't want to include the "from xxx import xxx" statement on every event. So where do I make the "from xxx import xxx" call?

(Me not programmer, me make sparky sparks) :monkey_face:

In reality, if you need to use a library function in a script, you need to import that library function on every script that calls it.
If you find yourself making lots of similar scripts, write the script in the Script Library, and just call it from the event each time.
The import is only called on runtime of the script, so multiple instances of the component doesn't matter unless you are running the script constantly.

I presume you're importing external libraries e.g. from Jython or Java libraries and not just project script libraries (the latter don't need to be imported)

2 Likes