Fenix 3.0.0 - Manual

16
1 Fenix 3.0.0 Content Main view ........................................................................................................................................................... 2 Quick Start .......................................................................................................................................................... 3 Create project ................................................................................................................................................ 3 Add InternalTag ............................................................................................................................................. 4 Add Connection ............................................................................................................................................. 6 Add Device..................................................................................................................................................... 7 Add Tag .......................................................................................................................................................... 8 Editors ......................................................................................................................................................... 11 Script............................................................................................................................................................ 12 Update ......................................................................................................................................................... 12 ServerHttp ........................................................................................................................................................ 13 Main View.................................................................................................................................................... 13 Property Grid ............................................................................................................................................... 14 Prefixes .................................................................................................................................................... 14 Schema .................................................................................................................................................... 14 Users ........................................................................................................................................................ 14 Create Web Site........................................................................................................................................... 15

description

Fenix 3.0.0 - Manual

Transcript of Fenix 3.0.0 - Manual

  • 1

    Fenix 3.0.0 Content

    Main view ........................................................................................................................................................... 2

    Quick Start .......................................................................................................................................................... 3

    Create project ................................................................................................................................................ 3

    Add InternalTag ............................................................................................................................................. 4

    Add Connection ............................................................................................................................................. 6

    Add Device ..................................................................................................................................................... 7

    Add Tag .......................................................................................................................................................... 8

    Editors ......................................................................................................................................................... 11

    Script ............................................................................................................................................................ 12

    Update ......................................................................................................................................................... 12

    ServerHttp ........................................................................................................................................................ 13

    Main View .................................................................................................................................................... 13

    Property Grid ............................................................................................................................................... 14

    Prefixes .................................................................................................................................................... 14

    Schema .................................................................................................................................................... 14

    Users ........................................................................................................................................................ 14

    Create Web Site ........................................................................................................................................... 15

  • 2

    Main view

    1. Project TreeView

    2. Table View

    3. Code Editor

    4. Properties Manager

    5. Logging View

    6. Chart View

    7. Toolbar

    8. Strip Menu

    9. Status Bar

  • 3

    Quick Start

    Create project

    Open Fenix- you will get this window below. Label E shows with Fenix version you currently use. Fenix

    allows you to have few projects opened or created. You dont have any limit of amount of project inside

    manager. Recommended is using one project opened.

    The next step is to click on the button "New"(A) or if you want "File"->"New" from menu. You will see

    window (B). All input box with markers "*" are required- you must fill it. On window (B) youre going to

    find "Http Template"->"Add file" if you check it all files from "C:\Program Files\D.G\Fenix\Http" will copy to

    your project. These data were created to show information from communication on web browser. Default

    this field is checked. The installation path depends on operating system (XP, Windows7 etc.). If you fill all

    input data, you must click on "Save". Program will ask you about path, where you can save project. Good

  • 4

    practice is to create folder where you can save all project files. When you select the path, program will

    create project and all related structure.

    Double click on each node result the properties will be shown in Properties manager. You can edit every

    properties in Property manager. After filled out all the data, you can save project. Software will create files.

    File *.psf contains all informations about project.

    Add InternalTag

    InternalTags are created to make additional task. For example if you want to have a variable, which is a sum

    of two variables from the communication. To calculate value of InternalTag you use VBScript and Timers for

    trigger scripts.

  • 5

    Before you start working with InternalTag you must create timers for invoke triggering. You need to select

    "InternalTags" on TreeView and click twice, then take a look on the Properties manager. Click on field to

    add timers.

    This widow will be shown. One timer is created by default. Create the timer you need. Timers are using for

    cyclic invoking script. Period of cycle is equal written in Property manager value. There is possibility to delay

    invoking ( Delay [ms] ).

    When you create timers you can go to further. To add InternalTag you must select node "InternalTags" on

    TreeView and select menu "Add Internal Tag". This window below will be shown

    The most important thing is, that all name of tag (InternalTag and Tag) must be unique in one project. Fill

    all data in window. If you finished, then go to the TreeView and double click on tag what you have created.

    Then go to Properties Manager. In filed write script: [ GetTag("Tag1") + GetTag("Tag2") ]. Tag1 and Tag2

    now dont exist. We will create tags later. Function GetTag("name") get value (InternalTag or Tag) and

    result of this operation will be equal to value of InternalTag "sum". The important thing is to choose timer

    created before field (B). You will find you there list of created timers.

  • 6

    Add Connection

    Before you start you must know main concept about drivers in Fenix software. All drivers are independent.

    You can find all drivers (*.dll) in installation path. They have been created three drivers so far :

    ModbusMasterASCII.dll

    ModbusMasterRTU.dll

    ModbusMaterTCP

    To manage drivers in your system (add, remove) you must open from menu Drivers Configurator. You will

    find it on strip menu.

    The list shows all available drivers in the system. If you will click "Add Driver" the open file dialog appear,

    then you must select the right driver. Software check this driver and if everything is the way it should be,

    add it to software. You will find this driver on the list. To delete the driver you must select it from the list

    and click "Remove Driver". The next button "Reset" will clear configuration file for drivers. Configuration

    file is placed on the installation path folder GlobalConfiguration.xml. On next startup software will check

    configuration file .If it will be deleted, try to find all drivers in installation folder and add these founded

    drivers to your configuration. There is possibility to add/remove driver manually- you can use for that

    configuration file.

  • 7

    If all the drivers are chosen you can add new connection to your project. You must select the name of your

    project on TreeView and click "Add Connection", you will see the window below.

    If you added Connection later, you can use Properties Manager to edit these parameters.

    Add Device

    If you created connection you can add devices. Device represent on single slave with address.

  • 8

    You can add as many devices as permitted by the communication protocol. To add devices you need to

    select connection representation on TreeView and click add device. You must fill all data and click "Save".

    The device will be added.

    Add Tag

    The last thing is to add the tags. Tag is representation of part of memory of slave. Communication driver

    will be refresh this data and software will be convert it in to type of value. To add the tag you need to select

    the device that you want to add tag on TreeView.

    After this operation you can edit parameters used Properties Manager (double click on tag). During adding

    is several option. The most important:

    Add Range

    If you want to add range of tag you must check "Add Range" and select how many tags you want to add.

    Software create requested amount of tags and create new names ("Tag Name" + Number) and will create

    addresses (based on Data Type).

  • 9

    Bytes Order

    This option inform software how order bytes before conversion to Data Type. ABCD this is order it is given

    from communication.

    Data Area

    According the protocol (Coils, Holding Register etc.)

    Data Type

    You can choose variable type according standard. Software will convert the data from the communication

    to this type.

    [Important]

    You can find some other type ShortToReal. Its created for this kind of situations, when in Modbus

    register (16bits) represents variable for example: 106 this is not floating-point but in fact is 10,6. Normally

    if you use SHORT type and use script to convert this value (value / 10) you get 10 without decimal places.

    To solve this problem you can use ShortToReal and program get this value like SHORT (16bits) from

    communication then convert to REAL and then script will be invoke and you get 10,6 for display.

    Script Read

    This script is invoked after that, the driver refresh data and converts data into required "Data Type". The

    script work like below:

    value = f(script)

    Script Write

    This script is invoked after that, when you supply new value and before we send data to write on remote

    device. The script work like below:

    value = f(script)

    Back to our configuration

    We created two tags Tag1, ShortToReal, Holding Register and Tag2, ShortToReal, Holding Register. We

    suppose, that the data in registers for Tag1 are 0-500 and it represent 0-100% and data for Tag2 or 0-6789

    and it represents 0-100%. We use script to scaling this data for read and write on Modbus devices.

  • 10

    Tag1

    Tag2

    It gives you the possibility to operate in Fenix interface only in range 0-100%. You dont need to recalculate

    data to have right values. The next thing is to sum this two tags. To do this, you should use defined earlier

    IntranlTag sum. Below you will find the configuration of this file.

  • 11

    InternalTag: sum

    Editors

    Editors are created to interact with tags. To use the editors you must select node on TreeView and then

    select right editor. Fenix blocks start editors, which is not intended to selected node. Editors you will find

    on menus.

    The idea is to catch by the below selected node everything its possible. The range of selected node is

    shown on the picture.

  • 12

    Script

    Fenix is used VBScript to calculate values inside the software. The all documentation for VBScipt you will

    find on Microsoft page here:

    http://msdn.microsoft.com/en-us/library/d1wf56tt(v=vs.84).aspx

    Script engine uses one line statement and invoke it. Additionally we add some functions to simplify the

    work:

    1. GetTag(Name) return value of the tag.

    2. SetTag(Name,value) set tag value

    Update

    On startup software communicates with server and check actual version. If you dont have the actual

    version,the software will inform you about it. You will see the information below:

    If you will click yes, software will open web browser and redirect to page of the project. You will find

    there the actual version of Fenix. The second way, where you can check updates is Strip Menu.

    The window below will be shown. If you click update the web browser will be opened and provide you the

    website of the project, where you can download actual version of software. This link to project:

    http://sourceforge.net/projects/fenixmodbus/

  • 13

    ServerHttp

    HttpServer was designed to give possibility to observe data from communication by Web Browser.

    Main View

    A- Connection List in this control you will find basic status information about connections

    B- Properties Grid gives a possibility to change basic properties for server and communication

    C- Toolbar from this toolbar you can start/stop communication server

    D- Strip Menu Is used for main operations

  • 14

    E- Information Window in this control appears all the information messages from software

    F- Status Bar you will find information about everything what is happening in the project.

    Property Grid

    Prefixes

    Are used to gain access to the collection that holds the strings that specify, which Uniform Resource

    Identifier (URI) prefixes . A URI prefix string is composed of a scheme (http or https), a host, an optional

    port, and an optional path. The example of a complete prefix string is "http://www.dg.com:8080/data/".

    Prefixes must end in a forward slash ("/"). The ServerHttp object with the prefix that most closely matches

    a requested URI responds to the request. Multiple ServerHttp objects cannot add the same prefix; a

    Win32Exception exception is thrown if a ServerHttp adds a prefix that is already in use.

    When a port is specified, the host element can be replaced with "*" to indicate that the ServerHttp accepts

    requests sent to the port if the requested URI does not match any other prefix. For example, to receive all

    requests sent to port 8080 when the requested URI is not handled by any ServerHttp, the prefix is

    "http://*:8080/". Similarly, to specify that the ServerHttp accepts all requests sent to a port, replaces the

    host element with the "+" character, "https://+:8080". The "*" and "+" characters can be present in prefixes

    that include paths.

    Schema

    The ServerHttp uses the specified scheme to authenticate all incoming requests.

    A. Basic allow to get resources if you put the password

    B. Anonymous it passed without password

    Users

    Here you can add Users and their password.

  • 15

    Create Web Site

    Fenix gives you default web site, witch you can find in installation folder in Http. ServerHttp works like

    normal server and accepts all the requests. You can use all html and CSS and JavaScript files. SeverHttp

    accepts special Ajax request. In default files we used JQuery library to simplify the process.

    The code below scipt.js takes the data from server. It sends the mark @timer (red line) to ServerHttp.

    ServerHttp gives the response according the mark. Then the script puts value from server into

    (brown line) in index.html file. Id of the is Timer. All sequence is working on loop 1000ms.

  • 16

    The list of markers for communication with ServerHttp:

    Lp. Name Description

    1. @machine The name of the computer where ServerHttp is installed

    2. @timer Actual time where ServerHttp is installed

    3. @table Return table with all tags and their all properties

    4. @user User name logged in to the system when ServerHttp is installed

    5.

    @tag.name.properties

    Example:

    @tag.Tag1.value

    Return properties of the tag

    Lp Properties Description

    1. value value of tag

    2. name Name of the tag

    3. adress Address

    4. devAdress Device Address

    5. description Description

    6. secAdress Second Address

    7. typeData Data Type

    Our usage of JQuery, HTML, JavaScript isnt obligatory. You can do this in your way.