Just think, Just do it

复习 Bison

Bison的学习笔记

1. 见文件bison.simple
....................
YYPARSE_PARAM
   Macro for specifying the name of a parameter that yyparse should accept.
  
 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
    into yyparse.  The argument has type YYPARSE_PARAM_TYPE, which defaults
    to void* if you don't define it.
    It should actually point to an object.
    Grammar actions can access the variable by casting it
    to the proper pointer type, or by defining YYPARSE_PARAM_TYPE.  */
 
 #ifndef YYPARSE_PARAM_TYPE
 #define YYPARSE_PARAM_TYPE void*
 #endif

如也可
   #define YYPARSE_PARAM param
   #define YYPARSE_PARAM_TYPE void **
  
..............
YYERROR_VERBOSE
   Macro that you define with #define in the Bison declarations section
   to request verbose, specific error message strings when yyerror is called.  
  
%start symbol
Bison assumes by default that the start symbol for the grammar is the
first nonterminal specified in the grammar specification section.
The programmer may override this restriction with the %start declaration as follows:
  
...............
When you use %union to specify multiple value types, you must
declare the value type of each nonterminal symbol for which
values are used. This is done with a %type declaration, like this:
%type <type> nonterminal...

.............
Each nonterminal symbol must have grammatical rules showing how
it is made out of simpler constructs.  
By convention, it should be in lower case ( 一般小写)

token type terminal symbol :
By convention, these identifiers should be upper case to
distinguish them from nonterminals (一般大写)

Semantic Actions:动作
Locations :
When building a new location for a given grouping, the default
behavior of the output parser is to take the beginning of the
first symbol, and the end of the last symbol.

lexical analyzer :词法分析
The Bison parser calls the lexical analyzer each time it
wants a new token. It doesn't know what is "inside" the
tokens (though their semantic values may reflect this).
Typically the lexical analyzer makes the tokens by parsing
characters of text, but Bison does not depend on this.

yylex, recognizes tokens from the input stream and returns
them to the parser. Bison does not create this function
automatically; you must write it so that yyparse can call it.
The function is sometimes referred to as a lexical scanner.
yylex()函数必须自己写,bison不会自动产生( 词法函数 )
yyparse                              ( 语法函数 )
其中需要额外提供的函数:yylex()词法函数,yyerror()错误处理函数
如果当作独立程序:还需提供main();

如调试时,需定义yydebug()
 编译时: `-DYYDEBUG=1'
 或      `#define YYDEBUG 1'
 
 如果调试时没定义YYFPRINTF,YYPRINTF is defined to fprintf
 否则,调试时YYFPRINTF (stderr, format, args) --->printf
 -v 参数选项:可看具体 移进/规约

In simple programs, yylex is often defined at the end of the
Bison grammar file. If yylex is defined in a separate source
file, you need to arrange for the token-type macro definitions
to be available there. To do this, use the `-d' option when
you run Bison, so that it will write these macro definitions
into a separate header file `name.tab.h' which you can include
in the other source files that need it.

bison的文法构成.y构成
%{
C declarations // 可以包含#include ,包含库函数
%}

Bison declarations //包含terminal,nonterminal,优先级描述.....

%%
Grammar rules  // 对每个nonterminal语法规则
%%
Additional C code //yylex,额外的函数


#define YYSTYPE double
The Bison parser will use whatever type YYSTYPE is defined as;
if you don't define it, int is the default. Because we specify double,
each token and each expression has an associated value, which is a floating point number.

例子:
%{
#include <math.h>  /* For math functions, cos(), sin(), etc. */
#include "calc.h"  /* Contains definition of `symrec'        */
%}
%union {
double     val;  /* For returning numbers.                   */
symrec  *tptr;   /* For returning symbol-table pointers      */
}

%token <val>  NUM        /* Simple double precision number   */
%token <tptr> VAR FNCT   /* Variable and Function            */
%type  <val>  exp
.............
必须先用%union 第一所有的类型,再对每个类型定义
%type is used for declaring nonterminal symbols非终端字符
%token is used for declaring token types.   终端字符
多于一个数据类型的必须要%union来定义,再用%type,%token

...............
语法规则
result: components...
        ;

grammar specification section中第一个非终端字符作为起始字符
也可用下规则定义
%start symbol

栈溢出 YYMAXDEPTH(默认10000) YYINITDEPTH(默认200)

posted @ 2006-02-22 08:45 zfly 阅读(527) | 评论 (0) | 编辑 收藏
 
hehe,asn.1相关规范。。

今天终于把它抓下来了!可以同时学习ASN.1和MMS了。

