⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fdl_rb.h

📁 SPC3 SETUP PROGRAMS SP C3 SETUP PROGRAMS
💻 H
📖 第 1 页 / 共 3 页
字号:
//-----------------------------------------------------------------------------
// $Id: fdl_rb.h,v 0.0.0.1                                          2003/10/17
//-----------------------------------------------------------------------------
//
//      ProfiM - PROFIBUS MASTER DRIVER FOR WINDOWS NT/2000
//
// Author:
//   First part:
//      Siemens AG
//   Additions:     
//      Pavel Trnka, CTU FEE
//      trnkap@seznam.cz
// With help and advices from:
//      Ing. Petr Smolik, CTU FEE
//      Ing. Pavel Pisa, CTU FEE
//      Ing. Pavel Burget, CTU FEE
//-----------------------------------------------------------------------------
//
// Popis:
// ------
//   Hlavickovy soubor API rozhrani ProfiMu byl pro umozneni kompatibility 
// a siroke pouzitelnosti postaven na puvodnim hlavickoveho souboru 'fdl_rb.h'
// od firmy Siemens. 
//   K doplneni puvodniho hlavickoveho souboru o casti potrebne pro ProfiM jsme
// pristoupil proto, aby pro pouziti knihovny 'profim.lib' stacil pouze jeden
// hlavickovy soubor.
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------


#ifndef _FDL_RB_H_INCD_
  #define _FDL_RB_H_INCD_

#include <windows.h>

/****************************************************************************/
/*                                                                          */
/*   Project           : SCI                     ,###.   ,###.   #####      */
/*   Filename          : fdl_rb.h                #   #   #   #     #        */
/*   Version           : 1.4                      #      #         #        */
/*   System            : MSDOS/WINDOWS/WinNT       #     #         #        */
/*                                                  #    #         #        */
/*                                               #   #   #   #     #        */
/*                                               `###'   `###'   #####      */
/*                                                                          */
/****************************************************************************/
/*   Function         : Definitions concerning INA960 commands and request  */
/*                      blocks                                              */
/****************************************************************************/
/*                                                                          */
/*         Copyright (C) Siemens AG 1991, 1999. All Rights Reserved         */
/*                                                                          */
/****************************************************************************/

#pragma pack(1)

#ifndef UBYTE
#define UBYTE unsigned char
#endif
#ifndef UWORD
#define UWORD unsigned short
#endif
#ifndef ULONG
#define ULONG unsigned long
#endif


/* ------------------- */
/* definitions for FLC */
/* ------------------- */

#define   FLC_Subsys    0x22

#define   DEFAULT_SAP   0xff
#define   EVENT_SAP     64
#define   NO_SEGMENT    0xff
#define   BROADCAST     127             /* broadcast-addr.: rem_add.station, dsap = 63  */
#define   MULTICAST     127             /* multicast-addr.: rem_add.station, dsap != 63 */

#define   LEN_MAX_RECEIVE_BUFFER  255    /* max. buffer-length for a receive telegram    */
#define   LEN_MIN_RECEIVE_BUFFER  32     /* min. receive_l_sdu.length                    */

#define   ALL                     0x7f
#define   SEGMENT_VALID           0x80
#define   SEGMENT_INVALID         0x00
#define   SEGMENT_TYP             0x40

    /* example */
    /*   access_sap = ALL or sap_number;                                                */
    /*   access_station = (ALL or station_number) + (SEGMENT_VALID or SEGMENT_INVALID); */
    /*   if SEGMENT_VALID: access_segment = SEGMENT_TYP + segment_number (0 ... 63);    */

    /* SERVICE */
#define   SDA_RESERVED            0x00
#define   SDN_RESERVED            0x01
#define   SRD_RESERVED            0x03
#define   CSRD_RESERVED           0x05

    /* ROLE */
#define   INITIATOR               0x00            /* only possible by "sap_activate"                                      */
#define   RESPONDER               0x10            /* possible by "sap_activate" and mandatory by "rsap_activate"          */
#define   BOTH_ROLES              0x20            /* only possible by "sap_activate"                                      */
#define   SERVICE_NOT_ACTIVATED   0x30            /* service not activated                                                */


#define   STATION_PASSIVE         0x00
#define   STATION_NON_EXISTANT    0x10
#define   STATION_NON_EXISTENT    0x10
#define   STATION_ACTIVE_READY    0x20
#define   STATION_ACTIVE          0x30

#define   LEN_SAP_ACTIVATE        sizeof(struct fdl_sap)
#define   LEN_EVENT_INDICATION    sizeof(struct event_indication)

typedef enum { flc_false, flc_true } flc_boolean;

enum  com_class
{
    request                 = 0x00,
    confirm                 = 0x01,
    indication              = 0x02
};

