LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Labview 8 with MS Visual Studio .net 2003 to create .lsb file

Hi and thanks for joining us!

As I already said this issue has nothing to do with the stuff I might do wrong in my CINs. I downloaded the sample project from SachaE attached to the thread. Within it was a VI that already contained the CIN with code. I just opened it using LV 8.20 and again was greeted by the already familiar error message. I then reloaded the *.lsb file which was also part of the zip achieve and got the same error again.

Afterwards I did some reading to make sure I did understand the manifest stuff correctly. However the manifest file (at least in this sample) will be embedded into the CIN thus everything should be fine even if I am still sure that we don't need a manifest file here, but this is a different story...

I then recompiled the lsb file and got the same error again after reloading it in the CIN.

I tried to run sysinternals debug viewer but the only message I got from the LV environment was 'CGenSchedulerEvent::ResetRunFuncs' which will be of now use and probably is just a debug message from a C++ class inside LV that by accident made it in the release build.

Did the sample from SachaE run on your WinXP machines using LV8.20? If so where can be the difference? I logged in as an Admin and I am also deeply lost....

Regards,

Stefan

0 Kudos
Message 21 of 33
(1,798 Views)
Well, I tried testing it on my Vista development box w/ VS.NET 2005 and LV 8.20 released version and it worked fine. I tried changing between the release and debug versions, but they both loaded and ran fine.
 
I'm installing the release build of 8.20 on my XP box now, so we'll see if that makes a difference. One other suggestion would be to install filemon from www.sysinternals.com and run it just before you load the VI for the first time (don't run it before that - it'll log pages and pages of stuff). However, that should capture the various probing around the file system that Windows is doing in trying to load the LSB and the various DLL dependencies. It might narrow down the problem...
0 Kudos
Message 22 of 33
(1,788 Views)
I just download LabVIEW 8.20, and SachaE's SampleCIN2005.zip, test sample CIN.vi is broken, same as anotherSt…'s screendump.JPG.
I skipped .net framework when I install 8.20.  Could this be the problem?
 
George Zou
0 Kudos
Message 23 of 33
(1,781 Views)
Okay, I'm not sure what is going on. It works fine for me on both my XP and Vista boxes...
 
You haven't skipped the .NET install if you have VS.NET 2005 installed - it installs .NET 2.0 automatically. It's a required component. And none of this is actually .NET related - the winsxs assembly is for non-.NET code.
 
I'd recommend using the filemon tool from www.sysinternals.com to report back what is failing on your side. I've attached a screenshot of mine to show you what it "should" look like. The tmp file it's reading is something Windows is doing, but it contains the manifest from the LSB...here is the relavent bit from the file
 
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>
0 Kudos
Message 24 of 33
(1,781 Views)
Zou, I also noticed you didn't say you installed VS.NET 2005. If you haven't done that, I'm not surprised it isn't working. Because it's just a zip file, there is no installer to included the C Runtime DLLs that it needs. Because these are new DLLs, it's unlikely they are on your machine. If you install VS.NET 2005 w/ C++ support, then they'll be installed.
0 Kudos
Message 25 of 33
(1,776 Views)
One other thing - go to your WinSXS directory and see if you have a directory
 
C:\WINDOWS\WinSxS\Policies\x86_policy.8.0.Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_x-ww_77c24773
 
VS.NET 2005 shipped with what I call a bug, although that is a matter of debate. The version of the CRT that shipped in WinSXS is NOT the same as the one VS.NET puts into your manifest. To fix this problem, WinSXS ships with a policy file (in that directory)
 
09/23/2005  08:29 AM             7,441 8.0.50727.42.cat
09/23/2005  08:29 AM               712  8.0.50727.42.policy
 
that tells the DLL loader (aka Fusion) that when the system asks for version 8.0.50608.0, it should instead load 8.0.50727.42. If that policy file isn't there or is corrupted, then it won't load.
 
Something else to check.
0 Kudos
Message 26 of 33
(1,776 Views)
Hi,

