07-17-2023 09:21 PM
Solved! Go to Solution.
07-18-2023 12:36 PM
Being two different processes, LabVIEW and Python cannot share the same memory space. The Python node in LabVIEW does some level of marshalling/translation between the data spaces.
Better option, write to a file from Python, read that file in LabVIEW. You're not limited in data types and complexity.
07-18-2023 12:44 PM
07-18-2023 01:03 PM
@santo_13 wrote:
Being two different processes, LabVIEW and Python cannot share the same memory space. The Python node in LabVIEW does some level of marshalling/translation between the data spaces.
Better option, write to a file from Python, read that file in LabVIEW. You're not limited in data types and complexity.
Personally I would be more inclined to use a server/client mechanism for passing data between the two processes. This provides a more flexible approach. You could use a JSON format for the data and that would ensure both sides would know how to interpret it.
07-18-2023 01:21 PM
Thank you for your reply.
Yes, it's great idea. however, I want to construct a data sending and receiving area between Python and labview, Python keeps storing data in it, and labview periodically retrives data.I'm not sure can this be done through the server/client mechanism.
Transiting through text seems feasible, but it also has certain limitations. But I can't think of a better way.
07-18-2023 01:30 PM
@Mark_Yedinak wrote:
@santo_13 wrote:
Being two different processes, LabVIEW and Python cannot share the same memory space. The Python node in LabVIEW does some level of marshalling/translation between the data spaces.
Better option, write to a file from Python, read that file in LabVIEW. You're not limited in data types and complexity.
Personally I would be more inclined to use a server/client mechanism for passing data between the two processes. This provides a more flexible approach. You could use a JSON format for the data and that would ensure both sides would know how to interpret it.
Of course, that will be a better approach if you need both application transfer often and support variety of comms.
07-18-2023 01:33 PM
@hallo77 wrote:
Thank you for your reply.
Yes, it's great idea. however, I want to construct a data sending and receiving area between Python and labview, Python keeps storing data in it, and labview periodically retrives data.I'm not sure can this be done through the server/client mechanism.
Transiting through text seems feasible, but it also has certain limitations. But I can't think of a better way.
Providing more detail about the application, why it has to be Python and LabVIEW, what kind of data, how large and how often - these will help suggest better solution if there are.
07-18-2023 02:12 PM
Well, I want to create a host computer using Python and labview. Python to achieve communication and data processing, labview try not to add too complex procedures, mainly data display functions. But the transfer of data between them is a problem, do you have any suggestions? Thank you very much!
07-18-2023 02:27 PM
More about it.It's not a huge amount of data, a dozen of it, of the type uint16. What time does time mean? The data read time of the timer is about 200ms.
07-18-2023 02:29 PM
you can use TCP or UDP to interchange data over ethernet between a labview .vi or .exe and a python script.