Data Link Dnp v3

download Data Link Dnp v3

of 39

Transcript of Data Link Dnp v3

  • 8/9/2019 Data Link Dnp v3

    1/39

    Document: 1KEL615158-02Date 2004.05.19

    FLEXGATE PROTOCOL CONVERTERDNP V3.00 Slave - SPA-bus Master

    Abstract : This is the functional specification of the Flexgate ProtocolConverter for access to SPACOM relays from a system usingthe DNP V3.00 protocol. The Flexgate acts as a slave towards aDNP line and as a master towards a SPA-bus line.

    Author : Jorgen Winther

    Keywords : FLEXGATE,SPABUS,DNP,JOWI

    Approved :

    Signed :

  • 8/9/2019 Data Link Dnp v3

    2/39

    2/39 1KEL615158-02

    Revision:

    01: 2002-06-20 First issue.

    02: 2004-05-19 A few document corrections.

    References:

    Title Document number

    [1] DNP V3.00 Data Link Layer P009-0PD.DL

    [2] DNP V3.00 Transport Functions P009-0PD.TF

    [3] DNP V3.00 Application Layer P009-0PD.APP

    [4] DNP V3.00 Data Object Library P009-0BL

    [5] DNP V3.00 Subset Definitions P009-0IG.SUB

    [6] SPA-BUS COMMUNICATIONPROTOCOL V2.3

    34 SPACOM 2EN1B01.02.1988

    [7] FLEXGATEHardware specification

    1KEL614979

    Copyright belongs to ABB A/S. The information herein must not be supplied tothird parties without written permission from ABB A/S.

  • 8/9/2019 Data Link Dnp v3

    3/39

    1KEL615158-02 3/39

    TABLE OF CONTENTS

    FRONT PAGE .................................................................................................1

    REVISION, DISTRIBUTION & REFERENCES ............................................... 2

    TABLE OF CONTENTS ..................................................................................3

    1. INTRODUCTION....................................................................................1-1

    2. INTERFACES ........................................................................................2-3

    3. DNP HANDLING....................................................................................3-53.1 COMPATIBILITY 3-10

    4.

    SPA-BUS HANDLING .........................................................................4-13

    5. CONFIGURATION...............................................................................5-175.1 Configuration Commands 5-17

    5.2 Introduction to the Configuration Tools 5-24

    5.3 FLEXGATEDNP Workbook - I/O List Sheet 5-25

    5.4 FLEXGATEDNP Workbook - Sheet 2 5-28

    5.5 ConfigFlexgate Program - View Config. 5-30

    5.6 ConfigFlexgate Program - Send Config. 5-31

    5.7 ConfigFlexgate Program - Fetch Config. 5-32

    5.8 ConfigFlexgate Program - Ad Hoc Commands 5-33

    6. PERFORMANCE .................................................................................6-35

  • 8/9/2019 Data Link Dnp v3

    4/39

  • 8/9/2019 Data Link Dnp v3

    5/39

    1KEL615158-02 1-1

    1. INTRODUCTION

    This is the functional description of the FLEXGATE protocol converter as DNPV3.00 to SPA-bus converter. The converter is the master for a number ofSPA-bus slaves (relays) using one RS-232 port. On another RS-232 (or RS-485) port it acts as a DNP V3.00 slave.

    Note that the FLEXGATE is now delivered in two versions, one where theFLEXGATE is a Modbus RTU slave and one where it is a DNP V3.00 slave.The two versions are described seperately. This document describes thefunction where it is a DNP V3.00 slave.

    The mapping between DNP and SPA-bus addresses is configured through a3'rd RS-232 port and stored in flash RAM. This port may also be used fortesting. A possible system configuration is outlined below.

    The SCADA system is the master, using requests conforming to the DNPV3.00 protocol. The section on DNP handling contains a DNP device profile.

    The interface is RS-232 or RS-485. Time must be set by means of DNP writerequests. Synchronization down to a few milliseconds can be obtained bymeans of a minute pulse input.

    According to the configuration, the converter will scan the SPA-bus relays forthe configured data and place it at the required DNP addresses for reading byDNP read requests. Binary input objects may be updated both from scan ofstatic SPA-bus data and from SPA-bus events. DNP control operations arerouted directly through to the relay, after proper address and value mapping,so that the outcome of a DNP control request reflects the result of the writingto the SPA-bus relay. An optical converter from RS-232 to one or more fiber

    optical rings is normally required as interface to the relays.

    Protocol converter

    I/O portSPA bus

    DNP V3.00 master

    RS 232

    SCADA System

    Optical converter

    SPAZC_

    RS 232Configuration PC

    DNP V3.00 slave

    Protection relay

    Protection relay

    Optical converter

    SPAZC_

    RS 232

  • 8/9/2019 Data Link Dnp v3

    6/39

    1-2 1KEL615158-02

    DNP object addresses are mapped to SPA-bus addresses by means ofconfiguration data entered on the terminal I/O port. The configuration uses anordinary line oriented ASCII discipline. It is possible to configure by means ofa terminal or terminal emulator. However, a Microsoft Visual Basic programfor down/up-loading of the whole configuration from/to an ASCII file is

    included in the delivery. The program may also be used as a simple terminalemulator for testing. The configuration file may be generated by means of aMicrosoft Excel application.

    The hardware for the procotocol converter is based on a Hitachi H8/3003microprocessor. The processor has two built-in serial ports; a 3'rd port isimplemented by means of an external UART. The kernel hardware is placedon a small printed circuit board, the Add-On print, plugged onto a Europe cardcontaining interface circuits and power regulator. The Europe card is mountedin a rugged aluminium box.

  • 8/9/2019 Data Link Dnp v3

    7/39

    1KEL615158-02 2-3

    2. INTERFACES

    Interface for Characteristics

    Power supply 24 Volts DC. Galvanic isolated. Power consumption 2.5Watts.

    SPA-bus 9-pole D-sub female. Ground, Rx and Tx used. RS-232signal levels. 1 start-bit, 7 data bits, 1 even parity bit and 1stop bit. Speed fixed to 9600 bits per second. SPA-busmaster. The SPA-bus relays may be configured with datacommunication addresses in the range 1 to 99.

    DNP V3.00 15-pole D-sub female. RS-232 or RS-485 signal levelsdepending on setting of DIL switch 8 on the Addon Print (RS-232 if OFF). Ground, Rx, Tx, DTR and RTS used for RS-232;Rx+, Rx-, Tx+ and Tx- used for RS-485. 1 start-bit, 8 databits, 1 stop-bit. Parity configurable as none, even or odd.Speed configurable from 250 to 20000 bits per second.

    Modem control configurable. DNP V3.00 slave. Slavenumber, maximum length of link frame and applicationfragment and link timeout and retries configurable.

    Configuration,diagnostics,minute pulse

    25-pole D-sub female.Configuration and testing:RS-232 signal levels. Ground, Rx and TX used. 1 start-bit, 8data bits, 1 odd parity bit, 1 stop-bit. Speed fixed to 9600 bitsper second. Protocol is ASCII, terminal I/O with carriagereturn, line-feed, echo and prompt. Suitable for a standardPC modem cable.Diagnostics:

    6 pins are used to signal the state of the protocol converteras 0/+5 Volts digital outputs. The signals are:

    Protocol converter

    I/O portSPA bus

    DNP V3.00 master

    RS 232

    SCADA System

    Optical converter

    SPAZC_

    RS 232Configuration PC

    DNP V3.00 slave

    Protection relay

    Protection relay

    Optical converter

    SPAZC_

    RS 232

  • 8/9/2019 Data Link Dnp v3

    8/39

    2-4 1KEL615158-02

    Interface for Characteristics

    RUN - converter alive (toggles every second)CONFIG - converter configuration checked and acceptedSLAVE - communication ok with all SPA-bus relaysMASTER - correct DNP telegram received within last 30

    secondsMINP - toggled every time a minute pulse is received (if

    minute pulse is configured)5V - internal Voltage

    Signals CONFIG, SLAVE, MASTER and 5V are steady on(+5 Volts) when ok.These signals and Rx and Tx may be displayed by fieldservice personel by means of a special FLEXGATE TESTTOOL.Minute pulse:2 pins, ground and pulse input. The synchronization point is

    defined when input is falling at some level below 5 Volts. TheON level may be from +5 to +30 Volts. The input resistanceis 10 KOhm. The pulse input is only used if it is included inthe configuration.

    Note that all grounds are common, except the power supply ground.

  • 8/9/2019 Data Link Dnp v3

    9/39

    1KEL615158-02 3-5

    3. DNP HANDLING

    The FLEXGATE acts as a DNP slave according to the device profile at the

    end of this section. The following key features can be mentioned.

    All polling can be done as class polling, class 0 static binary input andstatic analog input for the initial checkcycle, class 1 for binary changes andclass 2 for analog changes. Class 3 is not used.

    The normal strategy for a DNP master is to read all static objects and thenpoll for changes. It is however possible to use static read exclusively,either as class 0 poll or as more specific reading. In that case the mastermust time-stamp changes, of course.

    When a static binary input object is read, all change events queued for theobject are removed from the event queue. This means that after acheckcycle, only new change events will be seen.

    When any read of binary or analog changes and any read of static binary

    input returns one or more changed objects, a confirm is required. After theconfirm, the changes are not sent in a subsequent reading of changes as itis assumed that the DNP master has recorded the changes even if sent ina static read response.

    When reading static analog inputs, the change flags are removed from theobjects read, i.e., they will only be transmitted as changes if they changeagain.

    The blocked, failed, event overflow and restarted statuses of the individualSPACOM relays may be controlled and monitored using configurable DNPindex ranges.

    Protocol converter

    I/O portSPA bus

    DNP V3.00 master

    RS 232

    SCADA System

    Optical converter

    SPAZC_

    RS 232

    Configuration PC

    MoDNP V3.00 slave

    Protection relay

    Protection relay

    Optical converter

    SPAZC_

    RS 232

  • 8/9/2019 Data Link Dnp v3

    10/39

    3-6 1KEL615158-02

    Only one analog change event is stored for each analog input object. Thechange event is without time-tag. The DNP master may however requestanalog changes with time-tags; the time-tag will then be generated as thetime of the DNP response.

    In case of binary event overflow (in the relays event buffer or in theFLEXGATE event buffer) all stored time-tags of events from the SPACOMrelay causing the overflow are lost and only the final change of a changedbinary input will be sent, time-tagged with the time of the DNP response.

    As long as the overflow state persists, no new time-stamped events aregenerated for the object; the object flag is just changed and marked fortransfer as a change.

    The overflow state is removed for all relays when there are no pendingbinary changes, as inspected once every second.

    If the communication with a relay is lost, the flags of all objects belonging

    to the relay are changed to communication failed and all binary inputevents of the relay are removed from the event queue as with eventoverflow. When the object lateron is read from the relay, the object flag ischanged to communication ok. Communication failed is also the initialstate after restart of FLEXGATE. This will not be seen from the DNPmaster for all objects which are read ok during the initial SPA-buscheckcycle of all configured input items.

    Time-stamped events are not generated for an object, in case of eventoverflow, change of communication failed flag or if the object has beenmarked for transfer, but not transferred yet; the flag of the object is just

    changed and marked for transfer as a change (stamped with time ofresponse).

    Binary change events are not sorted according to time. I.e., queuedchange events are transmitted to the DNP master in the sequence theyare detected from the relays.

    Analog changes and not time-stamped binary changes are not sorted. Ifthere are pending changes, the changes are handled in a round-robinfashion. If there are no pending changes, the first detected change is sentfirst; the rest are sent round-robin.

    For static binary input, variation 0, 1 or 2 may be requested, but theresponse will always contain variation 2. The default binary changevariation is configurable. A binary change is only sent once, i.e., either withor without time-tag, not both.

    The default variations for static analog input and analog changes can bechosen as 16-bit or 32-bit integers. The corresponding SPA-bus valuesmay be prescaled by a factor of 10, 100 or 1000 in order to preservedecimals.

    The DNP control operations select/operate, direct operate and directoperate no acknowledge are all supported by the FLEXGATE. The select

    operation is handled within the FLEXGATE with a fixed timeout of 60

  • 8/9/2019 Data Link Dnp v3

    11/39

    1KEL615158-02 3-7

    seconds, i.e., the eventual operation towards the relay is always direct, notusing any select/execute feature of the relay.

    Unsolicited responses are never sent.

    In read responses, the minimal qualifier is always used, i.e., qualifier 00 for

    static data if the stop index is

  • 8/9/2019 Data Link Dnp v3

    12/39

    3-8 1KEL615158-02

    Use of DNP flags for input objects:

    Flag Bit Flag Name Usage

    bit0 Online Set to 1 for all configured input objects.

    bit2 Communicationlost

    Set for input objects from relays which areblocked or in error. Also set for individual objectsif syntax problem or NACK when reading thevalue. Removed when a value has been readfrom the relay.

    bit5 Over-range Only set for analog input values when sent as16-bit, if the value does not fit within 16 bits. Thevalue will be the exceded range end value. Theflag is not set directly due to the value read from

    SPA-bus. In case of numeric problems there,communication lost is set.

    bit7 State The state, 0 or 1, of a binary input.

    Handling of time synchronization:

    The internal indication, time-synchronization required, is set immediatelyafter restart, a configurable number of seconds after last time-synchronization and after a time-synchronization which has been skipped.

    If the DNP request defines a time change which excedes +/- 19

    milliseconds, the first two consecutive such changes are skipped,assuming some timing problem. The following write time request sets theclock unconditionally.

    The time of a DNP write time request is taken as the time when the firstbyte of the telegram has been received. The DNP master must take anypreceding delay into account.

    18 milliseconds are added to the received time before setting the local timeof the FLEXGATE in order to make the local time adequate for the SPA-bus time setting procedure.

    Handling of controls:

    There may be at most 20 controls active at time.

    A select which has not timed out (60 seconds) and a control which has notyet been executed towards SPA-bus is active.

    A control relay output block with clear = 1 cancels an active control for thesame object.

    A control relay output block with count = 0 or trip/close and code bothNULL is dummy, except for a possible clear function.

    A control relay output block with trip or pulse ON or latch ON gives the

    control value 1, otherwise control value 0. For a single item SPA-buscommand this value is written to the relay. For a double item SPA-bus

  • 8/9/2019 Data Link Dnp v3

    13/39

    1KEL615158-02 3-9

    command, 0 selects the lowest SPA-bus channel number or data numberand 1 selects the highest channel or data number; a 1 is written to therelay in both cases. For a unit block DNP index, control value 0 meansdeblock, 1 means block. For a non-unit control, the control value may beinverted by means of the configuration.

    On/Off times and pulse or latch are ignored, as these functions areassumed to be handled by the SPA-bus relays. Queue and count exceptfor the non-zero check, is not handled.

  • 8/9/2019 Data Link Dnp v3

    14/39

  • 8/9/2019 Data Link Dnp v3

    15/39

    1KEL615158-02 3-11

    Never

    Only time-tagged

    Only non-time tagged

    Configurable to send one or the other

    requested:

    Never

    Binary input Change with time

    Binary input Change with Relative time

    Configurable

    Sends unsolicited responses

    Never

    Configurable

    Only certain objects

    Sometimes

    ENABLE/DISABLE function codes supported

    Sends Static Data in Unsolicited

    Responses

    Never

    When device restarts

    When status flags change

    Default Counter Object/Variation

    No counters Reported

    Configurable

    Default Object:

    Default Variation:

    Point-by-point list attached

    Counters Roll Over at:

    No counters Reported

    Configurable with database

    maintenance

    16 bits

    32 bits

    Other Value: 8 to 32 bits

    Point-by-point list attached

    Sends Multi-Fragment Responses:

    Yes No

    The following objects, variations, qualifiers and functions are handled:

    OBJECT REQUEST RESPONSE

    Obj Var Description FuncCodes(dec)

    QualCodes(hex)

    FuncCodes(dec)

    QualCodes(hex)

    1 0 Binary Input - All Variations 1 00, 01,06

    1 1 Binary Input 1 00, 01,06

    *)

    1 2 Binary Input with Status 1 00, 01,06

    129 00, 01

    2 0 Binary Input Change - AllVariations

    1 06, 07,08

    2 1 Binary Input Change withoutTime

    1 06, 07,08

    129 17, 28

    2 2 Binary Input Change with Time 1 06, 07,08

    129 17, 28

    2 3 Binary Input Change withRelative Time

    1 06, 07,08

    129 17, 28

    12 0 Control Block - All Variations

    12 1 Control Relay Output Block 3, 4, 5,6

    17, 28 129 echo ofrequest

    30 0 Analog Input - All Variations 1 00, 01,06

    30 1 32-Bit Analog Input 1 00, 01,06

    129 00, 01

    30 2 16-Bit Analog Input 1 00, 01,06

    129 00, 01

    30 3 32-Bit Analog Input without Flag 1 00, 01,06

    129 00, 01

    30 4 16-Bit Analog Input without Flag 1 00, 01,06

    129 00, 01

    32 0 Analog Change Event - AllVariations

    1 06, 07,08

    32 1 32-Bit Analog Change Eventwithout Time 1 06, 07,08 129 17, 28

    32 2 16-Bit Analog Change Event 1 06, 07, 129 17, 28

  • 8/9/2019 Data Link Dnp v3

    16/39

    3-12 1KEL615158-02

    without Time 08

    32 3 32-Bit Analog Change Eventwith Time **)

    1 06, 07,08

    129 17, 28

    32 4 16-Bit Analog Change Eventwith Time **)

    1 06, 07,08

    129 17, 28

    41 0 Analog Output Block - All

    Variations41 1 32-Bit Analog Output Block 3, 4, 5,

    617, 28 129 echo of

    request

    41 2 16-Bit Analog Output Block 3, 4, 5,6

    17, 28 129 echo ofrequest

    50 0 Time and Date - All Variations

    50 1 Time and Date 2 07,quantity= 1

    129

    51 0 Time and Date CTO - AllVariations

    51 1 Time and Date CTO 129 07,quantity= 1

    51 2 Unsynchronized Time and DateCTO

    129 07,quantity= 1

    52 0 Time Delay - All Variations

    52 1 Time Delay Coarse 129 07,quantity= 1

    52 2 Time Delay Fine 129 07,quantity= 1

    60 1 Class 0 Data - static binary and

    analog input

    1 06

    60 2 Class 1 Data - binary changes 1 06, 07,08

    60 3 Class 2 Data - analog changes 1 06, 07,08

    60 4 Class 3 Data - no data inresponse

    1 06, 07,08

    80 1 Internal Indications 2 00,index=7orindex=4

    Cold restart 13

    Delay measurement 23

    *) the response is always variation 2, binary input with status.

    **) the time is the time of the response. There is no queue of analog events.

  • 8/9/2019 Data Link Dnp v3

    17/39

    1KEL615158-02 4-13

    4. SPA-BUS HANDLING

    The table below gives a survey of the SPA-bus activities performed, in priority

    order.

    Priority Activity Comment

    1 Command orsetpoint

    SPA-bus output performed as the direct handlingof a DNP operate or direct operate request.Control operations are handled in the order theyare received. Normally only one control is activebecause the DNP response waits for the SPA-bus operation. Note that one DNP controlrequest may contain several individual controls.

    2.1 Read events Events are used to update binary statesaccording to the configuration. If one of the

    standard events E50 (restart) or E51 (eventoverflow) is obtained, a WC:0 operation isperformed instead of the next read event.

    2.2 Cyclicalscanning

    All binary and analog input items are normallyscanned cyclically. However, binary inputs whichare event updated and binary and analog inputswhich are marked as checkcycle only in theconfiguration (=) are not scanned cyclically.

    2.3.1 Time setting This is done by broadcast, relay communicationaddress 900. It is done every 10 seconds by

    sending the time within the minute. The time sentis the actual clock of the protocol converter just

    Protocol converter

    I/O portSPA bus

    DNP V3.00 master

    RS 232

    SCADA System

    Optical converter

    SPAZC_

    DNP V3.00 slave

    Protection relay

    Protection relay

    Optical converter

    SPAZC_

    RS 232Configuration PC

    RS 232

  • 8/9/2019 Data Link Dnp v3

    18/39

    4-14 1KEL615158-02

    Priority Activity Commentbefore the first byte of the telegram is sent.Every 200 seconds, the complete date and timeis sent before sending the time within the minute.Time setting is only done if the DNP master hasset the time at least once.

    2.3.2 Test failed relay If some relays, but not all, have failed, one relayis tested every 10 seconds. The testing isperformed by means of an RC request. If therequest succeeds, testing of the next failed relayis scheduled within 2 seconds in order to get allrelays back in service as fast as possible, e.g., ifan optical loop or power has been reestablished.If the test request fails, it is not retriedimmediately. If all relays are failed, testing is

    performed continuously. After deblock of a failedrelay, testing is performed immediately.

    2.3.3 Checkcycle When a test failed operation has succeeded,when a not failed relay is deblocked and when acommand or setpoint has been performed therelay is checkcycled. The checkcycle alwaysstarts with reading of all pending events from therelay. After that, all static input items of the relayare read, except after a control operation, wherebinary input items which are configured as event

    updated are not checkcycled, in order not todisturb the expected event updated back-indication. On the other hand, if event updateditems have been skipped, the checkcycle endswith a single reading of events in order tocapture a late back-indication.

    The priority column above should be read such:

    priority 1 is done before any other activity

    priority 2.1, 2.2 and 2.3 are done round-robin so that a 2.1 activity is

    followed by a 2.2 which is followed by a 2.3, if any, which is followed by a2.1 etc.

    priority 2.3.1, if pending, is done before 2.3.2 which is done before 2.3.3.

    The strategy is that, in the absence of retries, a read event request isperformed at least as every 3'rd SPA-bus request. This should ensure amaximum response time for binary changes. The same is true for changesdue to scan of static items.

    A SPA-bus request which is not answered in time with a syntactically correctresponse is retried up to two times. After that, the relay is reported in error and

    the only activity is the periodical test (2.3.2 above) to get it into service again.

  • 8/9/2019 Data Link Dnp v3

    19/39

    1KEL615158-02 4-15

    Initially, after restart or reconfiguration of the FLEXGATE, all configured relaysare first tested and then the ok ones are checkcycled. After that, theoperations are performed according to the table above. During the initial testand checkcycle phase, DNP requests for data are not answered in order notto return unnecessary invalid data.

  • 8/9/2019 Data Link Dnp v3

    20/39

    4-16 1KEL615158-02

    The table below defines the limitations imposed by the implementation of theprotocol converter concerning the SPA-bus relays.

    Item Allowed range

    Relaycommunicationaddress

    The unique logical address for each relay can beselected from 1 to 99.

    Number of relays The FLEXGATE software may impose a restriction onhow many different communication addresses (slaveunits) it will handle. For example at most 15 relays.

    Channel number 0 to 999

    Data letter A to Z, but it should normally be I, M, O, S or V

    Data number 0 to 999

    Event number 0 to 254

    Item range(as in 1/16I1)

    At most one range (/) is allowed, i.e., channel or datanumber range is allowed, not both. For scanned data,there must be at most 16 items in the range. Forsetpoints no range is allowed. For commands, it isallowed to have a range with 2 items. This causes thefirst item to be used for a close/off command and thelast item to be used for a trip/on command or theopposite.

    Decimalsconserved When converting to the internal 32-bit integer format, 0,1, 2 or 3 digits after the decimal point in the SPA-bustelegram may be conserved. Rounding takes placewhen decimals are discarded from an input value.Decimal point may be inserted for setpoints to give 1, 2or 3 decimals.

    Maximum digits There may be at most 9 digits in a SPA-bus value.

    Value range The internal value format is 32-bit signed integer equalto the SPA-bus value multiplied by 1, 10, 100 or 1000according to the configuration. The DNP master may

    choose to read analog values as 32- or 16-bit signedintegers.

    SPA-bus requests At most 1000 individual SPA-bus requests can bedefined, input or output (BIN, ANA, CMD and SET lines).

    Events At most 22 events may occur in one SPA-bus inputtelegram. At most 1000 binary changes may be stored inthe internal queue.

  • 8/9/2019 Data Link Dnp v3

    21/39

    1KEL615158-02 5-17

    5. CONFIGURATION

    5.1 Configuration Commands

    The configuration dialog may be performed manually from a terminal(emulator) as well as by means of the FlexConfig program. The general dialogis this:

    From terminal orprogram

    To terminal or program Comment

    COMMAND COMMAND A command and its echo

    ANSWER Answer to the command, 0 to nlines.

    > Prompt for next command.

    In COMMAND's, capital and non-capital letters may be used freely.

    The contents and meaning of the individual configuration commands is thefollowing:

    Config command Function

    LIST The LIST command, followed by a sufficient number ofempty lines produces a complete listing of theconfiguration, one line at a time. Used for uploading(reading) of the configuration. A non-empty command

    line interrupts the listing. The listing is sorted on linetype, CONFIG, PORT, MPULSE, LINK, APPL, UNIT,

    Protocol converter

    I/O portSPA bus

    DNP V3.00 master

    RS 232

    SCADA System

    Optical converter

    SPAZC_

    RS 232Configuration PC

    DNP V3.00 slave

    Protection relay

    Protection relay

    Optical converter

    SPAZC_

    RS 232

  • 8/9/2019 Data Link Dnp v3

    22/39

    5-18 1KEL615158-02

    Config command FunctionBIN, ANA, CMD, SET and CHECK, and within thesame type it is sorted on DNP indexes. All letters arecapital, except in the xxxxx text of the CONFIG linewhere non-capital letters are conserved.

    CONFIG xxxxxD18.rr

    The CONFIG command stops the protocol operationand clears the existing configuration in RAM, not inflash RAM. It starts the checksum calculation for theconfiguration lines. The parameter xxxxx is a free textof up to 65 characters. The D18.rr is an optionalidentification of the program version. It is inserted orcorrected by the LIST command. Note that this mayinfluence the checksum.

    PORT aaaaa sssss

    ppppRTS dddd

    The PORT command defines the basic interface

    parameters. The parameter aaaaa is the DNP slaveaddress, 0..65534. The parameter sssss defines theline speed, 250..20000 bits/second. The optionalparameter pppp defines the parity as EVEN, ODD orNONE. The optional parameter RTS dddd defines adelay of 1..2000 milliseconds after setting request-to-send to sending of first data. Delay after sending of lastdata to request-to-send down is fixed to 11 bits time + 1millisecond. If RS-485 is used, dddd is the time fromactivation of the transmitter to sending of data; in thatcase dddd should be set to 1 millisecond. Default if

    PORT command not used or parameters omitted isPORT 1 9600 NONE

    Slave address 1, speed 9600, no parity and no modemcontrol (and not RS-485).

    MPULSE ddddd Minute pulse input used. The default is no minute pulseinput. ddddd is the offset from the real minute changeto the pulse (falling edge) occurs given as +/- 0..59999milliseconds. The offset should take into account thetransmission time of the SPA-bus time set telegram, soadd extra 18 milliseconds to the offset. The time

    between two pulses must be within 59 to 61 secondsmeasured on the internal clock. When the first suchinterval is seen, the internal status bit - time notsynchronized by minute pulse - is cleared. From thesecond such interval, the internal clock is adjusted sothat it will be at most +/-3 milliseconds out of sync. atthe next minute pulse. If the minute pulse stops, theinternal status bit - time not synchronized by minutepulse - is set after 90 seconds.

    CHECK s1 s2 s3 s4 The check command tests that the checksum of thepreceding configuration lines starting with CONFIG has

    the checksum given by s1, s2, s3 and s4. Here s1 isthe number of lines, s2 is the number of characters, not

  • 8/9/2019 Data Link Dnp v3

    23/39

    1KEL615158-02 5-19

    Config command Functioncounting trailing blanks, and , and onlycounting seperating blanks as one blank. s3 is the sumof these characters and s4 is the sum of sums startingsummation on each line so that the sum does notdepend on the line order. The sums are decimalintegers modulo 65536 (16-bits). The sums aregenerated by the LIST command. If the check is ok, thenew configuration is saved in flash RAM; if thechecksum is wrong, an error message is given and theconfiguration is not saved in flash RAM. The protocol isrestarted from the contents of the flash RAM in anycase.

    SAVE If at least one preceding BIN, ANA, CMD or SET linehas been accepted, the new configuration is saved in

    flash RAM. May be used after manual configuration or ifthe configuration file has been edited and thechecksum is not known. The protocol is restarted fromthe contents of the flash RAM in any case.

    LINKMAX mmmTIMEOUT ttttRETRIES rr

    This is an optional line with optional parameter pairsdefining the maximum size of a transmitted link frameincluding CRC's from 46 to 292 bytes, the timeout forretry of confirmed link operations from 50 to 5000milliseconds and the number of retries if a link confirmis not received from 1 to 15. The default, if LINK

    command or a parameter pair is omitted, isLINK MAX 292

    which means maximum transmitted link frame size is292 and that link data are sent unconfirmed. IfTIMEOUT is given, link data are sent confirmed. IfRETRIES are not given but TIMEOUT is given,RETRIES defaults to 2.

    APPLMAX mmmmSYNCPER pppp

    BCHVAR vANAVAR vACHVAR v

    This is an optional line with optional parameter pairsdefining the maximum size of a transmitted applicationfragment from 31 to 2048 bytes, the maximum time

    between time synchronizations from master and thedefault variations for binary changes, static analogs andanalog changes. The default, if APPL command or aparameter pair is omitted, is

    APPL MAX 2048 SYNCPER 300BCHVAR 2 ANAVAR 1 ACHVAR 1

    which means that the maximum transmitted applicationfragment is 2048 bytes, that time-synchronization isrequired 300 seconds after last sync., that binarychanges are sent with time and analogs are sent as 32-bit with flag, but without time. SYNCPER can be given

    from 0 (no period) to 3600 seconds. BCHVAR can be 1to 3, ANAVAR 1 to 4 and ACHVAR 1 to 4.

  • 8/9/2019 Data Link Dnp v3

    24/39

    5-20 1KEL615158-02

    Config command Function

    UNITBLOCK iiiiiFAIL iiiii

    OVERFLOW iiiiiRESTART iiiii

    This is an optional line with optional parameter pairsdefining DNP indexes for unit status control. Theindexes given corresponds to the relay with the lowest

    configured unit number. The highest DNP index is thengiven by adding the difference between highest andlowest configured unit number. For the BLOCKindexes, both a binary input range and a control relayblock range is configured, for the others only a binaryinput range is configured. The RESTART inputs arehandled as ONONLY (wischer), i.e., only changes to 1are sent, see description of BIN. The default, if UNITcommand or a parameter pair is omitted, is that theranges are not configured. The indexes can beanywhere from 0 to 65534, but must not overlap with

    other configured DNP indexes for the same objecttypes.

    BIN iiiii uu-ssssseventsconv=

    This line defines one or more DNP binary input bits tobe updated from SPA-bus. The line contents are:

    iiiii is the lowest DNP index, 0 to 65535

    uu-sssss is the SPA-bus request definition in theformat given by these examples: 17-1/16I1, 43-O1/7 or 7-I5. Here, the first number is the relaycommunication address, the next, if any, is a

    channel number or a channel number range,then follows the data type letter and at last thedata number or a data number range. Thenumber of items determines together with theconversion function conv the number of bits andthus DNP indexes.

    events are from 1 to 4 optional event codesgiven f.ex. as E2 E1 E3 E4, i.e., one event isgiven as Ennn where nnn is a number from 0 to254. If there is a range in the SPA-bus request, it

    must be a channel number range. The channelnumber of the event, when it occurs, mustcorrespond to a channel number within therange. The update value is given by thesequence in which the event codes areconfigured, so that the update value for the 4events are 1, 2, 0, 3 respectively, i.e., 1 for thefirst event (E2 in the example above), 2 for thesecond (E1 above), 0 for the 3'rd (E3 above) and3 for the last (E4 above). For ONONLY objects,one event code should suffice, for SINGLE

    objects, two event codes (only the lowest valuebit is used) and for DOUBLE objects, all 4 event

  • 8/9/2019 Data Link Dnp v3

    25/39

    1KEL615158-02 5-21

    Config command Functioncodes should be specified. For BIT16, eventupdating is not really meaningful.

    conv is an optional conversion function given by

    an ASCII string: SINGLE, DOUBLE, BIT16,ONONLY. The default is SINGLE, one bit takenfrom the lowest bit of the SPA-bus value.DOUBLE means that two DNP indexes areupdated from the SPA-bus value, the lowest bitof the value goes to the lowest DNP index.BIT16 means that 16 DNP indexes are updated.As SINGLE, ONONLY defines one DNP index,but the value can only be updated to 1 fromSPA-bus (wischer) and only one such changewill be pending towards the DNP master at any

    time. Internally, the value goes to 0 only aftertransmission to and confirm from the DNPmaster. The change to 0 does not cause abinary change event.

    the optional character = indicates that the itemshould only be read at checkcycle time. This canbe used for input which normally never changeor only change due to control. If events arespecified, = is the default and need not be given.

    ANA iiiii uu-sssssconv=

    This line defines one or more DNP analog inputs to beupdated from SPA-bus. The line contents are:

    iiiii is the lowest DNP index, 0 to 65535

    uu-sssss is the SPA-bus request definition in theformat given by these examples: 17-112S1/5,43-I1/3 or 7-I5. I.e., the same as for BIN lines.The first number is the relay communicationaddress, the next, if any, is a channel number ora channel number range, then follows the datatype letter and at last the data number or a data

    number range. The number of items determinedby the channel or number range determines thenumber of DNP indexes.

    conv is an optional conversion function given byan ASCII string: INT, INT.1, INT.2 or INT.3. Thedefault is INT meaning that the floating pointSPA-bus value is converted directly to the DNPinteger value. The other 3 means that the SPA-bus value is multiplied by 10, 100 or 1000respectively before the conversion in order topreserve decimals.

    the optional character = indicates that the item

  • 8/9/2019 Data Link Dnp v3

    26/39

    5-22 1KEL615158-02

    Config command Functionshould only be read at checkcycle time. This canbe used for input which normally never changeor only change due to control in order to savescanning time.

    CMD iiiii uu-sssssconv

    This line defines one DNP control relay output block.The line contents are:

    iiiii is the DNP index, 0 to 65535

    uu-sssss is the SPA-bus request definition in theformat given by these examples: 13-120V4, 43-120V4/5 or 99-120/121V4. The first number isthe relay communication address, the next, ifany, is a channel number or a channel numberrange, then follows the data type letter and at

    last the data number or a data number range. Ifthere is a range, it must be a range of twoconsecutive numbers, either channel or datanumber, not both. There is only one DNP indexinvolved in any case. If there is no range, theSPA-bus output value will be 0 or 1, dependingon conv and the control. If there is a range, thecommand value is alway one, the control selectsthen the lowest or the highest of the twonumbers in the range instead.

    conv is an optional conversion function given byan ASCII string: CMD or CMDN. The default isCMD meaning that a control relay output blockwith trip or pulse ON or latch ON gives thecontrol value 1, otherwise control value 0. WithCMDN, a control relay output block with trip orpulse ON or latch ON gives the control value 0,otherwise control value 1. The control valueselects either the SPA-bus value or the SPA-busID as described above.

    SET iiiii uu-sssssconv This line defines one DNP analog output block. Theline contents are:

    iiiii is the DNP index, 0 to 65535

    uu-sssss is the SPA-bus request definition in theformat given by these examples: 13-11V43, 43-S18. The first number is the relay communicationaddress, the next, if any, is a channel number,then follows the data type letter and at last thedata number, if any. There is only one DNPindex involved.

    conv is an optional conversion function given byan ASCII string: SET, SET.1, SET.2 or SET.3.

  • 8/9/2019 Data Link Dnp v3

    27/39

  • 8/9/2019 Data Link Dnp v3

    28/39

    5-24 1KEL615158-02

    5.2 Introduction to the Configuration Tools

    Two configuration tools for Windows PC's can be used for configuration andtesting of the Flexgate:

    FLEXGATEDNP.xls - a Microsoft Excel workbook for definition of anI/O list and for preparation of the configuration file from the I/O list. It isopened as a normal Excel workbook. If the configuration file has to begenerated, Macros must be enabled. The Macro is a Visual Basicsubroutine, which generates worksheet 2 of the workbook whenactivated from a pushbutton. The subroutine works entirely within theworkbook and does not access any files. Be careful not to change thefew reserved cells.

    ConfigFlexgate.exe - a Microsoft Visual Basic program for download

    and upload of configuration files. It works also as a simple terminalemulator for testing of the protocol converter. It uses COM port 1(COM1). It will only access files, which are explicitly selected by theuser. It enables COM1 from the start.

    The two tools may be downloaded from our Webpage or received as attachedmail files. The two tools are described in the following sections.

  • 8/9/2019 Data Link Dnp v3

    29/39

  • 8/9/2019 Data Link Dnp v3

    30/39

    5-26 1KEL615158-02

    This is the bottom of the example sheet. The last row (here row 43) must notbe changed. In column E it shows that 29 configuration lines were generatedOK.

    Column Comment

    A SPA-bus relay communication address, 1..99.The Flexgate may set a limit on how many different addresses areallowed.

    B SPA-bus identification of point as:

    channel-number (none or 1..999)data letter (I, M, O, S or V)data number (1..999).

    For control, point type Cmd and CmdN, a range of 2 numbers maybe given, V3/4 means V3 for OFF and V4 for ON command oropposite.For binary input, additional up to 4 event codes, Ennn are allowed.Use FILLER nn to reserve DNP indexes for nn items of the giventype.

    C Point type as:

    Single - 1 binary input bitDouble - 2 binary input bits from 1 SPA-bus itemOnOnly - 1 binary input which only goes on (wischer)Bit16 - 16 binary input bits from 1 SPA-bus itemInt - analog input, no SPA-bus decimals conservedInt.1 - analog input, SPA-bus value * 10Int.2 - analog input, SPA-bus value * 100Int.3 - analog input, SPA-bus value * 1000Cmd - relay control block, ON/OFF commandCmdN - relay control block, OFF/ON commandSet - analog output, no SPA-bus decimals

    Set.1 - analog output. div 10 gives SPA-bus valueSet.2 - analog output. div 100 gives SPA-bus value

  • 8/9/2019 Data Link Dnp v3

    31/39

    1KEL615158-02 5-27

    Set.3 - analog output. div 1000 gives SPA-bus valueFor binary and analog input a = may be used after the type toindicate checkcycle only. This may be used to save normalscanning time.

    D Free describing text, this column is only for description.

    It is also possible to have complete rows with free text, but leavecolumn A blank.

    E This button activates a complete check of columns A, B and C. Itcalculates column E of this sheet and column A of Sheet 2.Column A of sheet 2 can be saved as a (.txt) file and used directlyfor configuration of the FLEXGATE converter.

  • 8/9/2019 Data Link Dnp v3

    32/39

    5-28 1KEL615158-02

    5.4 FLEXGATEDNP Workbook - Sheet 2

    Sheet 2 of the workbook contains the FLEXGATE configuration commands tobe downloaded to the protocol converter.

    Sheet 2 of the workbook contains only one column. The lines starting withCONFIG, PORT,MPULSE, LINK, APPL and UNITmust be entered directly

    according to the wanted configuration, see the definition of these configurationcommands. The first line must be CONFIGin order to have the configurationloaded to a FLEXGATE converter. The MPULSE command should beblanked if a minute pulse is not used. The rest of the column is calculatedwhen the pushbutton, DNP-SPA Config., is activated. The contents areessentially the same as column E of worksheet 1, but the SPA-bus readaccesses have been optimized by using the range feature (/). If range readingis not wanted, e.g., because a relay does not support it, an empty line may beused in the I/O list to suppress the optimization. The optimization requires thatthe only change from line to line is that either channel or data numberincreases by 1. For BIN lines with events, it must be the channel number

    which increases.

  • 8/9/2019 Data Link Dnp v3

    33/39

    1KEL615158-02 5-29

    This is the bottom of sheet 2. The next step in order to load the configurationby means of the ConfigFlexgate program is to save sheet 2 as a text file, useFile - Save As... - Save as type: Text (Tab delimited) (*.txt) - Save. Ignore theerror messages as you are not saving the whole workbook here. (Butremember to save the workbook as a *.xls file). The saved *.txt file may thenbe viewed and loaded by the ConfigFlexgate program.

  • 8/9/2019 Data Link Dnp v3

    34/39

    5-30 1KEL615158-02

    5.5 ConfigFlexgate Program - View Config.

    The program may be activated from the Start button, from a shortcut or fromExplorer. The View Configbutton may be used to inspect a configuration file(Notepad could also be used). For this function it is not necessary to connect

    COM port 1 of the PC to FLEXGATE.

    After the standard file selection dialog, the View Config. function lists the fileline by line. Empty lines are not shown.

  • 8/9/2019 Data Link Dnp v3

    35/39

    1KEL615158-02 5-31

    5.6 ConfigFlexgate Program - Send Config.

    For this function, COM port 1 of the PC must be connected to theconfiguration port of the protocol converter by a standard modem cable.

    This shows the situation where the configuration from the worksheet examplehas just been sent to the protocol converter which has accepted theconfiguration, copied it to flash RAM and restarted. The sending is done byactivation of the Send Config. button which then initiates the standard fileselection dialog. Note that the last line in worksheet 2 was a SAVE command,not a CHECK command. But in order to check the transfer, theConfigFlexgate program changes the SAVE command into the proper CHECK

    command which makes the protocol converter check the checksum of all theconfiguration commands. The > character is the prompt from the protocolconverter. The Send function reads the input file and copies it line by line tothe COM port, skipping empty lines. It terminates when there are no moreconfiguration lines in the file or when no prompt is received from theconverter.

    Be careful not to leave the protocol converter in the state where it hasaccepted a CONFIG command but never received a SAVE or CHECKcommand. In this state there is no normal protocol handling. To get out of thestate, turn power off and on or retry Send Config.

  • 8/9/2019 Data Link Dnp v3

    36/39

  • 8/9/2019 Data Link Dnp v3

    37/39

    1KEL615158-02 5-33

    5.8 ConfigFlexgate Program - Ad Hoc Commands

    For this function, COM port 1 of the PC must be connected to theconfiguration port of the protocol converter by a standard modem cable.

    The window is shown after 5 useful commands have been entered:

    time - shows in the first line date and time and the number of days andmilliseconds since power-up of the protocol converter. The second lineshows that a valid minute pulse has not been received; MPULSE isconfigured, but in this case no minute interrupt is connected. The 3'rd linesays that time has been set from the DNP master, that the FLEXGATEclock was set 61 milliseconds forward in the last adjustment and that the

    internal CPU clock is counting 15998 pulses per millisecond. The count isinitially set to 16000 (16 MHz), but adjusted automatically according to theexternal time setting. The 4'th line shows the overall state and the DNPinput telegram state. The overall state is Ok running if the configuration isok and a legal DNP application request requiring a new response hasbeen received within the last 30 seconds. The last line shows the currentSPA-bus address, the SPA-bus activity and the input telegram state, herewaiting for the first byte (

  • 8/9/2019 Data Link Dnp v3

    38/39

    5-34 1KEL615158-02

    events queued at any time since reset (2) and the number of events whichcan at all be queued (1000). After that is shown the configation index ofthe next to be sent non-queued, but changed, binary input and the next tosend analog input, here both 0 meaning none. Any parameter to the dnpcommand (here clear) resets the message and error counts and the

    maximum number of queued events.

    spabus - shows error counts due to (not) received SPA-bus telegrams.Below that, one line for each SPA-bus communication address for whichan error has been detected since last reset. The lines show thecommunication address, the state of the relay, active or failed, and thetype of the last error. Here both relays have last given timeout. If it is aNACK, the NACK code is shown as well. NACK normally indicates somewrong SPA-bus Id in the configuration. As the last line, the times for thelast rounds through all relays reading of events and scanning of staticdata, i.e., the maximum response times for SPA-bus event data and static

    data respectively. Any parameter to the spabus command (here clear)resets the error counts.

    sbin- this command is used to show the current states of the binary inputsat and after a specified DNP index, within one configured BIN item. Foreach index, the state is shown as Onor Off. After the state, in a bracket,the DNP flag is shown in Hex, (01) = Online/Off, (81) = Online/On, (05) =Online/Comm.lost/Off. After the bracket, a * means that the object ismarked for transmission as a change, a +that it also has been transmittedand waits for confirmation. A !means that one or more events have beenqueued for the object since it was last statically read and since lastcomm.lost, event overflow or block state.

    sana- this command is used to show the current states and values of theanalog inputs at and after a specified DNP index, within one configuredANAitem. For each index, the value is shown as a signed 32-bit integer.After the value, in a bracket, the DNP flag is shown in Hex, (01) = Online,(05) = Online/Comm.lost. After the bracket, a *means that the object ismarked for transmission as a change, a +that it also has been transmittedand waits for confirmation.

    The last entered command is easily repeated by using the Enter key. Thecommands may be lower or upper case.

    The Clear Screen button just clears the two displayed text fields. This isnormally only needed when Ad Hoc commands have been entered. The 3Config. buttons all start by clearing the fields.

  • 8/9/2019 Data Link Dnp v3

    39/39

    6. PERFORMANCE

    The main limitation of the converter lies in the turn-around time on the SPA-bus. In normal operation, the FLEXGATE reads events (i.e., normally ensures

    that there are none) from one relay, then takes the next BIN or ANA lineconfigured without a = (only checkcycle), then reads events from the nextrelay and so on. As a practical mean, it can be estimated that it takes 100milliseconds for one read event + one read SPA-bus item. It is assumed thatthe DNP master asks for both binary and analog changes all the time and thatthere is no queue of pending changes.

    The response time to SPA-bus events depends only on the number of relays:

    maximum event response time =(0.1 seconds * number of relays) + DNP scan cycle time

    With f.ex. 15 relays and a DNP scan cycle of 0.5 seconds, this gives amaximum event response time of 2 seconds.

    The update cycle time for scanned SPA-bus items depends only on the totalnumber (and complexity) of BIN or ANA lines configured without a = (onlycheckcycle). This gives the following calculation:

    maximum age of scanned SPA-bus item =(0.1 seconds * number of scanned BIN and ANA items)+ DNP scan cycle time

    With f.ex. 150 scanned SPA-bus items (f.ex. 15 relays with 10 items each)and a DNP scan cycle of 0.5 seconds, this gives a maximum age in the DNPmaster of a scanned SPA-bus item of 15.5 seconds.

    Note that control commands and setpoints are executed immediately and thatthe controlled relay is checkcycled after the control in order to get changesdue to the control back fast. These activities will of course give longerresponse times for a while.