I think we are finally getting somewhere!Smiley Happy I will attach the *.log from filemon to this post (sorry it's quite long, but I promise I cleared the *.log-output just before clicking the load button for the vi (still the one from SachaE)). It indeed logs errors related to the runtime libs and files that can't be found. However I am not quite sure what these messages tell me.

Another thing for clarification: I also did NOT have the .NET 2.0 or 1.1 framework installed on the system I run my tests (however I have now, but this didn't change the situation) as I never run tests on my development machine but on a clean system (this means in our case a 'clean' XP with SP2 and all patches, LV 8.20 and the vi from this post.

I also had a look on the policy stuff you mentioned but gave up. Whatever this might have to do with our problem I don't get it...

The C-runtimes for VS 8 (aka VS 2005) are also NOT installed on the target system, but the DLL that will be converted into the LSB file by lvsbutil is NOT linked against them so there should be no need for there presence.

Can you please have a look in the attached file an run your tests on a clean system. I think this is the situation most customers will have as well.

Thanks for the ongoing help.

Regards,

Stefan
0 Kudos
Message 27 of 33
(1,751 Views)
I really don't understand your reasoning for going with CINs on this anymore!

You say that you would get problems when using your C++ interfaces from a DLL due to compiler differences. While I understand that compilers do have different ways of linking C++ code, I do not understand why this would be a problem with DLLs and not with CIN's as long as you restrict your DLL build toolchain to the same compiler environment you use to create the CIN code. Yes you can not directly call C++ dlls from the Call Library Node but you can create an intermediate DLL that translate the C++ object methods into standard C functions and then call it that way.

What would be the advantages of doing this you ask?

1) you have only one DLL to create instead of many CIN code resources.
2) Modifications to the DLL do not require you to go into every single VI and reload the code resource into a CIN. In fact as long as a specific function is not altered at all in respect to its interface you do not ever have to touch the according VI at all anymore.
3) If you use cdecl as calling convention you can create a project that compiles on multiple platforms and provided you maintain the same function interfaces for all platforms you can use one single VI interfacing to the different DLLs/shared libraries on all the different platforms without one single manual operation in LabVIEW. You just name the library file in the Call Library "myname.*" and LabVIEW will look and dynamically load and link to the appropriate shared library/DLL on that platform.
4) Testing DLLs is much easier as you can use standard envrironments  to drive those tests.
5) A LabVIEW compatible DLL interface is virtually 100% compatible with almost any version of Visual Basic and other similar development environments.

So why spend any more time in trying to get CIN issues resolved with every new version of Visual Studio as it generally breaks due to different parameter settings and difference in custom build step handling?

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 28 of 33
(1,745 Views)
Hi,

you have a point there. However as I already pointed out I have a solution that works for me anyway thus in general this problem is solved. When I find time and motivation I might also convert all the CINs into a DLL and use Lib Nodes rather then CINs which as you correctly pointed out are in the long term easier to maintain etc.. However this is hardly the point in this thread.

As far as I understand you, you are suggesting to leave this issue unsolved as it starts to cost more time then there will be benefit. I also agree with that. I just thought that as far somebody thinks this problem is worth solving it is just fair I at least provide them with the information they need...

So again: If you(all) think 'let's leave it as unsolvable' I am fine with that.

Regards,

Stefan
0 Kudos
Message 29 of 33
(1,742 Views)
Okay, we have progress! I hadn't realized that you were doing this on a clean machine, and that makes a big difference.
 
Summary: You have not installed the runtime dependencies on your clean machine. You need to run the C/C++ runtime installer. This isn't a CIN requirement, it is a requirement of just about any VS.NET 2005 C/C++ application. Note the same is actually true of earlier versions of VS - it's just that the runtime was likely installed by some other application as just about all apps on Windows are C/C++. 2005 is just too new for that.
 
You mentioned that your DLL isn't linked against the runtime libraries, but it most likely is. It's just about impossible to create a C/C++ DLL that doesn't need the C or C++ runtime libraries (for example, if you put a try/catch block in, call new/delete, etc. you need the libraries).
 
Now, I also can't find the web page, but I have a memory of reading something that said the new WinSxS system requires the .NET framework to be installed. There is some dependency on a component that ships with it. The above installer may include the dependency or it may not. So I'd recommend installing the .NET 2.0 runtime as well as the C/C++ libraries above. You can always experiement to see if .NET is actually required.
 
Let me know if that makes a difference.
 
0 Kudos
Message 30 of 33
(1,736 Views)