6 creating a step7 program, 1 accessing a drive via opc, Creating a step7 program – Lenze Drive Server Bus server S7 getting started User Manual

Page 30: Accessing a drive via opc, Busserver s7

Advertising
background image

Busserver S7

L

91

Busserver S7 DE/EN 1.0

5.6

Creating a STEP7 program

The Lenze function blocks can be integrated in different ways. For a simple test, the blocks supplied

in the SIMATIC Manager can be copied from the library to a new project.

Note!

If you have configured drive controllers in your project which are temporarily disconnected from the

mains, please observe the following:

Drive controllers which are completely disconnected from the mains and are fully de-energised,

are no longer recognised as PROFIBUS devices by the PLC. This can be prevented by supplying

the function block/fieldbus module with an external voltage.

Instances of the

FB DRIVE for disconnected drive controllers have to be skipped in the PLC

program.

A query can be performed via the status words of the blocks

FC91, FC92, FC93 or FC94. If

the status word of these blocks indicates ”0”, the drive controller is not switched on (or not

available) and the corresponding

FB DRIVE instance must be skipped.

(

^ 113)

If an S7-300 is used, you can address drive controllers which are directly connected to the PROFIBUS

master of the CPU card and drive controllers which are connected with an external PROFIBUS

communication processor (CP).

For this, please use the block

FB DRIVE CP instead of the block FB DRIVE.

In the first step, communication is to be performed via OPC with only one drive connected to the

PROFIBUS master of the CPU.

5.6.1

Accessing a drive via OPC

Tip!

You can use the provided example programs for initial commissioning. In this case, you only have to

adapt the hardware configuration to your system environment.

(

^ 87)

If you want to create a program on your own, you simply have to integrate the supplied blocks into the

SIMATIC Manager.

Proceed as follows to create your own program:

1. Create a new project with the block

OB1.

2. Select

File

W

Open, click Libraries and select the LenzeDriveServer.

In the new window, you will find all blocks contained in the “LenzeDriveServer” library.

3. Simply drag and drop blocks

FB90, DB80 and DB81 into your new project .

4. Call an instance of

FB90 in OB1.

When programming in IL enter the following program code:

CALL FB90, DBxxx

(xxx represents a free data block number)

This call automatically creates the data block.

5. Edit the list of transfer parameters.

Show/Hide Bookmarks

Advertising