LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the labwindows/cvi equivalent to the .net constructor node in labview?

Do you need the entire installer or just the assembly?

The installer is 141 MB.

Brian

0 Kudos
Message 11 of 20
(2,795 Views)

Also, I'm not sure if this matters, but I pointed directly to the assembly when using the .NET constructor, I couldn't find it in the GAC.

Brian

0 Kudos
Message 12 of 20
(2,792 Views)
The installer size should not be a problem. You can upload it to the NI ftp site. I just need everything that would be required to use that assembly.

ftp://ftp.ni.com/incoming

Thanks
Bilal Durrani
NI
0 Kudos
Message 13 of 20
(2,787 Views)

I've uploaded the file.  Its the Clear....zip

 

Thanks!

Brian

0 Kudos
Message 14 of 20
(2,784 Views)
I'm still investigating this, but as a workaround, have you tried using the COM interface their support mentioned? The .NET support they provide is basically a wrapper around their COM API and that might be more straight forward to use. If you can provide me with some information about their COM API (for example, do they have a type library I could use?), I can test it out. If they have a VB 6.0 or C++ example, that would help as well.





Bilal Durrani
NI
0 Kudos
Message 15 of 20
(2,768 Views)

Hi Bilal,

I'm pretty in the dark on how to interact with the COM API.  The only example they have given me is actually in matlab, where there is a builtin actvxserver function that creates aan activex server based on an id you give it of the object. (the id being 'ClearVu.ClearShotCamera')  I thought that I could use the activex wizard but the create server required files I dont' have, and the create controller didn't work because there is no server. 

They also suggested I try a queryinterface method call (available in microsoft compilers i guess?) and then write more code from there.  

0 Kudos
Message 16 of 20
(2,748 Views)

They also gave me this (although in my registry the id i find is different)

Other than that, I was given this (although in my registry the guid is different):

Full Com Interface:

      [Guid("6bf38cad-afa6-11da-958c-00e08161165f")]

      [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]

      public interface _ClearShotCamera

      {

            [DispId(1)]

            bool clearshot_Open();

            [DispId(2)]

            bool clearshot_Open(string szSerialNumber);

            [DispId(3)]

            void clearshot_Close();

            [DispId(4)]

            bool clearshot_TakeImage();

            [DispId(5)]

            bool clearshot_TakeDarkImage();

            [DispId(7)]

            bool clearshot_IsCameraOpen();

            [DispId(10)]

            double clearshot_GetExposureTime();

            [DispId(11)]

            void clearshot_SetExposureTime(double dExposureTime);

            [DispId(18)]

            bool clearshot_SupportsOnboardCalibrations();

....

i deleted most of the functions to fit the message

0 Kudos
Message 17 of 20
(2,743 Views)

You assembly is private (not in the GAC) and so its path must be registered with CVI before calling the initialize function (or any other wrapper function). You can register the path of the assembly as follows by calling the CDotNetRegisterAssemblyPath library function with the full name of the assembly - the full name of the assembly is available in the __assembly constant in the generated source code. Make sure you pass the appropriate path on your machine.

Centice_Spectrometer_Cameras_ClearShotCamera handle;
CDotNetRegisterAssemblyPath("Spectrometer, Version=0.0.58.30567, Culture=neutral, PublicKeyToken=49c4cf89e31b0bb4", 
    "c:\\Program Files\\Centice\\ClearVu\\Spectrometer.dll");
Initialize_Spectrometer();
Centice_Spectrometer_Cameras_ClearShotCamera__Create(&handle, 0);

  

0 Kudos
Message 18 of 20
(2,741 Views)

It looks like you needed to register the assembly befor using it since its not in the GAC. Add this call before you make any calls to the library


status = CDotNetRegisterAssemblyPath (
    "Spectrometer, Version=0.0.58.30567, Culture=neutral, PublicKeyToken=49c4cf89e31b0bb4",
    "c:\\Program Files\\Centice\\ClearVu\\Spectrometer.dll");

Bilal Durrani
NI
0 Kudos
Message 19 of 20
(2,724 Views)

Thanks guys, that was it!

Brian

0 Kudos
Message 20 of 20
(2,714 Views)