enum  service_code
{
    sda                             = 0x00,       /* Send Data with Acknowledge                                           */
    sdn                             = 0x01,       /* Send Data with no Acknowledge                                        */
    sdn_broadcast                   = 0x7f,       /* only for FDL-indication !!! (signs received broadcast-telegram)      */
    srd                             = 0x03,       /* Send and Request Data                                                */
    csrd                            = 0x05,       /* Cyclic Send and Request Data                                         */
    reply_update_single             = 0x06,       /* Reply Update Single Mode                                             */
    reply_update_multiple           = 0x07,       /* Reply Update Multiple Mode                                           */
    fdl_read_value                  = 0x0b,       /* read busparameter                                                    */
    fdl_set_value                   = 0x0c,       /* set busparameter                                                     */
    sap_activate                    = 0x0e,       /* activate local SAP                                                   */
    rsap_activate                   = 0x11,       /* activate local Responder-SAP                                         */
    sap_deactivate                  = 0x12,       /* deactivate local (R)SAP                                              */
    fdl_reset                       = 0x13,       /* reset PHY and FDL; all FDL-information is lost, exc. last busparam.  */
    mac_reset                       = 0x15,       /* reset for MAC; a part of last valid busparameter will be updated     */
    fdl_event                       = 0x18,       /* only for indication, list of events                                  */
    lsap_status                     = 0x19,       /* requests information of remote-SAP or local-SAP                      */
    fdl_life_list_create_remote     = 0x1a,       /* requests list of intact stations                                     */
    fdl_life_list_create_local      = 0x1b,       /* requests quick-list of intact stations (LAS and GAP will be actual)  */
    fdl_ident                       = 0x1c,       /* requests data of software- and hardware-release                      */
    fdl_read_statistic_ctr          = 0x1d,       /* NOT SUPPORTED! reads counter values of statistic and resets counter                 */
    fdl_read_las_statistic_ctr      = 0x1e,       /* NOT SUPPORTED! reads LAS and las_cycle_ctr and resets las_cycle_ctr                 */
    await_indication                = 0x1f,       /* provides resources for indication (sap-dependent)                    */
    withdraw_indication             = 0x20,       /* returnes indication-resources                                        */
    load_routing_table              = 0x21,       /* only for network-connection !!!                                      */
    deactivate_routing_table        = 0x22,       /* only for network-connection !!!                                      */
    get_direct_conn                 = 0x23,       /* gets adress of next station                                          */
};

enum  service_class
{
    low                             = 0x00,
    high                            = 0x01
};

enum  link_status
{
    ok                      = 0x00,               /* ACK. positive                                                        */
    ue                      = 0x01,               /* ACK. negative:   remote-USER/FDL interface error                     */
    rr                      = 0x02,               /* ACK. negative:   no remote resource available                        */
    rs                      = 0x03,               /* ACK. negative:   service or rem_add at remote-lsap not activated     */
    dl                      = 0x08,               /* response-data (l_sdu) low available                                  */
    nr                      = 0x09,               /* ACK. negative:   no response-data at remote-FDL available            */
    dh                      = 0x0a,               /* response-data (l_sdu) high available                                 */
    rdl                     = 0x0c,               /* response-data (l_sdu) low available, but negative-ACK for send-data  */
    rdh                     = 0x0d,               /* response-data (l_sdu) high available, but negative-ACK for send-data */
    ls                      = 0x10,               /* service not activated at local sap                                   */
    na                      = 0x11,               /* no reaction (ACK/RES) from remote-station                            */
    ds                      = 0x12,               /* local FDL/PHY not in token-ring                                      */
    no                      = 0x13,               /* ACK. negative:   not ok (different meanings dependant on service)    */
    lr                      = 0x14,               /* resource of local FDL not available                                  */
    iv                      = 0x15,               /* invalid parameter in request                                         */
    lo                      = 0x20,               /* LOw-prior response-data are sent at this srd                         */
    hi                      = 0x21,               /* HIgh-prior response-data are sent at this srd                        */
    no_data                 = 0x22                /* NO-DATA are sent at this srd                                         */
};

enum    poll_element_entry
{
    unlocked                = 0x00,               /* polling enabled for this element                                     */
    locked                  = 0x01,               /* element locked for this poll-cycle                                   */
    not_changed             = 0x02                /* the same meaning as "unlocked", but layer 2 doesn't plausible this   */
                                                  /* service; use only, if this element has already been sent and no      */
                                                  /* parameter changed, but actualize receive_l_sdu.length !!!!!!!!!      */
};

enum    station_type
{
    passive                 = 0x00,
    active                  = 0x01,
    active_fast             = 0x02,
    passive_fast            = 0x03,
    sm_active               = 0x04,               /* possible returned by read_value (PROFIBUS-PA)                        */
    sm_passive              = 0x05
};

enum    baud_rate
{
    kbaud_9_6               = 0x00,
    kbaud_19_2              = 0x01,
    kbaud_93_75             = 0x02,
    kbaud_187_5             = 0x03,
    kbaud_500               = 0x04,
    kbaud_375               = 0x05,
    kbaud_750               = 0x06,
  /*CT_CHANGE*/
    mbaud_1_5               = 0x07,
    mbaud_3                 = 0x08,
    mbaud_6                 = 0x09,
    mbaud_12                = 0x0a,
    kbaud_45_45             = 0x0c                /* 09-06-1997: a new baud rate */
};

enum    redundancy
{
    no_redundancy           = 0x00,
    bus_a_highprior         = 0x01,
    bus_b_highprior         = 0x02,
    redundancy_on           = 0x03
};

enum    physical_layer
{
    rs485                   = 0x00,
    modem                   = 0x01
};

enum    false_bus_parameter             /* "fdl_set_value" : if FDL-User sets false bus_parameter,              */
                                        /* application_block -> l_status = false_bus_parameter + iv;            */
                                        /* that means, high-byte corresponds with number of false parameter     */
{
    false_hsa                       = 0x100,
    false_ts                        = 0x200,
    false_station_type              = 0x300,
    false_baud_rate                 = 0x400,
    false_medium_red                = 0x500,
    false_retry_ctr                 = 0x600,
    false_default_sap               = 0x700,
    false_network_connection_sap    = 0x800,
    false_tsl                       = 0x900,
    false_tqui                      = 0xa00,
    false_tset                      = 0xb00,
    false_min_tsdr                  = 0xc00,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -