02-24-2020 09:04 PM
I am trying to get this code for a Programmable Power Supply to work with LabVIEW by using the Python codes. I am getting this error currently, I think it is because I am skipping some modules, I am not sure if there is some kind of initiation process for Python when there is an outside device being interfaced as well. The CMD is the main code, and my power supply is PPS2116A.
Python Node in python_node.vi<APPEND>
Module Path: C:\Users\zimmermanho\AppData\Local\Programs\Python\Python36\LabVIEW\PowerSupply_ElectronicLoad_Control-master\cmd.py
Function Name: normalRun
Python returned the following error: <class 'ModuleNotFoundError'>
No module named 'visa'
<traceback object at 0x000002B3B25E0448>
Call Stack information:
['Traceback (most recent call last):
', ' File "C:\Users\zimmermanho\AppData\Local\Programs\Python\Python36\LabVIEW\PowerSupply_ElectronicLoad_Control-master\cmd.py", line 17, in <module>
import ElectronicLoads as electronicload
', ' File "C:\Users\zimmermanho\AppData\Local\Programs\Python\Python36\LabVIEW\PowerSupply_ElectronicLoad_Control-master\ElectronicLoads\__init__.py", line 6, in <module>
import visa
', "ModuleNotFoundError: No module named 'visa'
"]
Since the error says something about VISA I was thinking it had to do with the USB.
02-24-2020 09:40 PM
I fixed this error, it was because I did not install the right requirements. Now having the correct requirements, I am getting a new error message. When I try to call a function, I get this error:
Python Node in python_node.vi<APPEND>
Module Path: C:\Users\zimmermanho\AppData\Local\Programs\Python\Python36\LabVIEW\PowerSupply_ElectronicLoad_Control-master\PowerSupplies\pps2116a.py
Function Name: setVoltage
Python returned the following error: Function could not be found in the module
I don't know if this is because I am mission some kind of initialization state, or maybe I don't have the correct return types. I am not sure
02-24-2020 11:36 PM
As you already found, your first problem was with installation. Your second may also be an installation problem, but that's less clear without the code.
Essentially it's saying that in the file listed (pps2116a.py) there is not a function named setVoltage.
Possible causes might include:
06-01-2021 07:34 AM - edited 06-01-2021 07:38 AM
I had this same problem and I solved it by includeing the FULL PATH of the python module. You can see a video here.
Cheers!
06-24-2022 08:38 AM
what did you do to fix this error?