From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Memory Management using Call Library Function

Solved!
Go to solution

Yes the boolean about "data includes array or string size" needs to be set to false. I forgot that as I could not run the code because of missing DLL.

 

And from looking at the Visual Studio solution file for your example program I do see that you target x64. So assuming you try to use the same DLL for LabVIEW, you must have LabVIEW 64 bit installed. And as I did mention in the post where I showed the possible solution, for 64 bit you have to make several extra changes, to make it work. You probably overlooked that or hadn't even realized you were actually running 64 bit LabVIEW.

Rolf Kalbermatter
My Blog
0 Kudos
Message 21 of 26
(594 Views)

I have LabVIEW 64 bit installed but I use the 32 bit version exclusively. I am pretty certain I've been using the 32 bit DLL for the call library function. I'll try to make the changes you suggested and use the 64 bit DLL and corresponding LabVIEW version to see if that works.

0 Kudos
Message 22 of 26
(589 Views)
Solution
Accepted by topic author JustinB_Everix

This is a variant that "should" work for both 32 bit and 64 bit LabVIEW.

Rolf Kalbermatter
My Blog
Message 23 of 26
(583 Views)

@JustinB_Everix wrote:

I have LabVIEW 64 bit installed but I use the 32 bit version exclusively. I am pretty certain I've been using the 32 bit DLL for the call library function. I'll try to make the changes you suggested and use the 64 bit DLL and corresponding LabVIEW version to see if that works.


If you get it wrong, it won't run. You'll get a broken arrow if you try to load a 32 bit dll in LV 64 bit, or vice versa. So, if the dll loads, it's the right one.

0 Kudos
Message 24 of 26
(572 Views)

So the changes you made are working, thank you for your help!

 

So it looks like you added extra bytes to each config value (IP/Port/Com Name) to ensure the total string sent have the expected amount of bytes for the compiler. 

 

I'd like to get better at interfacing with external programs, is there any literature you'd recommend? Obviously, I need to get a better understanding of the basics of compilers and DLLs.

0 Kudos
Message 25 of 26
(564 Views)

@JustinB_Everix wrote:

I'd like to get better at interfacing with external programs, is there any literature you'd recommend? Obviously, I need to get a better understanding of the basics of compilers and DLLs.


I think you're beyond the level of the standard literature. This is hard stuff, you'll learn mostly by experience. IMHO.

0 Kudos
Message 26 of 26
(546 Views)