Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Library Folder Structure

SYPT libraries are located in a libs folder under the SYPT installation folder.

For example, if SYPT is installed in:

c:\program files\control techniques\sypt

then all libraries will be held under folder:

c:\program files\control techniques\sypt\libs\

For each library installed in a SYPT installation there will be a separate folder under the libs folder. For example if there are two libraries - CTRDExampleLibV1 and KMSLRampLibrary, there will be two subfolders.

c:\program files\control techniques\sypt\libs\CTRDExampleLibV1

c:\program files\control techniques\sypt\libs\KMSLRampLibrary

SYPT will expect to find all material for a library within the library folder. If any extra help links have been specified in the properties for a function block in a library, the help material will be expected to also be located in the library folder.

See Also

  • Libraries

  • Creating a Library

  • Specifying a Library Description

________________________________________________________________________________

Viewing Library Properties

Library Properties can be viewed using the Library Manager.

To display the Library Manager within the DPL editor

  • In the DPL Editor Library menu choose Manager.

The Library Manager is displayed allowing the library proerties and the properties of the function blocks within the library to be viewed.

See Also

  • Libraries

  • Creating a Library

  • Specifying a Library Description

________________________________________________________________________________

Library Manager

The Library Manager is an independent application which can be used to view the descriptions and contents of SYPT libraries installed in a copy of SYPT.

To execute the Library Manager

Do one of the following.

  • From the Control Techniques group in the Program menu in Windows choose Library Manager.

  • In the Library menu in the DPL Editor choose Manager.

The Library Manager is launched.

  • The dialog shows a tree view of all libraries available in the SYPT installation.

By clicking on a library node in the tree, the description for the library can be viewed.

By clicking on a function block node, the description for a function block can be viewed together with the prototype/ syntax for calling the block in DPL and its data storage required in bytes, i.e. the number of bytes of RAM required for each instance of the block. If extra help was specified in the function block properties when the library was created, a link to the extra help file is also available.

The following functions are available via the menus.

See Also

  • Libraries

Referencing and Using a Library

To use function blocks in a library in another program, the program must reference the library. If the library was created on another machine in a different installation of SYPT, the library will have to be imported into SYPT before a reference can be made. SeeImporting a Libraryfor more details.

Note:

Libraries can only be used in programs compiled for SM-Applications and SM-Applications Lite targets.

To make a reference to a library

1. In the DPL editor, open the program which is to reference a library.

2. In the Library menu, choose Referenced Libraries.

The Library List dialog is displayed.

3. Add a reference to the required library.

4. Press OK.

The function blocks in the library are now available to the user program.

For an example of referencing and using a library see Using a Library Example.

Library List Dialog

The Library List dialog shows the SYPT libraries available on a PC and the libraries actually referenced by a program.

A library can be referenced by a program by selecting the library in the Available Libraries list and moving it to the Referenced Libraries list using the << button.

A library reference can be removed from a program by selecting the library in the Referenced Libraries list and moving it to the Available Libraries list using the >> button.

If a library is selected in either list, its details/ properties can be viewed by pressing the Library Details button. The Library Manager will be displayed showing details for the selected library.

Using a Library Example

This example uses the simple library created in Creating a Library. The example also assumes that the function block properties have been set as in the Function Block Properties Example.

The example assumes that the example library was created in the same installation of SYPT in which it is to be referenced, i.e. the library is being created and used in the same copy of SYPT. If this is not the case then see Exporting a Library and Importing a Library for instructions on how to export the example library from the copy of SYPT used to create the library and import it into the copy of SYPT where it is to be used.

To run the example, a Unidrive SP with an SM-Applications option will be required. The example will require that the program is built and downloaded to the SM-Applications module. Further information on how to build and download is given in the links at the bottom of the page.

Stage 1 - Create a new project in SYPT and add a reference to the library.

1. Create a new project in SYPT.

2. Add a Unidrive SP node with an SM-Applications option.

Since the example will go online, the details of the Unidrive SP and SM-Applications in the project should match those of the real Unidrive SP.

3. Double-click on the SM-Applications in the Hardware Architecture view.

The program is opened in the DPL Editor.

4. In the Library Menu, choose Referenced Libraries.

The Library List dialog is displayed.

5. Select the MyExampleLibV1 library and move it to the Referenced Libraries list using the << button.

6. Press OK.

The MyExampleLibV1 is now referenced and its function blocks can be used.

Stage 2 - Write the program which uses a function block from the library.

  1. With the program from the first stage still open, enter the following code into the Background task.

The Output Window should indicate that the program was built successfully.

3. Go to the Configuration Editor and with the Hardware Architecture view open, press F9 to go online.

If the drive and option details in the project match those of the physical Unidrive SP and SM-Applications both nodes should be successfully detected. The DPL editor will also go online and offer to download the new program.

4. Download the program to the Unidrive SP.

5. Ensure the program is running on the target by checking the program status in the DPL Editor status bar says Running. If the program is not running, press F3 to start it.

6. Select the variable c% in the program using the mouse. Hover the mouse cursor over the variable.

7. A tooltip will be displayed showing the value of c% which should be 50 showing that the _MyAverage function is being called.

8. In the Run menu choose Watch Window to open the Watch Window.

9. In the Immediate Window (bottom half) of the Watch Window, type #18.20 and press RETURN:

The Immediate Window will display the current value of parameter #18.20 which should also be 50 showing that the _MyAverage block is accessing drive parameters.

See Also

  • Libraries

  • Creating a Library

  • Viewing Library Properties

  • Importing a Library

  • Exporting a Library

  • Removing a Reference To a Library

  • Creating Projects

  • Inserting Nodes

  • Opening and Closing Programs

  • Going Online - Communicating with Targets

  • Building and Downloading Applications

________________________________________________________________________________