Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading value from NI OPC Server using Matlab ActiveX interface.

I use MAX and LabWindows/CVI for doing almost all of my development.
Recently I wanted to run a model in Matlab and read the data from NI OPC server.
I do not have the Matlab OPC Toolbox installed.

I am running MAX 3.1.1.3003, and CVI 7.1 on Windows 2000.
Matlab is R12.1 (6.1.0.450)

I can connect to the NI OPC server using Server Explorer and I can add a group,
and values, and examine the virtual channel I have created in MAX (A test analog input).

I expected to be able to use Matlab's activex interface as such:
da = actxserver("National Instruments.DaqOpc");
methods(da);

However the actxserver command says:
??? National Instruments.DaqOpc : No such interface supported

The ProgID is correct, but server reports that no such interface is supported. I expected that the
DaqOPC by default would need IUknown or IDispatch.

Do I understand what I'm doing or have I left something out completely?

Cheers,
Carlos.

0 Kudos
Message 1 of 4
(4,709 Views)

Hi Carlos-

We haven't really tested with ActiveX for OPC access in Matlab so I can't offer many suggestions there.  The best suggestion I can give is to use their ready-made OPC toolbox, but I realize that may not be a possibility.

In browsing the internet for alternative OPC access methods through Matlab I found this toolbox from the OPC foundation.  It may be useful, but if you have specific questions about accessing OPC information in Matlab you might want to check with The Mathworks for information.

If anyone else has any suggestions please feel free to help out!

Thanks-

Tom W
National Instruments
0 Kudos
Message 2 of 4
(4,692 Views)
I tried to connect to NI OPC server using Matlab OPC toolbox.When i click connect in OPC toolbox in Matlab I've got the following error when it tried to connect:  Class is not licensed for use
My question is about the compatibility between Matlab OPC toolbox and National Instruments.NIOPCServers 
Thanks,
Stephen82
0 Kudos
Message 3 of 4
(4,460 Views)

Hello Stephen82,

 

You said that, "When i click connect in OPC toolbox in Matlab I've got the following error when it tried to connect: Class is not licensed for use."  This leads me to believe that you are experiencing a MATLAB licensing / activation issue.

 

I do not have specific information regarding LabVIEW's compatibility with MATLAB.  From the OPC Toolbox 2.1.3 homepage, "You can read, write, and log OPC data from devices that conform to the OPC Foundation Data Access standard."  The NI OPC Server conforms to this standard.  As such, I would not expect any specific issues to arise from a MATLAB to NI OPC Server setup.

0 Kudos
Message 4 of 4
(4,449 Views)