Transfer data between Matlab and Step 7

princedx

Member
Join Date
Dec 2013
Location
HCM
Posts
49
Hi all
I have a problem with my thesis.
I need to transfer data from Matlab to step 7, does anyone have solution for my case ?
I use Step 7 with simulation ( not hardware), and i want to use data from matlab ( fuzzy PID) to simulation in step 7.
hope you can help me.
Thank you so much
 
There are at least three solutions:

1) OPC
Matlab -> OPC-Toolbox (as OPC-Client) -> OPC-Server -> PLC

If you are using Plcsim, you need an extra glue program called Nettoplcsim:
Matlab -> OPC-Toolbox (as OPC-Client) -> OPC-Server -> (nettoplcsim -> PLCsim)

OPC-Servers for S7 are not free of charge, you have to buy one.

2) Using Plcsim S7ProSim Interface
This is the official interface to S7-Plcsim. This is delivered as COM-Object. If Matlab supports COM objects, you can directly call this objects.
If not, Matlab supports to load dll-libraries. So you can encapsulate the COM-Object into a flat C-dll (have done this before).

The documentation of this COM object you can find in your Step7 installation directory (e.g. C:\Program Files\Siemens\Plcsim\s7manual\s7wsi).

3) Using free S7driver dll and use this with loadlibrary
There are free S7 communication libraries like libnodave or snap7. These are delivered as dll, which you could use from Matlab with loadlibrary.

If you want to use it with Plcsim, you need also nettoplcsim as glue program.

The data flow then would be:
Matlab -> loadlibrary (e.g. libnodave, snap7) -> (nettoplcsim - PLCsim)
 
There are at least three solutions:

1) OPC
Matlab -> OPC-Toolbox (as OPC-Client) -> OPC-Server -> PLC

If you are using Plcsim, you need an extra glue program called Nettoplcsim:
Matlab -> OPC-Toolbox (as OPC-Client) -> OPC-Server -> (nettoplcsim -> PLCsim)

OPC-Servers for S7 are not free of charge, you have to buy one.

2) Using Plcsim S7ProSim Interface
This is the official interface to S7-Plcsim. This is delivered as COM-Object. If Matlab supports COM objects, you can directly call this objects.
If not, Matlab supports to load dll-libraries. So you can encapsulate the COM-Object into a flat C-dll (have done this before).

The documentation of this COM object you can find in your Step7 installation directory (e.g. C:\Program Files\Siemens\Plcsim\s7manual\s7wsi).

3) Using free S7driver dll and use this with loadlibrary
There are free S7 communication libraries like libnodave or snap7. These are delivered as dll, which you could use from Matlab with loadlibrary.

If you want to use it with Plcsim, you need also nettoplcsim as glue program.

The data flow then would be:
Matlab -> loadlibrary (e.g. libnodave, snap7) -> (nettoplcsim - PLCsim)
"1) OPC
Matlab -> OPC-Toolbox (as OPC-Client) -> OPC-Server -> PLC

If you are using Plcsim, you need an extra glue program called Nettoplcsim:
Matlab -> OPC-Toolbox (as OPC-Client) -> OPC-Server -> (nettoplcsim -> PLCsim)"
Hi Thomas
I did it follow first option you gave me. But I still have small problem, hope you can share to me how i can fix it.
I do: Matlab transfered data to kepware OPC, it works find.
PLC Step 7 link to Kepware, OK too. But how can i transfer data of Matlab in KEpware to Step 7 ??
I know we can show that with advanced tags plug-in in Kepware, but i dont have this plugin soft, can you give me ideal for my case.
Thank alot and happy new year
 
I do: Matlab transfered data to kepware OPC, it works find.
PLC Step 7 link to Kepware, OK too. But how can i transfer data of Matlab in KEpware to Step 7 ??
I know we can show that with advanced tags plug-in in Kepware, but i dont have this plugin soft, can you give me ideal for my case.

I don't know how matlab as OPC Client does handle this. If you are using any Demo-OPC-Client, then if you write a value into a tag, then the OPC-Server will write this value into the PLC. Assuming the tag has write-access. The only area in a S7 which is read-only is peripheral inputs and outputs (PI/PQ).

I would do a test with a flag memory variable like MW100, because all S7-PLC do support this area. You set this value in your plc to e.g. 1234. Can you read this value in matlab? Then you write another value from matlab to this tag, and look in your plc program if this value has changed.
 

Similar Topics

Hi, If we have PLCs on different subnets is it possible to do TCP comms data transfer between them? I'm assuming if we use a routing switch and...
Replies
3
Views
813
Hello there, I'm trying to send the state of a single internal bit (B3:3/8) of my main ML1400 PLC to a different ML1400 over Ethernet using the...
Replies
4
Views
1,752
I need to get data from an MTS temposonics multi-magnet transducer to my motion controller. I think the best option, given the communications...
Replies
3
Views
1,829
Hi Guys, I am relatively new with the PLC's and even newer with A-B. I need to establish Ethernet communication between two controllers to...
Replies
3
Views
1,702
Hi... I m working with delta PLC. I can interfacing between Delta Software and Intouch Sw. Now I have to export the data(sensors values) of delta...
Replies
1
Views
3,338
Back
Top Bottom