LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW DLL in Python - Using Clusters as args

I have created a DLL with the LabVIEW code which accepts a cluster as args. This cluster contains a 2D array of unsigned integers(uint8) and a double. This DLL is working when I use it in LabVIEW. But, when I tried to use the DLL in Python it shows "OSERROR: Access violation at 0X0000001". I suspect that the DLL is not able to read the input cluster itself. Any suggestions on what should be done to make it work?

I have attached the Python code, LabVIEW DLL, .H file and the LabVIEW project I used to create the DLL.

0 Kudos
Message 1 of 5
(3,915 Views)

Pretty sure this thread solves your issue 😉

 

https://forums.ni.com/t5/LabVIEW/Access-individual-cluster-elements-through-Python/td-p/735804/page/...

Surely not everyone was kungfu fighting.
0 Kudos
Message 2 of 5
(3,883 Views)

Hi PeanutButterAndLabVIEW,

I have gone through the link.They are trying to pass cluster from python to LabVIEW VI.But in my case it is DLL. So it is not solving my problem.

Thanks anyways.

0 Kudos
Message 3 of 5
(3,870 Views)

This is really more a Python question then a LV question, but as the dll is build in LV, it's probably the best place to post.

 

AFAIK, 2D arrays are not really 'defined' outside LabVIEW. 1D is standard, nD isn't. Python probably uses another format that is passed to LabVIEW.

 

Have you tried something simpler before trying the 2D array? Begin with a scalar, then a 1D array, then a 2D array. Just so you know everything else is working.

 

If everything but the 2D array works, you'll have to look for a way to transfer the 2D data to LabVIEW. This means either modify the data in Python so LabVIEW accepts it as 2D array, or modify the dll so it accepts a 1D array, and make Python flatten the data to 1D...

0 Kudos
Message 4 of 5
(3,866 Views)

Hi wiebe@CARYA,

 

Sorry for the late reply.

Will try out everything you said and will post the update. 

Thanks.

0 Kudos
Message 5 of 5
(3,835 Views)