Save project, doesn't compile changes in script module

Hello

I have noticed an issue when editing code in the script module.

If I make changes to code in the script module and the application is already running, the update is not pushed to the client. The only way to get the changes to “register” is by re-starting the client. This makes the development workflow very slow as I have to re-start the application every time. I think this is an intermittent issue, but I can reproduce it.

We are using Ignition version 7.2.3 (b6630).

Thank you for your help,

Pat

I can’t seem to reproduce this here on my end. Does your project happen to be set up to run in stage and publish mode? Is it possible that you are looking at a published client instead of looking at the staging client that you can launch from the designer? Changes made while in stage and publish mode will only appear after you publish, not after a save.

If this is not the case, could you give me some more information about your setup so I can try and reproduce this here?

Thank you for your reply.

The “Publish Mode” in “Project Properties” is set to “Auto”.

I have attached a zip file containing an export of my script module and the window which calls the script.

My workflow to reproduce the problem is as follows:

  • Open the project using the Ignition Designer.
  • Start the client using F9 (or F10).
  • Test the application - all scripts are working correctly.
  • Change the script using the “Script Module Editor” e.g. change result = 'display [%s] (%s)' % (self.name, log) to result = 'display AAA [%s] (%s)' % (self.name, log)
  • Press “OK” (or “Apply”) in the “Script Module Editor”.
  • Click on the “Save” button in the designer toolbar (“Save and Publish”).
  • I can see the application update in the background.
  • Test the application - the new code from the script module is NOT being used i.e. I don’t see “AAA” in the label.
  • If I shut down the application and re-start it using F9 (or F10) the new code from the script module is used.

Thank you for your help,

Pat
script_not_updating.zip (3.26 KB)

This seems to be an issue with how “model” is being imported. If you instead do the following:

c=app.contact.model.Contact('Patrick') c.display()

I believe it should work. I’ll look into this some more.

Hi Dave,

Thank you for your help. Yes, if I use full path to the class (i.e. app.contact.model.Contact) then the code compiles correctly when the project is saved.

I am a little confused because I thought the following was valid jython code for importing a module?

from app.contact import model
c = model.Contact('Patrick')

I am not keen on using the full path because the code looks very cluttered.

Thank you again,

Pat

It’s not that your code is incorrect, what you are doing is valid jython for importing a module. The problem seems to be how we are handling that format in the software. I’ve created a ticket for this in our system to have someone look at what is happening and how it can be fixed.

I offered up the suggestion of using the full path as a workaround so that you would be able to get the code working and not be stuck, unable to proceed because of this issue. I’ll keep you updated with any information I receive about this.

Hi Dave,

Thank you for the workaround and for creating the ticket on your system. I will look forward to an update.

Pat