LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dll

Solved!
Go to solution

hi 

i am new to use dll calling in labview,i am trying to send created memory for an array(unsigned short) of few elements in labview and send that address to the dll ,

in dll i am trying to fill data to the array by giving some delay for each element .

 I got the total array in labview after competion of dll exicution only .

my doubt is

is this  possible to get array data in labview whenever data placed by dll in that address before dll exicution complted ?

 

 

thanks in advance. 

0 Kudos
Message 1 of 4
(2,391 Views)

LabVIEW is a data flow programmings language. One of its foundational principles is that a node has to finish before the output wires get data (which enables following nodes to operate).

Hence the node "Call Library Function Node" has to finish before you receive back the modified array.

 

Norbert

 

PS: There might be some option to do what you want, but if they do work at all, your DLL and the LV code will get way more complex compared to what you have right now.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(2,378 Views)

thanks for reply .

yes you are right  but for my requirement i need that and we are passing the array address from labview to dll so i just want to know is there any methode to derefrence parallelly .

 

0 Kudos
Message 3 of 4
(2,363 Views)
Solution
Accepted by topic author anil06

@anil06 wrote:

thanks for reply .

yes you are right  but for my requirement i need that and we are passing the array address from labview to dll so i just want to know is there any methode to derefrence parallelly .

 


Well, the memory layout of LabVIEW arrays is fully documented so yes you can reference a LabVIEW array in the C DLL.

 

But doing it parallel to execution in the LabVIEW diagram is NOT a viable option since LabVIEW controls the lifetime of all its data dynamically and the pointer you pass into the DLL is only guaranteed to exist for this particular instance until your Call Library Node returns to the diagram. After that LabVIEW reserves the right to resize, modify, reuse or entirely deallocate the array whenever it feels like that would be useful. There is no reliable way to tell LabVIEW that the data array is still referenced in the DLL and that it needs to treat this data block as being locked.

 

If you need to have data blocks available in the background while your DLL already returned control to the LabVIEW diagram you have to manage that data block on your own by creating it, managing it, filling it and eventually copying its contents into a LabVIEW data array. Nothing else will work reliably!

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(2,352 Views)