学习ans.1.

  • Universal Mobile Telecommunication System (UMTS) 3rd Generation Partnership Project   (3GPP) Applications (RANAP, RRC, NBAP, RNSAP)
  • Security Related Specifications (X.509, PKCS, PKIX, X9 standards, XCBF Biometrics)
  • Computer Supported Telephony Applications (CSTA)
  • TAP3 (Transferred Account Procedure)
  • Telecom Protocols (GPRS, MAP, CAP, CAMEL)
  • Aeronautical Telecommunictions Network (ATN)
  • Manufacturing Message Specification (MMS)
  • H.323 VoiP related protocols (H.225, H.235, H.245)
  • T.38 Real-Time Fax over IP
  • Association Control Service Element (ACSE) and Remote Operation Support Element (ROSE)
  • 还有SNMP . 学习的相关于ASN.1

    posted @ 2006-02-20 13:23 zfly 阅读(449) | 评论 (0) | 编辑 收藏
     
    http://www.xialala.com/

    呵呵,这个网站,真是好!!
    以前提供下载的,音乐站点,前段时间由于版权问题,被迫改版。

    2年前就发现了,今天重新上去,呵呵,还好不赖,所以推荐给大家!!

    真是个好站点,好,好,好!!
    想听音乐,去看看吧。

    http://www.xialala.com/
    .....
    .
    .
    .
    .

    posted @ 2006-02-17 13:16 zfly 阅读(2123) | 评论 (11) | 编辑 收藏
     
    心情不好!!!
    心情很不好啊,理想、现实两彷徨···········
    无心情工作,无心情看书。。。 。。。。

    多语无益。。。。。。。。。。。
    posted @ 2006-02-14 09:44 zfly 阅读(275) | 评论 (2) | 编辑 收藏
     
    何时才能拥有下列整套标准的文档啊???

    IEC61850 - Substation Automation Communications
    * 61850-1 Introduction and Overview
    * 61850-2 Glossary
    * 61850-3 General Requirements
    * 61850-4 System and Product Management
    * 61850-5 Communications Requirements
    * 61850-6 Substation Configuration Language

    * 61850-7-1 Principles and Models
    * 61850-7-2 Abstract Communications Service Interface
    * 61850-7-3 Common Data Classes (Object Models)                            
    * 61850-7-4 Compatible Logical Node Classes and Data Classes (Object Models)
    * 61850-8 Protocol Mapping
    * 61850-9 Sampled Measured Values
    * 61850-10 Certification Test Procedures


    SCADA (System Control And Data Acquisition )

    posted @ 2006-02-13 15:57 zfly 阅读(332) | 评论 (1) | 编辑 收藏
     
    复习 tcp.ip ( 面试准备)

    1、iso 分层                            tcp/ip分层:
       应用层          application         链路层 arp,rarp
       表示层          presention            ( tcp/ip支持不同的链路层协议,不同的网络硬件有不同的,
       会话层          session                 以太网,令牌环网,FDDI,RS232,如以太网的串行协议slip,ppp,clip)     
       传输层          transport           网络层 ip ,icmp igmp,bgp,ospf                 
       网络层          network             传输层 tcp udp                       
       数据链路层      link                应用层 telnet,http,ftp,email 
       物理层             physics                                          
      
         传统TCP拥塞控制机制采用了4种机制:当拥塞窗口(cwnd)(为表述简单起见,这里拥塞窗口是指最大
      未应答的数据包个数,在实际实现中拥塞窗口是指最大未应答字节数)小于慢启动门限窗口ssthresh时,采用慢  启动机制,用于探测网络的可用带宽,每个数据包被应答后,cwnd就加1;当cwnd大于门限窗口ssthresh时,采用拥  塞避免机制,避免可能发生的拥塞,并尽可能地探测可用带宽,每个数据包被应答后cwnd+=1/cwnd;当发送端收到  重复ACK(DupACK)时,采用快速重传机制重发DupACK指示的数据包,以及快速恢复机制对cwnd和ssthresh重新赋  值,避免进入慢启动阶段;当重传定时器RTO(retransmission timeout)超时时,进入慢启动阶段.
         
       针对OSI模型:
       路由器:    网络层
       三层交换机: 网络层
       二层交换机: 数据链路层
       Hub:        应用于OSI参考模型第一层,又被称为物理层设备。

       组播地址:D类 224.0.0.0 - 239.255.255.255
      
       滑动窗口
       基本原理是:滑动窗口内含有一组顺序排列的报文序号,在发送端,窗口内报文序号对应的报文可以
        连续发送。这些报文包括已发送但未得到确认、未发送但可连续发送和已发送且已得到确认三种。由于本窗口中前    面尚有未确认的报文,一旦窗口前面报文得到确认,窗口向前滑动相应位,落入窗口的后续报文又可连续发送。在    接收端,窗口内的序号对应于容许接收帧。窗口前的帧是已收到且已发回确认的帧,不容许接收;窗口后的帧要等    待窗口滑动后,才能接收。为了使流控有效、信道效率提高和避免拥塞,TCP采用慢启动、拥塞规避、快速启动和快    速恢复四种拥塞控制机制,通过调整窗口尺寸来控制流量,避免拥塞,并充分利用信道。
       
        网络                         最大传输单元MTU字节  
       ------------------------------------------------
       超通道                                     65535                       
       4Mb/s令牌环(IBM)                 17914
       10Mb/s令牌环(IEEE 802.5)     4464
       FDDI                                         4352
       以太网                                      1500
       IEEE 802.2 /802.3                     1492
       X.25                                          576 ( 网络游戏开发UDP实现可靠传输考虑到拨号上isdn,
                                                                 adsl,采用此种做最大报文,避免分包,减少时延)
       点对点(低时延 如PPP SLIP)  296
              
    2、serial
       采用150pF/m的通信电缆时,最大通信距离为15m;
       存在共地噪声和不能抑制共模干扰等问题,因此一般用于20m以内的通信。

    posted @ 2006-02-13 12:04 zfly 阅读(3247) | 评论 (4) | 编辑 收藏
     
    Nibble Memory 动态内存管理技术

    在常见的规约编程中要用到内存分配,如要求严格则可利用Nibble Memory 策略,如要求更加
    严格且需要大块内存如数据库设计中的内存分配,则需自己些分配策略,我以前些的文章中
    有一些介绍,如firebird、MaxDB中,SQLite、apache中。在通讯规约中如电力规约,还有其他大型
    规约中那种频繁使用小块内存的协议栈,可考虑使用Nibble Memory 。

     ICCP(TASE.2)是建立在MMS和ASN TCP/IP或ISO协议之上,在实现时可用Nibble Memory 策略,
    一些开源代码可参考snacc 、yaz等代码中。这些高质量代码往往可为我所用。

    posted @ 2006-02-07 10:57 zfly 阅读(771) | 评论 (0) | 编辑 收藏
     
    ASN.1 -- MMS --ICCP ( TABSE2) --- 笔记 @_@

    MMS的ASN.1规定( 8825-1 BER 8825-2 PER )

      8  7   6  5  4  3  2  1         +        Length        +       Content
    -------------------------------------------------------------------------
    |Class |X |      Tag    |                                                |             
    -------------------------------------------------------------------------          
    Class:   
    0 0 Universal
    0 1 Application
    1 0 Context-speciatic:指Type不需传送,双方约定 IMPLICIT
    1 1 prviate

    X :
    0 ---- primitive   -----指定:content without a Structure 只有 1个Length 1个Content
    1 ---- contructed  -----指定:content with addition structure
                                (如squence,squence of , implicit squence ,implicit squence of )
                                (Type , Length ,Content )任意个嵌套T-L-C
    Tag:
    ASN.1中Tag可能超过5个Bits,但是MMS中不会出现

    Length: 指Content的长度。可以任意长度, 

    例子:
    1.单个OCTET STRING (ASN.1 key word )
    Type (= OCTET STRING), Length (= 5 Octets) and Content (= 24 65 4F EF F3 hex)
     T  L  C
     -  -  --------------
     04 05 24 65 4F EF F3
     
    2.有上下文中的[2]IMPLICIT OCTET STRING (多[2]IMPLICIT )
     T  L  C
     -  -  --------------
     82 05 24 65 4F EF F3
     --            
     1 0 0 0 0 0 1 0  05  24 65 4F EF F3
     ---   ---------
     1 0 : Context-speciatic
     0 0 0 1 0: 02 primitive , value = 2
     
     3.有上下文中的[2] OCTET STRING (多个[2] 无关键字IMPLICIT )
      T     L  C
               -----------------------
               T    L   C
               -    -   --------------
      82   07  04   05  24 65 4F EF F3
               -----------------------> OCTET STRING
     
     82:
      1 0 1 0 0 0 1 0
      --- - ---------
      1 0 : Context-speciatic
      1   : constructed
     
    The DER are particularly advisable for the coding of short messages; 适合短消息
    the CER are suitable for very long messages 适合长消息    

    The "A0" in the first line says that it is a MMS definition
    (A = 1010 hex for the first four bits of the ASN.1 types - context-specific and constructed).
    The "0" is the tag that contains the number in square brackets on the right. 

    数据映射到MMS

    ICCP (具体到购买何种Block)
    ICCP Server ObjectS
    1.Association
    2.Data Value
    3.Data Set
    4.Transfer Set
    5.Account             
    6.Device
    7.Program
    8.Event
    9.Conformance Blocks and Associated Objects 
    9-1 Block 1 (Periodic Power System Data)保护事项对象是可选的
        Indication Point Object、 Status Points、Analog Points、Quality Codes
        Time Stamp、COV Counter、Protection Equipment Event Object
       
    9-2 Block 2 (Extended Data Set Condition Monitoring)
        主要是用来report-by-exception, or RBE,以节省带宽。
       
    9-3 Block 3 (Block Data Transfer) 
        主要用来如何利用ASN.1节省传送字节
       
    9-4 Block 4 (Information Messages)
    9-5 Block 5 (Device Control)
    9-6 Block 6 (Program Control)
    9-7 Block 7 (Event Reporting)    
    9-8 Block 8 (Additional User Objects)
    9-9 Block 9 (Time Series Data)

    Three TASE.2 operations are defined for use in managing associations: Associate, Conclude, and Abort
    Associate:用在客户端,用来跟服务器建立联系。 Conclude, Abort服务器、客户端均可用。

    数据传送机制
    a) One Shot Data
    b) Periodic Data
    c) Event Data
    d) Exception Data(如不变不送,... ... )

    Direct-Control (NonSBO)noninterlocked
    Select-Before-Operateinterlocked. (SBO) 带选择控制 

    包含tag的service or data
    -------------------------------
    尚未知道的tag?????
    #define AARE_apdu1 0x61
    #define AARQ_apdu0 0x60
    #define ABRT_apdu4 0x64
    #define RLRE_apdu3 0x63
    #define RLRQ_apdu2 0x62

    #define acse_result_diagnostic3 0xa3
    #define acse_result2         0xa2
    #define acse_service_user1     0xa1

    Data ::= CHOICE {                                     
     -- context tag 0 is reserved for AccessResult         
     IF ( str1 )                                           
      array       [1] IMPLICIT SEQUENCE OF Data,                  
     ELSE                                                  
      array       [1] IMPLICIT NULL,                              
     ENDIF                                                 
     IF ( str2 )                                           
      structure   [2] IMPLICIT SEQUENCE OF Data,              
     ELSE                                                  
      structure   [2] IMPLICIT NULL,                          
     ENDIF                                                 
      boolean  [3] IMPLICIT BOOLEAN,                         
      bit-string  [4] IMPLICIT BIT STRING,                   
      integer     [5] IMPLICIT INTEGER,                         
      unsigned    [6] IMPLICIT INTEGER, -- shall not be negative
      floating-point [7] IMPLICIT FloatingPoint,            
                 --  [8] is reserved                                    
      octet-string   [9] IMPLICIT OCTET STRING,               
      visible-string [10] IMPLICIT VisibleString,           
      generalized-time [11] IMPLICIT GeneralizedTime,       
      binary-time      [12] IMPLICIT TimeOfDay,                  
      bcd              [13] IMPLICIT INTEGER, -- shall not be negative   
      booleanArray     [14] IMPLICIT BIT STRING,                
      objId            [15] IMPLICIT OBJECT IDENTIFIER,                
      ...,                                                  
      mMSString        [16] IMPLICIT MMSString                     
    }              

    GetNameList-Request ::= SEQUENCE {
     objectClass [0] ObjectClass,
     objectScope [1] CHOICE {
     vmdSpecific [0] IMPLICIT NULL,
     domainSpecific [1] IMPLICIT Identifier,
     aaSpecific     [2] IMPLICIT NULL },
     continueAfter  [2] IMPLICIT Identifier OPTIONAL }
    GetNameList-Response ::= SEQUENCE {
     listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier,
     moreFollows      [1] IMPLICIT BOOLEAN DEFAULT TRUE } 

    AcknowledgeEventNotification-Request ::= SEQUENCE {
     eventEnrollmentName          [0] ObjectName,
     acknowledgedState            [2] IMPLICIT EC-State,
     timeOfAcknowledgedTransition [3] EventTime } 
     
    ConfirmedServiceRequest包含很多choice

    flex ,yacc/bison 的脚本???   

    RFC1006
    主要描述ISO 高4层利用TCP/IP的传输层功能来进行传输,实现ISO
    具体描述各种原语TP和TCP的对应关系

    参考文档:
    Transport service  [ISO8072]
    Transport protocol [ISO8073]        

    In order to achieve good performance, the default TPDU size is
    65531 octets, instead of 128 octets. In order to negotiate a
    smaller (standard) TPDU size, the negotiation mechanism
    specified in [ISO8073] is used
    连接利用TCP 102端口

    TCP TP最大区别:TCP包是流式的,没有边界
                   TP发送的是离散的对象(NSDUs).  
    TP0
    TP4
     initiate negotiation初始化需要商讨的东西(Vendor需发布的东西)

    CASM
    ASCE


     

    posted @ 2006-02-06 09:39 zfly 阅读(1441) | 评论 (0) | 编辑 收藏
     
    MMS- 笔记

    ASN.1 tag
    -------------------------
    BOOLEAN            01
    INTEGER            02
    BITSTRING          03
    OCTETSTRING        04
    NULL               05
    OBJECT IDENTIFIER  06

    SEQUENCE           10
    IA5STRING          16
    UTCTIME            17
    GENERALIZETIME     18
    VISIBLESTRING      1A

    L
    LENGTH:
    If the length of the DATA is less than 128 bytes, the LENGTH is that number of bytes.
    If the length of the DATA is greater than or equal to 128 bytes, the LENGTH is
    encoded as several bytes.The first indicating how many bytes encode the actual
    length, and with bit 7 set. The subsequent length bytes contain the actual length.

    V
    Data

    ====================================================
    MMS
    主要目的是定义一套用来在设备和计算机程序之间高度互通、协同工作的通讯标准
    -----------------------------------------------------               
    Part 1 is the service specification.
         The service specification contains a definition of
    1) the Virtual Manufacturing Device,
    2) the services (or messages) exchanged between nodes on a network, and
    3) the attributes and parameters associated with the VMD and services.

    ISO9506-1定义了服务(Service)规范,包括:
     (1)虚拟制造设备(VMD,Virtual Manufacturing Device)概念的引入和定义;
     (2)网络环境下各节点之间服务或报文的交换规则定义;
     (3)与VMD和服务有关的属性和参数的定义
     
    ISO9506-1定义了如下几大类服务:
     (1)环境及通用管理服务(Environment And General Management Services);
     (2)虚拟制造设备支持服务(VMD Support Services);
     (3)域管理服务(Domain Management Services);
     (4)程序管理服务(Program Invocation Management Services);
     (5)变量访问服务(Variable Access Services);
          Read ,Write,InformationReport,GetVariableAccessAttributes
          DefineNamedVariable,DeleteVariableAccess
          DefineNamedVariableList
          GetNamedVariableListAttributes
          DeleteNamedVariableList
          DefineNamedType
          DeleteNamedType
          GetNamedTypeAttributes
         
     (6)信号量管理服务(Semaphore Management Services);
     (7)操作员通信服务(Operator Communication Services);
     (8)事件管理服务(Event Management Services);
     (9)日志管理服务(Journal Management Services)。
     
    Part 2 is the protocol specification. The protocol specification
           defines the rules of communication which includes
    1) the sequencing of messages across the network,
    2) the format (or encoding) of the messages, and
    3) the interaction of the MMS layer with the other layers of the communications network.
    ISO/IEC 9506-2定义了协议(Protocol)规范,包括:
     (1)报文的执行序列;
     (2)报文或编码的格式;
     (3)MMS层与OSI参考模型其它层的相互作用关系

    协议规范使用表示层标准ISO8824即抽象语句标识(ASN.1,Abstract Syntax Notation Number One)
    定义MMS的报文格式。MMS提供了通过网络进行对等(peer-to-peer)实时通信的一套服务集。
    MMS应该可以支持多种通信方式,包括以太网、令牌总线、RS-232C、OSI、TCP/IP、MiniMAP、FAIS等,
    MMS也可通过网桥、路由器或网关连接到其它系统上。

    互操作性 
    MMS标准还提供了如下的定义:
     (1)对象(Object):  MMS定义了一套通用对象(如变量)及这些对象的网络可见属性(如名字、值、类型)。
     (2)服务(Service): MMS定义了一套访问和管理网络环境下对象的通信服务(如读、写)。
     (3)行为(Behavior):MMS定义了当执行相关服务时,设备所应表现出的网络可见行为。

     对象、服务、行为的定义构成了一套关于设备和应用在VMD模型中如何通信的规范。VMD模型只定义
     了通信的网络可见方面,对于实际设备如何实现VMD模型的细节,如编程语言、操作系统、CPU类型
     和I/O系统等MMS则不作定义。通过定义设备的网络可见部分的行为,MMS的VMD模型就能使设备之间
     具有很高的互操作性,同时这些定义又不妨碍设备和应用内部使用不断创新的新技术。
     a.The Developer of the Application
     b.Network Connectivity
     c.Function Performed.
     
    独立性
     与很多只适用于特定产品的专用通信系统不同,MMS是一个通用的、独立于专用设备的国际标准体系。
     MMS为用户提供了一个独立于所完成功能的通用通信环境

    MMS, as an application layer protocol
    provides application services to the business functions, not connectivity services.
    只提供连通服务消息机制,并没有提供连通服务。

    MMS的关键特点是VMD模型,定义了:
    a. objects (e.g. variables) that are contained in the server,
    b. the services that a client can use to access and manipulate these objects
       (e.g. read or write a variable), and
    c. the behavior of the server upon receipt of these service requests from clients.

    MMS 对象
    a. VMD Object
       Status,UnsolicitedStatus,Identify
      
       属性:
       Capabilities、Logical Status、Physical Status
       服务:
       Status、UnsolicitedStatus、 GetNameList、 Identify.
      
    b. Variable and Type Objects
       变量访问模型
        MMS Variables是a virtual object ,只是指明访问实际变量(real variable)的路径,
        MMS Variables的创建、删除只是针对访问路经,并不指实际的变量。
       
        两种类型MMS Variables:
        1. Unnamed Variable Object: 通过设备地址访问,为了兼容老设备
           属性:
              Address
                (地址表示法:Numeric(e.g. 103),Symbolic(e.g. "R001" or "N7:0"),Unconstrained )
              MMS Deletable
              Type Description
        2. Named Variable Object
           属性:
              MMS Deletable
              Type Description
              Access Method       
      
    c. Program Control Objects (Domains and Program Invocations)  
       A MMS domain is defined as an object that represents a resource
       within the VMD (e.g. the memory in which a program is stored).
      
       the VMD execution model provides for MMS clients are:
       .Services for commanding a VMD to upload/download their domains to/from a
         MMS client or file in a filestore system (either in the VMD or external to the VMD)
       .Services for a VMD to request a domain upload/download from a client.
       .Start, Stop, Reset, Resume, and Kill services for controlling the execution
         of program invocations.
       .Services for deleting, creating, and obtaining the attributes of domains and
         program invocations.
        
       VMD执行模型:
       Domains模型---代表MMS对象中实际设备的一些资源,如:连续数据块,内存
       (思想借鉴于工业过程控制中的批处理...)
        属性:
            Capabilities
            State        - LOADING, COMPLETE, INCOMPLETE, READY, or IN-USE
            Deletable
            Sharable
        服务:
            InitiateDownloadSequence
            DownloadSegment
            TerminateDownloadSeqence
            InitiateUploadSequence
            UploadSegment
            TerminateUploadSequence
            DeleteDomain
            GetDomainAttributes
            RequestDomainDownload
            RequestDomainUploa
      LoadDomainContent
      StoreDomainContent
       Program Invocations模型(思想借鉴于UNIX Execution Thread)
         A program invocation is an execution thread which consists
         of a collection of one or more domains.(一段可执行代码??)
         属性:
           State
           List of Domains
           Deletable
           Reusable
           Monitored
           Execution Argument
         服务:
           CreateProgramInvocation
        DeleteProgramInvocation
        GetProgramInvocationAttributes
           Start
           Stop
           Reset
           Resume
           Kill
     
    d. Event Objects    
      . event conditions :the state of an event
        两种类型
        a. Network Triggered
        b. Monitored
        ab共同属性:
          MMS Deletable
          State
          Priority
          Severity
        b的属性:
          Monitored Variable 
          Enabled
          Alarm Summary Reports
          Evaluation Interval
          Time of Last Transition to Active
       Time of Last Transition to Idle
      服务:
        DefineEventCondition.
           DeleteEventCondition.
           GetEventConditionAttributes
           ReportEventConditionStatus
           AlterEventConditionMonitoring
           GetAlarmSummary      
      . event enrollments:who to notify about the occurrence of an event
          属性:
           MMS Deletable
           Event Condition
           Transitions
           Notification Lost
      . event actions    :the action that the VMD should take upon the occurrence of an event
         属性:
           MMS Deletable
           Service Request
         服务:
           DefineEventAction.
           DeleteEventAction.
           GetEventActionAttributes
           GeportEventActionStatus
     
    e. Semaphore Objects (以Unix的Semphore/token为原型)

       Token Semaphores属性:
          Deletable
          Number of Tokens
          Owned Tokens
          Hung Tokens
       Pool Semaphores属性: 
          Free Named Tokens
          Owned Named Tokens
          Hung Named Tokens
         
    f. Journal Objects
    g. Operator Station Object
    h. File
    i. MMS CONTEXT MANAGEMENT
    MMS provides services for managing the context of communications between two MMS
    nodes on a network. These services are used to establish and terminate application
    associations and for handling protocol errors between two MMS nodes.

    VMD
    A server is a device or application that contains a VMD
             and its objects (variables, etc.).
    A client is a networked application (or device) that asks for
             data or an action from the server.

    In a very general sense, a client is a network entity that issues
    MMS service requests to a server. A server is a network entity that
    responds to the MMS requests of a client.

    MMS模型中通用的方法是:
    Get,Set,QueryAttributes,Create,Delete
    具体的每个对象、服务的定义都可Map到现在的面向对象编程思想中

    Object Scope:
    VMD Wide
    Domain Specific
    Association Specific
    to the Manufacturing
    Message Specification (MMS)
    ---------------------------------------------------------------
    ASN.1
    BER(Basic Encoding Rules ,X.209)

    X6801

    编码规则的区别:
    1. DER
    为确保编码的唯一性,出现了CER和DER两种编码方案,它们均为BER子集。
    其中DER只使用定长编码,CER基于不定长编码。

    2. PER
    在PER中,tag从不传送,length和value如果双方都知道,也不需传送。
    因此,其编码更精简,效率更高。

    The key difference between them is that DER uses the definite
    length form of encoding while CER uses the indefinite length
    form. DER is more suitable for the small encoded values,
    while CER is more suitable for the large ones.

    Whereas the basic encoding rules give the sender of an encoding
    various choices as to how data values may be encoded,
    the canonical and distinguished encoding rules select just one
    encoding from those allowed by the basic encoding rules, eliminating
    all of the sender's options. The canonical and distinguished encoding
    rules differ from each other in the set of restrictions that they
    place on the basic encoding rules.

    The distinguished encoding rules is more suitable than the canonical
    encoding rules if the encoded value is small enough to fit into the
    available memory and there is a need to rapidly skip over some nested
    values. The canonical encoding rules is more suitable than the distinguished
    encoding rules if there is a need to encode values that are so large that
    they cannot readily fit into the available memory or it is necessary to
    encode and transmit a part of a value before the entire value is available.
    The basic encoding rules is more suitable than the canonical or distinguished
    encoding rules if the encoding contains a set value or set-of value and there
    is no need for the restrictions that the canonical and distinguished encoding
    rules impose


    8.6.2 制造自动化协议
    (1) 定义map,是美国通用汽车公司(gm)提出的一种用于制造自动化的局域网协议。
    (2) mms有两种称呼:iso把它叫做manufacturing message specification或iso9506,
          而eia则定名为maunfacturing messaging service或rs-511
    (3) mms协议的核心是vmd
    (4) mms主要有八大类应用功能:上下文管理,加工程序传输管理,加工程序运行控制,
         变量访问,操作员通信,vmd支持,时间管理和日志管理
    (5) mms是一种不对称主-从式通信协议,使用了发起者和响应者的概念
    (6) mms采用有连接证实型通信方式,两个mms用户必须线在它们之间建立联系,然后才可以在mms环境中交换信息。

    posted @ 2006-01-23 08:54 zfly 阅读(1325) | 评论 (1) | 编辑 收藏
     
    姚明-火箭NBA
    麦蒂的广告被恶搞:

      曾经有一个绝妙的广告摆在 阿迪达斯的面前,几乎可以成为经典。"连老天都感动得哭了。"这是一个集英雄主义、超人能力和煽情技术于一体的成功广告,但由于麦蒂的低迷状态、受伤以及火箭的连败,现在越看这个广告越像是一次讽刺。最终的结果是,广告悄悄地撤了,耐克得意地笑了。

      随后,这个广告被人在网络上恶搞,成为一个个经典笑话。当麦蒂因为太太生孩子缺席比赛后,一个改编版的广告词是:"还有半场,麦蒂跑了,生儿子去了。""瞎扯,是女儿。""是儿子!""管他呢,反正是跑了。"

      一个流传最广的恶搞改编词则是:"客场,剩20秒,斯威夫特站在罚篮线上。""瞎扯,是主场!""管他呢,反正球没进。""没时间喘气,鲍文带球冲向边线,对手不屑堵截,但他仍火力十足!三分线外飙射!砰!球击中了一位摄影师。""只剩三秒!麦蒂带球冲过前场,整个球场都在呐喊助威!无人防守,麦蒂飞了起来!出手,是左手!啊,三不沾!连老天都恶心得哭了。"

    posted @ 2006-01-19 10:08 zfly 阅读(336) | 评论 (2) | 编辑 收藏
     
    仅列出标题
    共14页: First 6 7 8 9 10 11 12 13 14 
     
    <2006年4月>
    日一二三四五六
    2627282930311
    2345678
    9101112131415
    16171819202122
    23242526272829
    30123456

     公告


    我创建的群:21159852,欢迎大家加入! ( Scada,DCS,PLC, RTU,VxWorks, Linux,104,101, DNP,MODBUS ...... )

     导航

    • IT博客
    • 首页
    • 发新随笔
    • 发新文章
    • 联系
    • 管理

     统计

    • 随笔: 137
    • 文章: 3
    • 评论: 97
    • 引用: 0

    常用链接

    • 我的随笔
    • 我的评论
    • 我参与的随笔

    留言簿(9)

    • 给我留言
    • 查看公开留言
    • 查看私人留言

    随笔分类(141)

    • 学习C C++(28) (rss)
    • 本人作品 ---下载(3) (rss)
    • 生活(47) (rss)
    • 知识(47) (rss)
    • 通讯规约(16) (rss)

    随笔档案(137)

    • 2009年2月 (1)
    • 2008年6月 (3)
    • 2008年4月 (1)
    • 2008年2月 (2)
    • 2007年12月 (1)
    • 2007年11月 (1)
    • 2007年10月 (2)
    • 2007年9月 (1)
    • 2007年8月 (2)
    • 2007年7月 (4)
    • 2007年6月 (4)
    • 2007年5月 (4)
    • 2007年4月 (6)
    • 2007年3月 (4)
    • 2007年2月 (2)
    • 2007年1月 (1)
    • 2006年12月 (1)
    • 2006年11月 (1)
    • 2006年9月 (6)
    • 2006年8月 (12)
    • 2006年7月 (1)
    • 2006年6月 (6)
    • 2006年5月 (9)
    • 2006年4月 (3)
    • 2006年3月 (10)
    • 2006年2月 (10)
    • 2006年1月 (11)
    • 2005年12月 (12)
    • 2005年11月 (2)
    • 2005年10月 (6)
    • 2005年9月 (8)

    文章分类(2)

    • 技术类(2) (rss)

    文章档案(3)

    • 2013年1月 (1)
    • 2008年4月 (1)
    • 2005年8月 (1)

    相册

    • SCADA

    上传

    • about apache
    • 学习工业控制方面 -知识的好网站
    • 学学老外的思想!

    最新随笔

    • 1. 好久没上来了哦
    • 2. 看看未来的节能车,61850竟然也包括其通讯
    • 3. News on IEC 61850
    • 4. 口乃心户之门!
    • 5. 活着!
    • 6. 在HK
    • 7. On-business
    • 8. life..
    • 9. AB PLC
    • 10. AN OVERVIEW OF REAL-TIME DATABASE SYSTEMS

    搜索

    •  

    积分与排名

    • 积分 - 112262
    • 排名 - 66

    最新评论

    • 1. re: IEC104
    • 能否给我一份代码呢。最近刚开始学习104规约,邮箱是270797194@qq.com。不胜感激啊
    • --兵兵
    • 2. re: IEC104
    • 请将源码发给我学习学习啊,lucas_woo@gmail.com。谢谢!!!
    • --ww
    • 3. re: 哎,老有人问我Modbus CRC 算法!! 今天贴出代码!!(超值)以后不再回答
    • 嗯,楼主,谢谢了
    • --sanwen
    • 4. re: 下步学习内容!(下一代规约... ... ASN.1不学不行啊!!)
    • 貌似asnlab 的 ADT软件确实不错,编解码速度快,
    • --迷你猫
    • 5. re: 下步学习内容!(下一代规约... ... ASN.1不学不行啊!!)
    • 从来没接触过asn。1,如何可以最快上手?期待,lengshu66@163.com
    • --me

    阅读排行榜

    • 1. Cygwin(或linux) 中环境变量的配置(要区分BASH 和TCSH)(5017)
    • 2. 下步学习内容!(下一代规约... ... ASN.1不学不行啊!!)(4992)
    • 3. 哎,老有人问我Modbus CRC 算法!! 今天贴出代码!!(超值)以后不再回答(4843)
    • 4.  1M带宽到底是多少?和磁盘的1M有什么区别?(4618)
    • 5. 查看. ODT文件! 同时支持windows 和linux(3455)

    评论排行榜

    • 1. IEC104(27)
    • 2. 下步学习内容!(下一代规约... ... ASN.1不学不行啊!!)(11)
    • 3. http://www.xialala.com/(11)
    • 4.  1M带宽到底是多少?和磁盘的1M有什么区别?(10)
    • 5. 查看. ODT文件! 同时支持windows 和linux(6)

    Powered by: 博客园
    模板提供:沪江博客
    Copyright ©2025 zfly