I was testing trying to get this to work, and was successful by following Importing and using 3rd party Python libraries in Ignition and it to worked just fine the first round. I had added a folder inside the pylib folder that had one simple python file. To change the valueSouce based on a radio button selection.
When I added another file, just as simple, to change a tag to enabled or disabled the module can now not be found. I waited for the updating to finish, restarted ignition, and even went back and deleted the new file so it was at when it worked. Even then ignition can no longer find the folder.
Has anyone every delt with this? And is there a better process to do this then just adding a file to the folder with ignition designer still open?
This example is what the python file does:
def valueSourceChange(tagPath, tagType):
"""
The function changes the value source for any tags provided.
• tagPath - the full tag path
• tagType - What the user chose the new Value source to be
"""
import system
# access the valueSource property
newPath = tagPath + '.valueSource"
system.tag.writeBlocking(newPath, tagType)
return system.perspective.print("The value source has been updated")
The folder set up:
• folder name : MyFolder
• PythonFile: Test.py
How I imported it:
from MyFolder import Test
Edit:
this pops up on the console but never says finished updating. Can not remember if it did so the first time. Is it supposed to?
13:53:28.054 [ClientProgressManager-1] INFO PyLib_ChangeListener - Updating 'pylib' contents from Gateway.