参考资料
关于MMS比较全的介绍在ISO9506系列,IEC61850-8-1是一种映射,将MMS协议也划归进IEC61850的大框架中。有时间的话推荐去看原文。
- Manufacturing Message Specification(MMS)-Part 1 Service definition ISO International Standard ISO 9506-1, 2003
- Manufacturing Message Specification(MMS)-Part 2 Protocol Definition ISO International Standard ISO 9506-2, 2003
- IEC 61850-8-1, Communication networks and systems in substations – Part 8-1: Specific communication service mapping (SCSM) – Mappings to MMS (ISO/IEC 9506-1 and ISO/IEC 9506-2) and to ISO/IEC 8802-3
- MMS Introduction (nettedautomation.com)
- Manufacturing Message Specification – ISO 9506 (MMS) Dipl.-Ing. Karlheinz Schwarz
MMS简介
基本功能
ISO9506共有6个部分,1、2两部分定义了服务和协议,3、4、5、6分别是在机械、数控、PLC和过程控制方面的实现,所以该协议可以用于汽车、电力、航天等领域。
MMS全称是Manufacturing Message Specification,制造报文规范。是一种面向抽象对象的协议,其支持15个类对象和80个操作类对象的服务。常见类的说明如下
- Environment and General Management Services 处理网络连接。
- VMD Support VMD全称为Virtual Machine Device, 是对现实物理设备的一种映射。
- Domain 表示 VMD 中的可加载资源(例如程序)。 个人理解就是一块存储空间,可以存储变量、程序、文件等内容,处理上传下载等任务。
- Program Invocation 程序调用,由一个或多个域组成的可运行程序。
- Variable 变量,类型化数据的元素(例如整数、浮点数、数组等)。
- Named Variable List 已命名的变量列表。
- Event 表示事件和动作状态的对象。
- Semaphore 信号量,用于控制共享资源访问的对象。
- Operator Stations 供操作员使用的“显示器”和“键盘”。
- Journals 日志,对事件和变量的记录。
- Files 文件。
下表就是全部的对象和服务,表2的前两列包含从1990年开始的MMS版本1的所有MMS对象和服务的列表。第三列到第五列包含有关服务应用领域的声明,服务分为三组:
- 远程配置(例如对象的创建、属性的参数化、对象的连接)
- 数据采集(采集过程数据和对象及其参数)
- 对象的操作(对象属性的修改)
第四列指示 TASE.2 使用哪些对象和服务,第五列指示 UCA CASM 使用的对象和服务(暂时不用管)。
MMS object | MMS service/operation | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|---|
Association | ||||||
Initiate | x | X | ||||
Reject | ||||||
Conclude | x | X | ||||
Abort | x | X | ||||
Cancel | ||||||
VMD | ||||||
UnsolicitedStatus | X | |||||
Status | X | X | ||||
GetNameList | X | x | X | |||
Identify | X | X | ||||
Rename | X | |||||
GetCapabilityList | X | X | ||||
Unnamed Variable | ||||||
Named Variable | ||||||
Scattered Access | ||||||
Named Variable List | ||||||
Named Type | ||||||
Read | x | x | X | |||
Write | X | x | X | |||
InformationReport | X | x | X | |||
GetVariableAccessAttributes | X | x | X | |||
DefineNamed Variable | x | |||||
DefineScatteredAccess | x | |||||
GetScatteredAccessAttributes | X | |||||
DeleteVariableAccess | X | |||||
DefineNamed VariableList | X | x | X | |||
GetNamed VariableListAttributes | X | x | X | |||
DeleteNamed VariableList | X | x | ||||
DefineNamedType | X | |||||
GetNamedTypeAttributes | X | |||||
DeleteNamedType | X | |||||
Operator Station | ||||||
Output | X | |||||
Input | X | |||||
Semaphore | ||||||
TakeControl | X | |||||
RelinquishControl | X | |||||
DefineSemaphore | X | |||||
DeleteSemaphore | X | |||||
ReportSemaphoreStatus | X | |||||
ReportPoolSemaphoreStatus | X | |||||
ReportSemaphoreEntryStatus | X | |||||
AttachToSemaphore | X | |||||
Domain | ||||||
InitiateDownloadSequence | X | |||||
DownloadSegment | X | |||||
TerminateDownloadSequence | X | |||||
InitiateUploadSequence | X | |||||
UploadSegment | X | |||||
TerminateUploadSequence | X | |||||
RequestDomainDownload | X | |||||
RequestDomainUpload | X | |||||
LoadDomainContent | X | |||||
StoreDomainContent | X | |||||
DeleteDomain | X | |||||
GetDomainAttributes | X | |||||
Program Invocation | ||||||
CreateProgram Invocation | X | |||||
DeleteProgram Invocation | X | |||||
Start | X | x | ||||
Stop | X | x | ||||
Resume | X | x | ||||
Reset | X | x | ||||
Kill | X | x | ||||
GetProgram InvocationAttributes | X | x | ||||
Event Condition | ||||||
Event Action | ||||||
Event Enrollment | ||||||
DefineEventCondition | X | |||||
DeleteEventCondition | X | |||||
GetEventConditionAttributes | X | |||||
ReportEventConditionStatus | X | |||||
AlterEventConditionMonitoring | X | |||||
TriggerEvent | X | |||||
DefineEventAction | X | |||||
DeleteEventAction | X | |||||
GetEventActionAttributes | X | |||||
ReportEventActionStatus | X | |||||
DefineEventEnrollment | X | x | ||||
DeleteEventEnrollment | X | x | ||||
AlterEventEnrollment | X | |||||
ReportEventEnrollmentStatus | X | |||||
GetEventEnrollmentAttributes | X | x | ||||
AcknowledgeEventNotification | X | |||||
AttachToEventCondition | X | |||||
EventNotification | X | x | ||||
GetAlarmSummary | X | |||||
GetAlarmEnrollmentSummary | X | |||||
Journal | ||||||
Journal Entry | ||||||
ReadJournal | X | X | ||||
WriteJournal | X | X | ||||
InitializeJournal | X | X | ||||
CreateJournal | X | X | ||||
DeleteJournal | X | X | ||||
ReportJournalStatus | x | X |
基本概念
ASN.1是**Abstract Syntax Notation one×(抽象语法标记语言)**的缩写,是以「定义信息的结构」为目的语言,是由ISO和ITU-T规定的一套标准。ASN1的子集有BER,CER,DER,PER,XER,其中MMS采用的是BER规范。官方文档为ISO8824和ISO8825.
下表为ASN1定义的基本数据类型,其他的数据均由基本数据或者基本数据组合而成。
universal code | 类型 | 含义 |
---|---|---|
0 | reserved for BER | |
1 | Boolean | 布尔值 |
2 | Integer | 全部整数(包括正数和负数) |
3 | Bitstring | 比特串 |
4 | Octetstring | 字节串 |
5 | Null | 只包含一个值NULL,用于传送一个报告或者作为CHOICE类型中某些值 |
6 | Object identifier | 一个实体的标识符,它在一个全世界范围树状结构中注册,缩写OID,点分十进制 |
7 | Object descriptor | 可读的对象描述 |
8 | External | 表示层上下文交换类型 |
9 | Real | 实数,表示浮点数 |
10 | Enumerated | 标识符的枚举(实例状态机的状态) |
11-15 | Reserved for future editions of this International Standard | |
16 | Sequence and Sequence-of | |
17 | Set and Set-of | |
18-22,25-27 | Character string | 允许为字符串协商一个明确的字符表 各种字符串,有NumericString、PrintableString、 VisibleStirng、ISO64String、IA5String、TeletexStirng、T61String、VideotexString、GraphicString、GeneralString、UniversalString、BMPString和UTF8String |
23-24 | Time | |
28-… | Reserved for addenda to this International Standard |
默认的组合类型有
类型 | 含义 |
---|---|
CHOICE | 在类型中选择(类似C中的联合) |
SEQUENCE | 由不同类型的值组成一个有序的结构 |
SET | 由不同类型的值组成一个无序的结构 |
SEQUENCE OF | 由相同类型的值组成一个有序的结构 |
SET OF | 由相同类型的值组成一个无序的结构 |
所有的string类型有
Character Type | Tag | Description |
---|---|---|
BMPString | 30 | Basic Multilingual Plane of ISO/IEC/ITU 10646-1 |
IA5String | 22 | International ASCII characters (International Alphabet 5) |
GeneralString | 27 | all registered graphic and character sets plus SPACE and DELETE |
GraphicString | 25 | all registered G sets and SPACE |
NumericString | 18 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, and SPACE |
PrintableString | 19 | a-z, A-Z, ’ () +,-.?:/= and SPACE |
TeletexString | 20 | CCITT and T.101 character sets |
UniversalString | 28 | ISO10646 character set |
UTF8String | 12 | any character from a recognized alphabet (including ASCII control characters) |
VideotexString | 21 | CCITT’s T.100 and T.101 character sets |
VisibleString | 26 | International ASCII printing character sets |
报文结构
总体结构
MAC | IP | TCP | TPKT | COTP | ISO-SP | ASN.1 | ACSE | MMSpdu |
---|
ACSE(association control service element)中mms的标志字节为 Hex 020103。
TPKT的TCP端口号为102,跟S7协议相同。
MMSpdu
有14种类型,每种类型底下包含不同的服务,内容较多,详见文件 MMSpdu.gmind, 建议重点关注confirm request类型。
其他
- MMS是抽象的,不包含应用层的操作(如改变发动机转速)。
- MMS支持对IEC103的封装,相当于可以制造IEC103的报文,同理其他协议的报文也可以产生。