Solution
Unfortunately, there is no direct way to call python class methods using the LabVIEW 2018 python node. However, you can implement a wrapper function in your python script which then can be called using the python node. An example of such a wrapper functionality could look like this:
#define class
class myClass(object):
def __init__(self, parameter):
self.__Parameter = parameter
def GetValue(self):
return self.__Parameter
#define wrapper for LabVIEW Python node
def getClassData():
newClassObject = myClass(4882)
return newClassObject.GetValue()
- LabVIEW 2018 block diagram to call the wrapper function
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.