Communicating with WAGO from Matlab

D

Thread Starter

ddunnett

My first post! Here's the task: I want to communicate with a WAGO Fieldbus Controller from Matlab. I want to be using Matlab for data acquistion during some laboratory experiments.

I see two options:

1) Use the OPC toolbox. Setup a WAGO OPC server, then talk to the server from Matlab

2) Compile a dll from a free implementation of Modbus/TCP. Open a TCP connection in Matlab (using the Instrument Control toolbox), then load up the dll, and call its functions to communicate directly with the device.

The first seems easier, but pretty clunky. The second is more direct, but I'm not sure if it is possible, or wise. I'm very familiar with Matlab, but I have never used modbus for anything before. Your advice is appreciated!
 
K

Ken Emmons Jr.

Hello,

I believe that most OPC servers are polled with a fixed frequency. I've had some experience with SCADA systems that could not update IO faster than 250ms. I don't know if Wago OPC is like this.

Modbus would potentially give you update speeds that are faster, but it depends on the code and the device (I would think Wago is fast).

If you are doing anything where the period of the samples is needing to be steady (Sampled data system) faster than 1 second or so you might rethink this approach and use a PLC or other "hardware" device to buffer the data.

In general I think added layers such as OPC servers hinder performance significantly and hide critical details related to how and when the data is gathered. If you only gather information when it is needed you are better off.

KEJR
 
Automated Solutions offers several off-the-shelf Modbus connectivity solutions (ActiveX Controls, Class Libraries, OPC Servers, etc.) that should work with Matlab.

Go to http://automatedsolutions.com for Technical Support phone number. Call to discuss requirements with a Support Engineer.
 
I can't help you with Matlab, but if you want an alternate approach to the problem you might considering doing it with Python.

1) The Python programming language "http://www.python.org/".

2) For a Modbus/TCP client - "http://sourceforge.net/projects/mblogic/". You would want the "mblibs" package, which contains "SimpleClient".

3) For numerical functions, you would use the "numpy" and/or "scipy" modules. "http://numpy.scipy.org/", and "http://www.scipy.org/". If you are using Linux, these should be already in your distro's package repository, so you would just install them from the normal package manager menu (e.g. Synaptic for Ubuntu). For MS Windows you would download an installer from the web site.


All of the above are free.
 
T

Tallak tveide

Hi. I would also think about performance requirements before using matlab for sampling.

The quickest route for you i believe is to use modbus (open source). You should be able to interface the java library seamlessly from your matlab scripts.

Tallak
 
T

Tallak Tveide

Hi - sorry about all the typos... wrote that on my phone with norwegian spell checker.

I am recommending using the JModbus library. an open source project at http://jmodbus.sourceforge.net/. I won't comment on whether this product is good enough for a real application, but it should suffice for any testing purposes.

Tallak
 
Hello all,

can anyone help me to result this problem ;
I have a wago-I/O-system 750-301 and ichanged a new analog module 750-474 by a newone but i cont configure this module.

thanks for your help to result this problem.

Best Regards,
Souiry
Shami [at] hotmail.com
 
Top