ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting Datasocket Communication to DLL

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).

 

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.

0 Kudos
Message 1 of 2
(229 Views)

@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.

0 Kudos
Message 2 of 2
(176 Views)