Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How can I use Oceanoptics Omnidriver .NET in Matlab ?

Subject: How can I use Oceanoptics Omnidriver .NET in Matlab ?

From: Lorenzo

Date: 19 Jan, 2012 10:08:09

Message: 1 of 3

Hi,

I would like to use the .NET capabilities of Omnidriver to control Oceanoptics spectrometers via Matlab. I have some problems in doing it in Matlab (2011b) while works perfectly in VisualBasic

In Matlab I use the command:
asm = NET.addAssembly('C:\Program Files\Ocean Optics\OmniDriver\OOI_HOME\netomnidriver.dll');

Then with the command asm.Classes I obtain the list of classes, for example: 'OmniDriver.NETWrapper'.

Then I try the command:
q=OmniDriver.NETWrapper

but I obtain the message:
Message: The namespace for the type 'Wrapper*' does not exist.
MATLAB requires all .NET types to be within a namespace.
Source: dotnetcli
HelpLink:

Any ideas or hint?

Subject: How can I use Oceanoptics Omnidriver .NET in Matlab ?

From: Marco

Date: 22 May, 2012 12:09:06

Message: 2 of 3

"Lorenzo" wrote in message <jf8q29$3g3$1@newscl01ah.mathworks.com>...
> Hi,
>
> I would like to use the .NET capabilities of Omnidriver to control Oceanoptics spectrometers via Matlab. I have some problems in doing it in Matlab (2011b) while works perfectly in VisualBasic
>
> In Matlab I use the command:
> asm = NET.addAssembly('C:\Program Files\Ocean Optics\OmniDriver\OOI_HOME\netomnidriver.dll');
>
> Then with the command asm.Classes I obtain the list of classes, for example: 'OmniDriver.NETWrapper'.
>
> Then I try the command:
> q=OmniDriver.NETWrapper
>
> but I obtain the message:
> Message: The namespace for the type 'Wrapper*' does not exist.
> MATLAB requires all .NET types to be within a namespace.
> Source: dotnetcli
> HelpLink:
>
> Any ideas or hint?


Hello, very same problem here
where you able to have the spectrometer working under matlab?
If so I'm very interested in knowing if you use a 64 or a 32 version of matlab and which version of Omnidriver (32bit, 64bit) you installed.

Cheers

Marco

Subject: How can I use Oceanoptics Omnidriver .NET in Matlab ?

From: Sven Holcombe

Date: 6 Aug, 2012 19:32:06

Message: 3 of 3

"Marco" wrote in message <jpfvl2$6j7$1@newscl01ah.mathworks.com>...
> "Lorenzo" wrote in message <jf8q29$3g3$1@newscl01ah.mathworks.com>...
> > Hi,
> >
> > I would like to use the .NET capabilities of Omnidriver to control Oceanoptics spectrometers via Matlab. I have some problems in doing it in Matlab (2011b) while works perfectly in VisualBasic
> >
> > In Matlab I use the command:
> > asm = NET.addAssembly('C:\Program Files\Ocean Optics\OmniDriver\OOI_HOME\netomnidriver.dll');
> >
> > Then with the command asm.Classes I obtain the list of classes, for example: 'OmniDriver.NETWrapper'.
> >
> > Then I try the command:
> > q=OmniDriver.NETWrapper
> >
> > but I obtain the message:
> > Message: The namespace for the type 'Wrapper*' does not exist.
> > MATLAB requires all .NET types to be within a namespace.
> > Source: dotnetcli
> > HelpLink:
> >
> > Any ideas or hint?
>
>
> Hello, very same problem here
> where you able to have the spectrometer working under matlab?
> If so I'm very interested in knowing if you use a 64 or a 32 version of matlab and which version of Omnidriver (32bit, 64bit) you installed.

I also have this problem. I have a different .dll assembly (OpenNURBS). I can "add the assembly" such as:

ON = NET.addAssembly(dllFile)

which returns

ON =

  NET.Assembly handle
  Package: NET

Properties for class NET.Assembly:

    AssemblyHandle
    Classes
    Structures
    Enums
    GenericTypes
    Interfaces
    Delegates


On my home laptop (win7, 32bit, 2012a), I can use any of the classes of this assembly successfully (eg, the command "RMA.OpenNURBS.On3dPoint" runs).
On two other machines (desktop machine winXP, 32bit, 2012a and desktop machine win7 64bit using 64-bit .dll file on 2012a) however, I get the same error as being reported by Marco and Lorezo:

Message: The namespace for the type 'ON_3dPoint*' does not exist. MATLAB requires all .NET types to be within a namespace.
Source: dotnetcli
HelpLink:


Can anyone help us troubleshoot?

Thanks,
Sven.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us