SYS600_IEC 1107 ProtocolENc

24
MicroSCADA Pro SYS 600 *9.1 IEC 1107 Protocol Configuration Manual

description

SYS600_IEC 1107 ProtocolENc

Transcript of SYS600_IEC 1107 ProtocolENc

  • MicroSCADA ProSYS 600 *9.1IEC 1107 Protocol

    Configuration Manual

  • MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.11MRS755054Issued: 26.03.2003Version: C/25.02.20051. About this manual .....................................................................51.1. Copyrights .....................................................................................51.2. Trademarks ...................................................................................51.3. General .........................................................................................51.4. Document revisions .......................................................................6

    2. Instructions ................................................................................72.1. Communication session ................................................................72.2. Autocaller ......................................................................................72.3. The ATR station ............................................................................9

    2.3.1. The attribute interface of the ATR station ..........................92.3.2. System messages generated by the ATR station ............11

    2.4. The IEC 61107 protocol process .................................................122.4.1. The attributes of the IEC 61107 line process ...................122.4.2. System status messages of IEC 61107 line process .......152.4.3. Error status codes of the IEC-1107 line process .............15

    2.5. Messages from the IEC 61107 Device to MicroSCADA .............152.5.1. Program example .............................................................16

    3. Index .........................................................................................19Copyright 2005 ABB Oy, Substation Automation Products, Vaasa, FINLAND 3

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual5

    1. About this manual

    1.1. CopyrightsThe information in this document is subject to change without notice and should not be construed as a commitment by ABB Oy. ABB Oy assumes no responsibility for any errors that may appear in this document.

    In no event shall ABB Oy be liable for direct, indirect, special, incidental or consequential damages of any nature or kind arising from the use of this document, nor shall ABB Oy be liable for incidental or consequential damages arising from use of any software or hardware described in this document.

    This document and parts thereof must not be reproduced or copied without written permission from ABB Oy, and the contents thereof must not be imparted to a third party nor used for any unauthorized purpose.

    The software or hardware described in this document is furnished under a license and may be used, copied, or disclosed only in accordance with the terms of such license.

    Copyright 2005 ABB Oy All rights reserved.

    1.2. TrademarksRegistrations and trademarks used in this document include:

    LonWorks: Registered trademark of Echelon Corporation Inc.

    1.3. GeneralThis manual provides thorough information on the IEC 61107 protocol and needed information related to it. It describes the implementation of the interface between MicroSCADA and the IEC 61107 device.

    Note! Standard IEC 61107 has been replaced with standard IEC 62056-21. If the equipment to be connected supports standard IEC 62056-21 only, please contact your local supplier.

    OverviewThe communication between MicroSCADA and an external device with IEC 61107 protocol is designed to be processed as a batch. This means that the MicroSCADA application program first downloads the batch of the IEC 61107 messages to the PC-NET and then starts the communication between the external device and the PC-NET (the communication unit of MicroSCADA). During the communication phase, the PC-NET sends downloaded messages to the external device. Replies to these messages are sent to MicroSCADA as spontaneous messages to the bit stream process object.

  • 1MRS755054MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.16

    InterfaceThe interface between MicroSCADA and an external device is divided into two layers: the application layer and the link layer.

    The application layer is mainly used to store downloaded messages before sending them to the external device. The station process of the PC-NET executes the functions of the application layer. The station process type is ATR_DEVICE (code 27).

    The link layer handles most of the functionalities of the interface. The link layer is called the process line. The type of the IEC 61107 protocol line is IE_PROTOCOL (code 26).

    1.4. Document revisions

    Version Revision number Date HistoryA 4.0 26.03.2003 Document createdB 9.0 30.06.2004 Document updatedC 9.1 25.02.2005 New revision number

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual7

    2. Instructions

    2.1. Communication sessionOne communication session contains a sequence of messages, which will be sent to the external device by MicroSCADA. These messages must be created by the application program of MicroSCADA. The PC-NET is transparent to IEC 61107 messages. The PC-NET adds only the block check character, BCC, to the end of an outgoing IEC 61107 message. The PC-NET adds the serial number of the message to the beginning of the reply message sent by the external device. This is done to make the identification of the reply messages easier. The application program downloads messages of a session to the PC-NET by using the AM attribute.

    The session must include messages to execute handshake and terminate connection between MicroSCADA and the IEC 61107 external device.

    In the following example you can see a minimum session:

    Example:@S1 = / ? ! CR LF handshaking@S2 = ACK 0Z1 CR LF selects the communication mode@S3 = SOH P1 STX (password) ETX password check

    (Data reading messages must be placed here.)@S4 = SOH B0 ETX terminate connection

    The PC-NET adds the BCC character to the end of messages. (Messages that begin with SOH- or STX-characters have BCC characters at the end.)

    2.2. Autocaller The Autocaller process (ACE) of MicroSCADA is used to connect the PC-NET to the IEC 61107 device power meter with telephone lines. The ACE implementation of the IEC 61107 device interface works the same way as the ACE of the RTU and STA lines (refer to the System Objects manual).

    If the AC attribute of an IEC line is active, you (or the application program) can dial the IEC 61107 device by writing the phone number of the CN attribute. It is possible to call the IEC 61107 device before or after the downloading session and the starting session. The telephone connection to the IEC 61107 device breaks if you write an empty string to the CN attribute, or, if the connection time limit is exceeded. Notice that the PC-NET does not break the telephone connection automatically.

    Following ACE attributes are applicable with the IEC 61107 device line:

    AC ACESelects if the Autocaller is in use or not.

    Value: 0, no Autocaller1, Autocaller is connected

    Access: read/write

  • 1MRS755054MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.18

    AS ACE StateThe state of the Autocaller.

    value: 0, IDLE1, CONNECTED2, BUSY3, INITIAL

    Access: read-only

    CL Connection time limitedIndicates whether the connection time is limited or not.

    Value: 0, no time limit1, time limitation is in use (see CT-attribute)

    Access: read/write

    CN ConnectionIs used to call or break the telephone connection. An empty string closes the connection.

    Value: string of telephone number, max 25 characters Access: write

    CS Connected stationIndicates which station the frontend is communicating with.

    Value: Integer, 0..255. The STA object number, 0=no stationAccess: write

    CT Connection timeThe maximum time that a connection is allowed to last (if CL = 1).

    Value: integer, 1..655 secondsAccess: read/write

    PU Pulse diallingSelects tone or pulse dialling.

    Value: 0, tone dialling1, pulse dialling

    Access: read/write

    SR ACE AT S registersIs used to rewrite S registers of modem, see the ACE manual.

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual9

    2.3. The ATR stationThe interface of an ATR station object provides attributes for sending of IEC 61107 messages.

    2.3.1. The attribute interface of the ATR stationFollowing attributes are used by the ATR station:

    IU In UseThis attribute defines if the station process is in use or not.

    Value: 0, not in use1, in use

    Access: read/write

    When the station is taken out of use, initialized station data and the FIFO message are cleared.

    AL AllocationIndicates if the ATR station is allocated on a certain application or not.

    Value: 0, not allocated1, allocated

    Access: read/write

    AS Allocating Application The number of the application which has reserved the station.

    Value: Integer, 1 .. 32. The APL number as known in the PC-NET.Access: read/write

    MI Message IdentificationIndicates which object address in the process database the station sends the system messages to.

    Value: Integer, 1 .. 65535Access: read/write

    MS Message SystemIndicates the application number where the system messages of station are sent.

    Value: Integer, 1 .. 32. The APL number as known in the PC-NET.Access: read/write

  • 1MRS755054MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.110

    AM IEC 61107 MessageWhen you use the AM attribute, the application program downloads the command messages, which are sent by one communication session, from the PC-NET to the IEC 61107 device. The AM attribute has no indexes because messages are stored into the FIFO memory of the Alpha application layer. The FIFO memory has space for 16 messages.

    Messages are written to the AM attribute as unsigned 8 bit vector. The reply of the AM attribute indicates the amount of messages in the FIFO queue. The FIFO memory can be cleared by taking the alpha protocol line temporarily out of use (IU=0).

    Value: when writing: vectorwhen reading: integer, number of messages in FIFO

    Access: read/write

    vector = array (1..62) of unsigned 8

    It is also possible to modify the application so that only one message is active throughout the session. Start the session by writing the first message to the AM attribute. Then set the ST attribute. When the bitstream process objects have received and processed the reply, the next outgoing message is always written to the AM attribute, up to the end of the session. It may be easier to handle the replies by using this method. Always check the RT-attribute of the process object before processing!

    ST Start sessionThe ST attribute enables the communication between the PC-NET and the IEC 61107 device. The communication starts when the connection between the PC-NET and the IEC 61107 device is established (with modem lines). The communication starts immediately if the interface is direct or the connection is already established.

    Value: when writing 1, starts the sessionwhen reading 0, session not active1, session active

    Access: read/write

    Please contact your local supplier for more information, if required.

    The application layer does not do protocol conversion to the downloaded messages. Therefore, the application program of MicroSCADA is responsible for the correct syntax of the messages.

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual11

    2.3.2. System messages generated by the ATR stationThe ATR device sends the following system status messages to the base system:

    Error status codes:

    13751 ATRP_SESSION_ENABLED This message is the reply to the session start command (ST=1). The actual session begins when the connection between the PC-NET and the IEC 61107 device is established.

    13753 ATRP_SESSION_FINISHED This message is sent by the PC-NET when the session is ready. (All session messages are successfully sent and they have all received a correct reply). The application program of MicroSCADA can use this system status message code to detect when the session is finished.

    13755 ATRP_SESSION_STOPPEDThe enabled session is stopped by user (IU=0).

    13754 ATRP_SESSION_ABORTED The session is not finished correctly. The IEC 61107 device has not sent replies to session messages. Or, the base system has not got the correct bitstream object to receive the IEC 61107 device messages.

    13752 ATRP_NOT_ALLOWED_WHILE_COMMUNICATINGThe error status reply to the AM attribute writing while the session is still active.

    13756 ATRC_UNKNOWN_ATTRIBUTE The error reply status code to an unknown attribute.

    13757 ATRC_SESSION_FIFO_FULLThe error status reply to the AM attribute writing when the FIFO session is full.

    13758 ATRC_TOO_LONG_MESSAGE The error status reply to the AM attribute writing when the message is too long to fit FIFO.

    13759 ATRC_STATION_NOT_IN_USE The error status reply to the starting session (ST=1), when the station is not in use.

    13760 ATRC_LINE_NOT_IN_USE The error status reply to the starting session (ST=1), when the line is not in use.

  • 1MRS755054MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.112

    2.4. The IEC 61107 protocol processAlthough the ABB Alphameter and the IEC 61107 device power meter use the same station process, they both have their own line processes that are dependent on the protocol. The line process of the IEC 61107 device interface performs the IEC 61107 protocol.

    2.4.1. The attributes of the IEC 61107 line process

    IU In UseIndicates if the IEC 61107 interface is in use or not.

    Value: 0, not in use1, in use

    Access: read/write

    MI Message IdentificationIndicates to which object address in the process database the line process sends the system messages.

    Value: Integer, 1 .. 65535Access: read/write

    MS Message SystemIndicates the application number where the line system message are sent.

    Value: Integer, 1 .. 32. The APL number as known in the PC-NET.Access: read/write

    AC AutocallerThis attribute determines if the Autocaller is used.

    PD Poll DelaySpecifies the time between two command messages that are sent by the PC-NET to the IEC 61107 device.

    Value: Integer, 0 .. 65535 milliseconds, practical values with MT-30 (500..1200 ms)

    Access: read/write

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual13

    BR Baud RateIndicates the baud rate of the line. The baud rate of the IEC 61107 device line cannot be changed during an active session.

    Value: Integer, 110 .. 19200 baudAccess: read/write

    EN Enquiry LimitThe EN attribute specifies the maximum number of times that a telegram is retransmitted before the PC-NET gives up, if the Eneremet does not respond.

    Value: Integer, 1 .. 255Access: read/write

    HT Header Time-out LengthSpecifies the maximum allowed time when waiting for the first character of the IEC 61107 device reply message. If the character does not arrive in time, the previously sent message is retransmitted (max EN times).

    Value: Integer, 0 .. 65535 millisecondsAccess: read/write

    TI Time-out LengthSpecifies the maximum allowed time from the first character to the last character of the IEC 61107 device message.

    Value: Integer, 1.. 65 secondsAccess: read/write

    RI Receiver Enable DelayDefines when the receiver of the line is enabled after a message has been issued. This attribute must be tuned if the used hardware echoes the transmitted bytes to the receiver.

    Value: Integer, 0.. 65535 seconds

    Access: read/writeDefault: 5

    0: Receiver always enabled1..9: Receiver enabled at once when a message has been

    transmitted10..65535: Delay time in milliseconds from the end of the

    message transmission to the receiver enabling.

  • 1MRS755054MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.114

    DC Diagnostic CounterThe PC-NET line has a set of 16 diagnostic counters. The IEC 61107 line uses the counter set as described below:

    1. TRANSMITTED TELEGRAMS incremented each time a message is successfully transmitted.

    2. FAILED TRANSMISSIONS incremented each time a CTS or DCD signal prevents a transmission.

    3. Not used4. Not used5. Not used6. MESSAGE BUFFER OVERFLOWS

    incremented each time a message longer than 230 characters has been received.7. Not used8. Not used9. MESSAGE TIMEOUTS

    incremented each time when a transmitted message has not received a reply.10. Not used11. RECEIVED MESSAGES

    incremented each time a message has been received from the IEC 61107 device without errors.

    12. PARITY ERRORS incremented each time a message has been rejected because of a parity error.

    13. OVERRUN ERRORS incremented each time a message has been rejected because of a receiver

    overrun.14. BCC ERRORS

    incremented each time a message has been rejected because of the checksum.15.FRAMING ERRORS

    incremented each time a message has been rejected because of the character format.

    16. SCC BUFFER OVERFLOW ERRORS incremented each time a message has been rejected because of the checksum.

    values: integer, 0..65535access: read/write

    PY, RD, TD, SBThese attributes are normal communication control attributes of the PC-NET line. They will have default values when the IEC 61107 device line of the PC-NET is started.

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual15

    2.4.2. System status messages of IEC 61107 line processThe following system status messages are defined for the IEC 61107 line process.

    2.4.3. Error status codes of the IEC-1107 line process

    2.5. Messages from the IEC 61107 Device to MicroSCADAThe replies for the session messages are sent from the PC-NET to the base system with bitstream messages. The application program of MicroSCADA must be used to move necessary data from reply messages to the corresponding process objects.

    Notice that the SCIL program that does the translation must be started by the event channel (when the bitstream process object has been updated), because the PC-NET writes successive reply messages to the same process object.

    17452 IECP_LINE_PASSIVATEDLine is passivated by the Autocaller, the user has disconnected the connection.

    17458 IECP_CONNECTION_ESTABILISHEDThe IEC 61107 device has responded to the first session message.

    17456 IECP_SESSION_STOPPEDThe line is set out of use when the session is not yet finished.

    17451 IECP_SESSION_ABORTEDThe session has failed because of the IEC 61107 device. The PC-NET has not received correct replies from the IEC 61107 device.

    17450 IECP_SESSION_READYAll messages from the FIFO session have been sent correctly to the IEC 61107 device.

    It is not recommended to use the IECP_SESSION_READY (17450) system status message when searching for the correct ending of the session. The IEC 61107 device replies are sent to the base system via the station process and it is possible that the SESSION_READY status messages reaches the base system before the last IEC 61107 device reply.

    17453 IECP_BUFFER_NOT_READYInternal buffer handling problem.

    17454 IECP_ERR_REPLY_FROM_DEVICEThe reply from the Enemet MT-30 has not been accepted because of a BCC or character format error (after retrying).

    17455 IECP_NO_REPLY_FROM_DEVICEThe IEC 61107 device MT-30 has not replied to the command message.

    17457 IECP_SESSION_ENDS_TO_CTS_ERROThe session is aborted because of a CTS error.

  • 1MRS755054MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.116

    The PC-NET adds the serial number of the message (within one session) to the beginning of the IEC 61107 device reply, to make the identification of the messages easier. The user cannot change the address of the bitstream object, it is OA= 1. If the reply is longer than 224 bytes, the next block is written to another bitstream process object, OA=2. The maximum length of a reply is 16384 bytes, which means that the process objects with OA=1..74 are updated with the longest possible reply.

    2.5.1. Program exampleThe base system station object of ATR type must be created. The common way to do this is to add following lines to the end of the SYS_BASCON.COM file: #CREATE STA:V = LIST(- TT = "EXTERNAL",- ST = "ATR",- ND = 2,- TN = 1)#CREATE STA1:B = %STA

    The following SCIL script can be used to create an IEC 61107 line and a station object to the PC-NET 2. @NET=2 @STA=1 @LINE=1 #SET NET'NET':SPO'LINE'=26 #SET NET'NET':SDV(27)=(1,1) #SET NET'NET':SIU'LINE'=0 #SET NET'NET':SBR'LINE'=300 #SET NET'NET':STI'LINE'=25 #SET NET'NET':SPD'LINE'=1000 #SET NET'NET':SRI'LINE'=50 #SET NET'NET':SEN'LINE'=10 #SET NET'NET':SSD'LINE'="COM7" ;uses COM7 #SET STA'STA':SIU=0 #SET STA'STA':SAL=1 #SET STA'STA':SAS='NET' #SET STA'STA':SIU=1 #SET STA'STA':SHM=2

    #SET NET'NET':SIU'LINE'=1

    The reading of general registers:1. #SET STA1:SAM = (47,63,33,13,10)

    /* /?!crlf */#SET STA1:SAM = (6,48,48,49,13,10)

    /* ack001crlf */#SET STA1:SAM = (1,80,49,2,40,74,74,74,41,3)

    /* sohP1stx(JJJ)etx */#SET STA1:SAM = (1,82,49,2,71,82,82,40,49,44,50,44,50,41,3)

    /* sohR1stxGRR(1,2,2)etx */#SET STA1:SAM = (1,66,48,3,11

    /* sohB0etx*/#SET STA1:SST = 1 /* enable session */#SET NET1:SCN1=123456 /* dialling to the IEC 61107 device power meter */

    Replies:bitstream =(1,/EMO0MT30v2.20crlf)bitstream = (2,sohP0stx()etxbcc)bitstream = (3,ack)

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual17

    bitstream = (4,stx(0*kwh)crlf(0*kvarh)etxbcc)bitstream = (5,ack)

    The following example shows the unpacking of bitstream to bytes:@VEC = UNPACK_STR(BITS:P1,1)@LEN = LENGTH(%VEC)@BIT_NO = 1@I = 0

    #LOOP %I < (%LEN DIV 8) @VAL = 1 @BTY = 0 #LOOP_WITH X = 1 .. 8 IF %VEC(%BIT_NO) == 1 #THEN #BLOCK @BTY = %BTY + %VAL #BLOCK_END @VAL = %VAL*2 @BIT_NO = %BIT_NO + 1 #LOOP_END #SET BITS:P(%I) = %VAL @BTY = 0 @I = %I+1#LOOP_END

  • 1MRS755054 SYS 600 *9.1MicroSCADA ProIEC 1107 ProtocolConfiguration Manual19

    3. Index

    AAC ......................................................................................................... 7, 12ACE ............................................................................................................ 7ACE AT S registers .................................................................................... 8ACE State ................................................................................................... 8AL ............................................................................................................... 9Allocating Application ............................................................................... 9Allocation ................................................................................................... 9Alphameter ............................................................................................... 12AM ............................................................................................................ 10Application layer ........................................................................................ 6AS ........................................................................................................... 8, 9ATR-station ................................................................................................ 9Autocaller ............................................................................................. 7, 12

    BBaud Rate ................................................................................................. 13BR ............................................................................................................. 13

    CCL ............................................................................................................... 8CN ............................................................................................................... 8Connected station ....................................................................................... 8Connection .................................................................................................. 8Connection time .......................................................................................... 8Connection time limited ............................................................................. 8Counter set ................................................................................................ 14CS ............................................................................................................... 8CT ............................................................................................................... 8

    DDC ............................................................................................................. 14Diagnostic counter .................................................................................... 14

    EEN ............................................................................................................. 13Enquiry Limit ........................................................................................... 13Error status codes ............................................................................... 11, 15

    HHandshake .................................................................................................. 7Header Time-out Length .......................................................................... 13HT ............................................................................................................. 13

    IIEC 61107 message .................................................................................. 10

  • 1MRS755054MicroSCADA ProIEC 1107 ProtocolConfiguration Manual

    SYS 600 *9.120

    IEC 61107 protocol .................................................................................... 5IEC 62056-21 ............................................................................................. 5In Use ................................................................................................... 9, 12IU .................................................................................................... 9, 11, 12

    LLink layer ................................................................................................... 6

    MMessage Identification ......................................................................... 9, 12Message System ................................................................................... 9, 12MI ......................................................................................................... 9, 12MS ........................................................................................................ 9, 12

    PPC-NET ...................................................................................................... 7PD ............................................................................................................. 12Poll Delay ................................................................................................. 12PU ............................................................................................................... 8Pulse dialling .............................................................................................. 8PY ............................................................................................................. 14

    RRD ............................................................................................................ 14Receiver Enable Delay ............................................................................. 13RI .............................................................................................................. 13

    SSB ............................................................................................................. 14SR ............................................................................................................... 8ST ............................................................................................................. 10Start session .............................................................................................. 10System status messages ............................................................................ 11

    TTD ............................................................................................................ 14Terminate Connection ................................................................................ 7TI .............................................................................................................. 13Time-out Length ....................................................................................... 13

  • ABB OySubstation Automation ProductsP.O. Box 699FI-65101 VaasaFINLANDTel. +358 10 22 11Fax. +358 10 224 1094www.abb.com/substationautomation

    1MR

    S75

    5054

    EN

    02.

    2005

    About this manualCopyrightsTrademarksGeneralDocument revisions

    InstructionsCommunication sessionAutocallerThe ATR stationThe attribute interface of the ATR stationSystem messages generated by the ATR station

    The IEC 61107 protocol processThe attributes of the IEC 61107 line processSystem status messages of IEC 61107 line processError status codes of the IEC-1107 line process

    Messages from the IEC 61107 Device to MicroSCADAProgram example

    Index