09-25-2025 09:42 AM
I wish to communicate to a datasocket in python. My current approach is by making a VI which opens the data socket, writes to in and then closes it (VI attached).
I am pretty sure that repeatedly opening and closing the datasocket is causing problems- eventually the communication stops working and reading from it returns a blank array (both in labview and in python).
I was wondering if there was a way to split up the VI into smaller functions for the DLL, such that the datasocket communication can be maintained in python, in order to prevent this problem.
I appreciate any help anyone may be able to offer.
09-26-2025 12:03 AM
@Adrien2000 wrote:
I wish to communicate to a datasocket in python.
I would like to recommend avoiding heavy-weight DLLs exported from LabVIEW and instead using the lightweight DataSocket implementation from NI CVI:
DataSocket Library Function Tree.
By default installed
Header: "C:\Program Files (x86)\National Instruments\CVI2020\toolslib\datasock\dataskt.h"
Library: "C:\Program Files (x86)\National Instruments\CVI2020\toolslib\datasock\msvc\dataskt.lib"
DLL: C:\Windows\SysWOW64\dataskt.dll
Unfortunately, I do not have a 32-bit LabVIEW in my hands to provide an example, but it should work. I recommend avoiding very complicated data structures.