View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
OPC Server/Client Demo

Be the first to rate this file! 14 Downloads (last 30 days) File Size: 9.7 KB File ID: #27788 Version: 1.1
image thumbnail

OPC Server/Client Demo


Vihang Patil (view profile)


28 May 2010 (Updated )

OPC toolbox and Kepserver (Server/Client Program)

| Watch this File

File Information

For this program to run, you will need to download Kepserver found at
After you have download and installed the KepServer, use the demo.opf file included in the as the default project in Kepserver.
Then run the opc_demo.m file, you will see how Matlab as an OPC Client communicates with this OPC server.
You can try different servers as well, such as Matrikon, Iconics, etc, but you will have to create your own server configuration files.
Next you can try connecting any PLC which are supported by Kepserver and try out PLC communication through Matlab.
There is also an inbuilt OPC Client in Kepserver which will reflect the same results as on this program.

The boolean output i.e the RED/GREEN toggle button o/p can be viewed on the OPC Client of Kepserver

Required Products OPC Toolbox
MATLAB release MATLAB 7.3 (R2006b)
Other requirements Kepserver found here (
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
27 Dec 2010 Radu Mihai

Hi, thanks a lot for posting this app!

I'm a student and my assignment is to create a simple OPC client/server application. So your example is great to make my own program from, but I have a problem with it, I figured you're the best person to ask, since you created it. I have kepserver running, and at runtime (clicking the cylinder button) matlab gives this error:

??? Reference to non-existent field 'data_itm'.

Error in ==> opc_demo>cylinder_Callback at 325
state = read(handles.data_itm(state));

Error in ==> gui_mainfcn at 96

Error in ==> opc_demo at 42
gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uicontrol Callback

The error is similar for the ejector device, kepserver fails to add any of the devices:

Date Time Level User Name Source Event
12/27/2010 6:59:11 PM 2 Default User KEPServerEx Attempt to add OPC client item 'Channel_0.Sine.Sine1' failed.

Could you please help me with this? Meanwhile, I'm continuing to search for solutions.

Comment only
20 Sep 2010 Ngo Huy

Hi everybody ! My name Ngo Huy . i am studient four year of Ho Chi Minh University of industry . I have a project graduated processor image (Product Classification in (closed chain stoppers)
help me . i use PLC s7200 , matlab 7.1

Comment only
28 May 2010 1.1

updated file

Contact us