Jump to content

Conditional disable structure for shared library calls 32 and 64 bit


Recommended Posts

Hi

I am looking for an efficient solution to create a VI library for LV 32 and 64bit, that uses a dll. I spent about a day now without success..

I am cretating the library with LV 2019 and saving it for LV 2013 to have it available for older LV versions. The dll has the same name in 32 and 64 bit version.

I am using the conditional disable structure to detect if it is LV 32 or 64 bit in the code. In the structure are 2 call library function nodes. One for 32 and 64 bit version of the dll. The dll is in a subfolder of the VIs. The VIs are organized in a lvlib. I also added the dll to the lvlib. So all the information is there..

- First I configure the call library function node in LV 32 bit.
- Then I save all and close LV.
- Replace the dll in the folder with the 64 bit version.
- Then open LV 64 bit and configure the second CLFN
- Save all
- Then save the whole LV project for LV 2013.
- Then change the path to my current LV project. Otherwise LV 2013 would just use dll from my LV2019 project.
- Go to the location of the LV 2013 project. Raplace the dll with the 32 bit version
- Then open LV 2013 project in LV 32 bit.
- Open a VI that calls the dll and get the search dialog saying it cannot find the dll
- When looking into the CLFN, I see the the absolute path to the dll in my LV 2019 project is saved in the path field.

I tried using a relative path in the CLFN path field, but it always replaces it with the absolute path. Just setting the dll name is not an option, because I need that the dll is automatically put in the data folder when building an exe.

I think the problem is, that the CLFN nodes are messing with the information put into the path field. If I could enter a relative path, that is not replaced with an absolute path it should work.

Did anybody go through the same pain here? I really want to avoid having two VI sets for the library for 32 and 64 bit.

Thanks

 

 

 

 

 

 

 

Link to comment
39 minutes ago, D. Ackermann said:

I tried using a relative path in the CLFN path field, but it always replaces it with the absolute path.

From my own experience with CLFNs, if you set "Specify path on diagram" checkbox in the CLFN's settings, LabVIEW always uses the path from the diagram and never uses the path from "Library name or path" field. When you set that checkbox everywhere, all you need is to construct proper path for both 32 and 64 bits and pass it into your CLFN(s). Here's the article, which may help: How to Configure LabVIEW to Use Relative Paths for DLLs?

Another option for you might be using of an asterisk in the library name to distinguish between 32 and 64 bits. Refer to Configuring the Call Library Function Node article and look for how to use the * wildcard.

Edited by dadreamer
Link to comment

Yes, I thought about both options before. Both don't really work for me.

If I use "Specify path on diagram" checkbox, the dll is not automatically put in the data folder when building an exe.

And it is actually not one dll. It is multiple dlls from another company. The dlls have linkage between them. So I cannot change the naming.

 

Thanks.

Link to comment

Ok, I just found out, that if I add an additional step of pointing the CLFN to the dll again in LV 2013 and saving the project. Opening the project in LV 2019 from a different location works for LV 32 and 64 bit.

So I guess the problem is somehow conencted to saving the project for previous version.

I can live with this..

 

Link to comment
30 minutes ago, D. Ackermann said:

If I use "Specify path on diagram" checkbox, the dll is not automatically put in the data folder when building an exe.

All the DLLs may be added into the project manually (by RMB click -> Add -> File) and in the build spec's on the Source Files tab the DLLs should be put into Always Included category. When the build finishes, you will have the DLLs in the 'data' folder. Just tested with a trivial project and it worked fine.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.