Controlling a MM440 drive with Visual Basic

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
Hi,

I want to control a MM440 frequency drive from siemens. The Master is a 315-2DP PLC. The drive is coupled on profibus.

I have Simatic Net installed and The WOrkstation is configured, but I didn't check the data yet in OPC Scout.

I want to connect my laptop on profibus and use some scada with visual basic and the OPC server.

I have tried to program something, but now; how can I throw my value 0-100 to a DBx.DBxx.x or Merkerword and how can I send the start bit ?
How can I get the actual speed; same problem; I need to read to a DB, but does anyone has an example of how it's done ?
 
Hello Combo;

Have a look at the Downloads section of this forum (look at the menu bar under the Thread banner). You will find in the Siemens section a zipped project named MM4_Prof. Study it. Also, look at previous threads on Siemens drives on the forum.
In order to control a drive over Profibus, you must first understand addressing of the drive and PPOx profiles(this determines the amount and type of data to be exchanged between the master and the slave MM4 drive). You must also know where to write the speed setpoint and the bitwise command word (start/stop/ jog) [this is where Profibus configuration and addressing come in].
Once you understand the basic scheme, all you will need to do with your VB application is read/write correct values to the specific memory locations reserved for the drive.
Hope this helps,
Daniel Chartier
 
well

well, I know the PPO types.

I use PPO1

My problem is related in Visual Basic and OPC

In the PLC my actual value is written in DB10.DBW20
The setpoint is written in DB10.DBW30

The on/off bit = DB10.dbx10.0


My problem is that I never worked with OPC, I don't know how to read and write data from a PLC in a Visual Basic program...
 
Hello combo;

In the same Downloads area (Siemens) you will find a document by seppoalanen called How to set up OPC with Simatic Net. It should help you with the first part of your problem. I am not able to help you with the VB programming side, but other ressources here can probably point you in the right direction once comms have been established with the OPC client.
hope this helps,
Daniel Chartier
 
Ahem, that guide is by ME !

Oh never mind.
I have a few comments in addition to the instructions in the guide.

1. Because you want to have everything on the same Profibus net (PLC+HMI+MM440) I suggest that you do the whole thing as an "integrated" project in STEP7. The example in the guide assumes an online connection (MPI or Profibus) with nothing else on the network (no slaves), so it doesnt cover this situation.
The reason why this is important is that, for each master, the socalled "token rotation time" must be calculated. By integrating this into one project, this will be done automatically.
Sidenote: You have the option of either letting your PC be a Profibus slave or a Profibus master.
The easiest is to let it be a master, however this (multi-master) makes the entire Profibus network work slower by a factor 3-10. It may not be important at all as Profibus is quite potent at the typical 1.5 Mbaud. It may also be critically important. You decide.
You can also set the HMI up as i slave. For the 315-2DP the HMI will then appear as regular i/o on the network.

2. You CAN let the MM440 be controlled directly from the HMI software. But the "classical" approach is to let the PLC do all the interlocking and control, and let the HMI only be a kind of "pushbuttons and lamps" on a PC.
Good luck.
 
Hello Jesper;

Sorry about the misquote. By the way, the guide is remarquably well done and complete. Good show once again.
Later
Daniel Chartier
 
Hello again combo.

It just occurred to me that the 315-2DP has an MPI port as well as the DP port.
You may want to connect your HMI PC via the MPI port and not the DP port, in that case the guide is quite complete.
I normally recommend to split i/o networks and higher level networks from each other. That mans that a goofup on one network will not lay waste to the other.
Of course the major disadvantage is that the MPI port on this CPU is limited to 187.5 kbaud.

edit:
Dont worry Roy, err.. I mean Daniel. ;)
 
Last edited:
visual

I know I can work integrated, and that an HMI device is a solution for controlling and reading variables.

But it's not a project, just a little test, I really want to control it with my written Visual Basic application. But what should I write i the code

OPC is configurated.
 

Similar Topics

Compactlogix controller, program has 28 conveyors that use TON's to start the conveyors. The TT sounds a warning horn during start and the DN...
Replies
7
Views
160
I'm a Manufacturing Engineer with limited PLC experience and I am doing some research for our Controls Department. Does anyone have experience...
Replies
4
Views
161
Good Evening , I should know more about Solid State Relays . I have a system with 8) 120 vac Vibrators . These Solid State Relays have...
Replies
24
Views
1,954
Hi All, I am facing one issue with the SEW MDX61B drive. Issue- I want to run a conveyor with this drive in two directions but it runs in...
Replies
0
Views
315
More help again please... See the picture. I want to make the rectangle visible when Mr_Zr_ToggleSwitch is 1, and make it invisible when 0...
Replies
5
Views
2,428
Back
Top Bottom