04-16-2021 01:03 AM
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
07-06-2021 12:44 AM
Hi,
Look at the following forum
https://forums.ni.com/t5/LabVIEW/dll-struct-to-LabVIEW-cluster/td-p/2234178
07-06-2021 01:36 AM - edited 07-06-2021 01:54 AM
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.
07-06-2021 01:40 AM
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.