From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-27-2022 07:51 AM - edited 07-27-2022 07:52 AM
I was wondering whether to use the node or the toolkit, but I did not fully understand the node after looking at the documentation and the examples, so I was wondering if it could do the following, from the toolkit website:
"Can execute multiple function calls, get and set variables, or perform other operations for as long as you want."
as well as
"So the concept is less like running a Python script, and more like an ongoing conversation between LabVIEW and Python. The Toolkit handles all the messy details like setting up communication with Python, handling type conversion, and translating Python exceptions to LabVIEW errors. All you need to do is write your Python-side and LabVIEW-side code, and it just works."
Links to documentation (for reference):https://www.ni.com/docs/en-US/bundle/labview/page/glang/close_python_session.html
https://www.ni.com/docs/en-US/bundle/labview/page/glang/open_python_session.html
https://www.ni.com/docs/en-US/bundle/labview/page/glang/python_node.html
Links to Toolkit Website (for reference): http://docs.enthought.com/python-for-LabVIEW/guide/start.html
Any help would be appreciated, thanks!
Solved! Go to Solution.
07-27-2022 09:32 AM
Hey astrocarbonate,
Enthought is no longer issuing licenses for this product. See this: https://support.enthought.com/hc/en-us/articles/360035630192-Toolkit-End-of-Life-Porting-to-LabVIEW-.... It should also answer your questions about parallels of node and toolkit.
Hope that helps,
LabVIEWfan123
07-27-2022 11:23 AM
The same? No. They are designed differently.
The Python Node does not allow you to get and set variables, which I would argue is a good thing. It doesn't seem like good programming practice to me to be reaching into the Python domain to modify global variables from LabVIEW. (If there are specific variables you absolutely need to set that way, it shouldn't be too burdensome to create functions to access them in your Python module.)
Calling functions is, IMO, simpler with NI's Python Node. You do not need to pack and unpack data, you just pass it in and get the return value.
For example. this:
Becomes this when using the Python Node:
One thing to note, the Python node supports treating arrays as either lists or NumPy arrays. For their "square_it" example to work, make sure you have selected the option to marshal to NumPy array:
If that is not checked then the array will be passed as a list and you will get back an error that it is an unsupported type for the ** operator.
As for whether you should use one or the other, the NI integration is a supported feature that has gotten some updates (relatively) recently. Enthought seems to me as though they likely abandoned this toolkit when NI launched their own, but you would have to ask them to be sure.
(BTW, you can ask related information on the same thread. No real reason to have separated this from your other one.)
07-27-2022 01:49 PM
Wow, thank you! This helps a lot. I will definitely look further into it. I appreciate it.