ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The specified Python function could not be found in the specified module.

Solved!
Go to solution

Got this error after the program run , what is ReadImage function ? why it couldn't be found while the program already run successfully ?

PULSEWannabe_0-1647782796810.png

file as attached below

0 Kudos
Message 1 of 6
(3,683 Views)

 

 

it is supposed to be a user defined funtion within the python script you are calling

 
 
 
0 Kudos
Message 2 of 6
(3,674 Views)
Solution
Accepted by PULSE.Wannabe

 

goes like this 

 

def function():

 x = ... 

 return x

 

an easy example of a user defjnied function is shown in

C:\Program Files\National Instruments\LabVIEW 2020\examples\Connectivity\Python\support

 

 

 
Spoiler
import math
 
# EuclideanDistance(point1, point2) is called from PythonNode_ComputeEuclideanDistance.vi.
# LabVIEW passes the two point clusters as python tuples. The elements of the tuples can
# be accessed by indexing the tuple. The return value of the function is a double.


def EuclideanDistance(point1, point2😞
    xDiff = point1[0] - point2[0];
    yDiff = point1[1] - point2[1];
    return math.sqrt(xDiff*xDiff + yDiff*yDiff);
 
0 Kudos
Message 3 of 6
(3,620 Views)

thanks so much , I'm quite a beginner in python, met "return" few times but didn't know what it does 

0 Kudos
Message 4 of 6
(3,605 Views)

by the way, do you know how to take number/ data out from the python from the labview? I want to take data from python then process it in labview

0 Kudos
Message 5 of 6
(3,604 Views)
Solution
Accepted by PULSE.Wannabe

Click on Help >> Find Examples... and search for "Python", you will find several examples.

0 Kudos
Message 6 of 6
(3,600 Views)