LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing to struct DLL only possible when cluster wired directly

Dear all,

 

We want to use a struct with a DLL. Now we bumped into the following issue; when I wire a control directly to the DLL everything works well, if I do this through a shift register or a local variable of the control the values are not passed to the DLL. 

 

I attached the code, Included is a project containing a VI which writes directly to the DLL and a VI which does this through a shift register. The point of interest is function A of this DLL. We init the DLL with init_A with itterate_A the function (now a place holder, square root) is executed. The function is now executed 3 times (placed it in a for loop). 

I included the VI's and DLL, the VI was written and tested in LV 2020. I'm certain I'm overseeing something here.I know how to create a work arround, so this is not the question, but I'm not confident to follow this path if I don't fully understand what is happening. 

 

Many greetings, 

 

Martijn

0 Kudos
Message 1 of 4
(859 Views)

Would it be a lot of trouble to backsave projects to an earlier LabVIEW version when posting them? I do not always have a computer available with the latest and greatest version installed when working on specific projects.

 

As Michael mentions, your event handling is rather questionable especially since you don't have any timeout event. That way the reading of your pasm control could have happened hours ago (after the loop iterated the last time because of an event).

 

And debugging of DLL problems without at least the header files AND some documentation about the function is about as simple as walking through a maze with a blindfold on.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 4
(747 Views)

Your init_A event has stale data for pasm in, as it's being read before the value change event executes. Moving it inside the value change event should solve the problem.

 

MichaelBalzer_0-1625553575484.png

 




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 4 of 4
(744 Views)