Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when compiling into DLL

I am trying to compile a VI into a DLL to be called from a C++ program.  I have done this before in Labview 8.6 and it worked perfectly.  I am now trying to do it in Labview 2010 and I am having problems.  The VI I am trying to compile is very simple.  It simply turns on a digital I/O port on a DAQ card (NI PCI 6229) in the computer.  There are no inputs or outputs.  There is nothing wrong with the DAQ card, since it works fine with everything else.  I can compile the VI into a DLL, but when I try to call it in C++, I get the error "Runtime Error! R6030 - CRT not initialized."  This happens even when I try to run it on a computer without any DAQ cards in it. I can compile the VI into an application and it runs just fine. I have attached the VI I am trying to compile.

 

Also, I have noticed that when I create a VI that does have inputs and outputs, when I go to generate a DLL, the application builder does not give me the option to put them in my C++ function. It just makes it "void application(void)."  I am not sure if these problems are related, but any help would be greatly appreciated.

 

Thanks,

 

-Eric

0 Kudos
Message 1 of 12
(4,841 Views)

As an update, I have gotten the input and output to function.  I was not declaring the terminals correctly.  I tried a very simple program, takes in a number, multiplies by 2 and returns the new number.  I still get the error "Runtime Error! R6030 - CRT not initialized" when calling it from a C++ program.  It is therefore not a DAQmx problem, which I thought it was.  I still do not know what is wrong though.

 

-Eric

0 Kudos
Message 2 of 12
(4,834 Views)

Good afternoon Eric, 

 

You are correct that this is not a DAQ issue-from what I can find, it seems to be related to the CRT startup code is not executing. You may want to continue searching for this error on Google, but I found a good resource for starting trouble-shooting:


Explanation of the Error

 

Possible Solution: uninstall Norton and Girder, reinstall Girder (see post 15 on this page)

 

In Depth Suggestions

 

Good luck!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 3 of 12
(4,819 Views)

I actually ended up reinstalling Labview 8.6.1, the version from before that it worked in.  Everything works perfectly in this version now.  I have the DLLs I need for now.  I will look into the problem with Labview 2010 when I get more time to do so.

 

-Eric

0 Kudos
Message 4 of 12
(4,817 Views)

Hi Eric, 

 

Glad to hear that you got it working. When you get the chance to look further into this issue, please post back. Thanks!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 5 of 12
(4,804 Views)

I have this same problem and have previous versions installed. Debug code works fine but release gives me the following:

error

 

Any ideas?

0 Kudos
Message 6 of 12
(4,685 Views)

Hi tojoshua,

 

This is a Microsoft error. Take a look at the Microsoft Discussion Forums, like this thread for more information. Hope this helps!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 7 of 12
(4,669 Views)

kgerret,

   Thanks for the reply. This error would not occur unless I called the labview function. If I commented out the function everything would run fine. I finally managed to get it to run in release mode but as many software fixes don't know exactly which step resulted in the fix. 

   I went ahead and installed labWindows/CVI in hope that one of the drivers would fix it. I tried delayed loading of the library I built with LV but that didn't work. Then I rebuilt everything and it finally worked. I also changed where I add the library file but I am at a loss as to which fixed it. Anyway, it works now with labVIEW 2010 and Visual studio 2008. Attached are my project settings (which can be opened in notepad - changed .vcproj file extension to .txt) if this helps anyone.

Thanks,

Joshua

0 Kudos
Message 8 of 12
(4,663 Views)

Hi Tojoshua,

 

I have the same problem with yours. I bluilt a dll in labVIEW 2011 and called in Visual Studio 2008. In debug mode it worked very well, but in the release mode the same error occured.

 

I am not familar with both labVIEW or VS, could you go into detail about how you made it works, like:

 1, what you rebuilt, the dll or the vc code?

 2, how you changed where the library added?

 3, labWindows/CVI is costly, and I am working on laptop from school which not allow me to install new softwares.

 

Thanks for any comments and information.

 

Sample

0 Kudos
Message 9 of 12
(4,630 Views)

In the previous post, I attached my vs settings file - you can open it in a txt editor to see my settings for visual studio and try to match them up. 

 

Before doing that try rebuilding everything in release mode. This deletes all the temp files and binaries and rebuilds them. I think what may have happened is that when I built it in debug mode is used a debug dll and when I run it in release mode - instead of building or using a release dll it tries to use the debug dll and gives an error. 

 

To do this in VS just open the solution, then go to Build -> Rebuild Solution or hit ctl+alt+F7.

 

Let me know if this is all it was.

 

Thanks,

Joshua

0 Kudos
Message 10 of 12
(4,628 Views)