New script not recognized

Dears,
After I made new script and added a function into it
Refresh_po_lines_paperless.refresh_PO()

and tested ,I found It is not recognized and cannot be used in my application.

I found this in the diagnostic bundle :
INFO | jvm 1 | 2023/11/03 22:24:09 | NameError: global name 'function_refresh_po_lines_paperless' is not defined

then I thought I i put the function in an old script to be noticed but also not recognized and found this :
INFO | jvm 1 | 2023/11/03 22:53:09 | AttributeError: 'com.inductiveautomation.ignition.common.script.Pro' object has no attribute 'refresh_PO'

what to do to let the gateway notice the new script and its function

Functions start with def;

def foo():
   #do something

Show your entire code.

These are two different library names

2 Likes

I just changed it from function_refresh_po_lines_paperless to be Refresh_po_lines_paperless ,hoping it will be recognized.
and still not recognized.

I shared a video record to ensure that the gateway cannot recognize the function

We need to see your code. Can't help without it.

Also... Check that your gateway scripting project is set correctly. Tag change scripts require it to be set correctly.

1 Like

Thanks for your support,Can you check the uploaded video?
It shows the functions is running properly in the script console but not recognized in the tag change scripting page,although other function is running there properly.

We need to see your script and how to define it in the project. Not the example of it not working.

Also... With tag change scripts you must have the gateway scripting project set. Gateway Settings - Ignition User Manual 8.1 - Ignition Documentation

Otherwise the tag scripts cannot find the code.

1 Like

This provides one piece of information--that the script in question has no syntax errors. It is otherwise unhelpful to point out that a script intended for gateway scope works in the designer script console. There are so many differences between the scopes that the result is meaningless. The designer script console exists for and is appropriate for testing Vision Client Code. Full stop.

To test gateway-scope or Perspective-scope code, the code needs to actually run in that scope.

1 Like

Thanks Pturnmel for your usual support ,excuse me as I am beginner here .It was my fault as Gateway Scripting Project need to be changed in gateway settings.

You should mark @bschroeder's comment as the solution, as he pointed this out first.

1 Like

Done :smiling_face_with_three_hearts: ,Many thanks guys

1 Like