Question

Python function runs in manual script, but not as a control room file

  • 16 August 2022
  • 3 replies
  • 12 views

Badge +1

I am not able to figure out why this is happening.

I have a simple function that just returns the same variable that is passed to it.

 

When I use the Python manual input, the function executes fine.

When I try to use the same function with a control room file, I always get 'bot error' as my output.

 

The code is just:

def test(part_no):

return part_no

 

I've tried more complex functions using pandas, and am able to get it running in manual input, but as soon as I try loading it as a control room file, it fails.

 

File:

imageManual:

image


3 replies

Change the function and file from test.py and test to something else like - myTestFunction

Userlevel 3
Badge +6

Hi @Dan Sleeman​,

 

You have to check your Input and Output parameters you have provided in Python script: Execute Function

Badge +1

I can't understand why that was the problem, but uploading a new file called function_file.py seems to work.

 

Must be something with the name test.py. Wish the error message would provide some better details for troubleshooting.

 

Thanks!

Reply