diff --git a/directory.json b/directory.json index cad8d748..34a22af4 100644 --- a/directory.json +++ b/directory.json @@ -402,6 +402,10 @@ { "title": "HEIDENHAIN CNC", "path": "configuration/south-devices/heidenhain-cnc/heidenhain-cnc" + }, + { + "title": "MTConnect", + "path": "configuration/south-devices/mtconnect/mtconnect" } ] }, @@ -994,6 +998,10 @@ { "title": "HEIDENHAIN CNC", "path": "configuration/south-devices/heidenhain-cnc/heidenhain-cnc" + }, + { + "title": "MTConnect", + "path": "configuration/south-devices/mtconnect/mtconnect" } ] }, diff --git a/en_US/api/configuration.md b/en_US/api/configuration.md index f19c0d78..25637276 100644 --- a/en_US/api/configuration.md +++ b/en_US/api/configuration.md @@ -102,6 +102,7 @@ Neuron provide a series of API services for IIoT platform, to query the basic in * 200 OK * 400 * 2001 node type invalid + * 2004 node setting invalid * 404 * 2301 library not found * 409 @@ -115,6 +116,13 @@ Neuron provide a series of API services for IIoT platform, to query the basic in "name": "modbus-tcp-node", //plugin name "plugin": "Modbus TCP" + //setting (optional) + "params": { + "param1": 1, + "param2": "1.1.1.1", + "param3": true, + "param4": 11.22 + } } ``` @@ -1683,9 +1691,9 @@ Response to the error code, when an error response occurs. } ``` -## Add Template +## Put Drivers -*POST* /api/v2/template +*PUT* /api/v2/global/drivers ### Request Headers @@ -1705,17 +1713,22 @@ Response to the error code, when an error response occurs. * 2208 tag description too long * 2209 tag precision invalid * 400 + * 1002 request body invalid + * 2010 node name too long + * 2011 node not allow delete * 2105 group parameter invalid * 2107 group name too long - * 2502 template name too long + * 2108 reach max number of groups + * 2304 library failed to open * 3013 plugin name too long - * 3016 plugin does not support template + * 3019 plugin does not support requested operation * 404 + * 2301 library not found * 3014 plugin not found * 409 * 2104 group exist * 2202 tag name conflict - * 2500 template already exists + * 2307 library not allow create instance * 500 * 1010 server is busy * 1001 internal error @@ -1724,26 +1737,36 @@ Response to the error code, when an error response occurs. ```json { - "name": "rtu template", - "plugin": "Modbus RTU", - "groups": [ + "nodes": [ { - "name": "group1", - "interval": 2000, - "tags": [ - { - "name": "tag1", - "type": 4, - "address": "1!400001", - "attribute": 1, - "precison": 1, - "decimal": 0 - }, + "name": "rtu template", + "plugin": "Modbus RTU", + "params": { + "param1": 1, + "param2": "1.1.1.1", + "param3": true, + "param4": 11.22 + }, + "groups": [ { - "name": "tag2", - "type": 11, - "address": "1!400009", - "attribute": 3 + "name": "group1", + "interval": 2000, + "tags": [ + { + "name": "tag1", + "type": 4, + "address": "1!400001", + "attribute": 1, + "precison": 1, + "decimal": 0 + }, + { + "name": "tag2", + "type": 11, + "address": "1!400009", + "attribute": 3 + } + ] } ] } @@ -1759,39 +1782,9 @@ Response to the error code, when an error response occurs. } ``` -## Delete Template - -*DELETE* /api/v2/template - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Request Params - -**name** optional, name of the template to delete. If not specified, then delete all templates. - -### Response Status - -* 200 OK -* 404 - * 2501 template not found -* 500 - * 1010 server is busy - -### Response - -```json -{ - "error": 0 -} -``` - -## Get Template +## Get Drivers -*GET* /api/v2/template +*GET* /api/v2/global/drivers ### Request Headers @@ -1801,594 +1794,66 @@ Response to the error code, when an error response occurs. ### Request Params -**name** optional, name of a particular template. +**name** Optional, list of names to filter out driver nodes (separated by ',') ### Response Status * 200 OK + * 2005 node setting not found * 400 * 1003 request param invalid * 404 - * 2501 template not found + * 2003 node not exist * 500 - * 1001 internal error * 1010 server is busy + * 1001 internal error ### Response -Without the **name** request parameter, return all templates. +If success, returns the list of drivers. ```json { - "templates": [ - { - "name": "template1", - "plugin": "modbus tcp" - }, - { - "name": "template2", - "plugin": "opc ua" - } - ] -} -``` - -When the **name** request parameter is specified, return detail information of the template -of the given name. - -```json -{ - "name": "rtu template", - "plugin": "Modbus RTU", - "groups": [ + "nodes": [ { - "name": "group1", - "interval": 2000, - "tags": [ - { - "name": "tag1", - "type": 4, - "address": "1!400001", - "attribute": 1, - "precison": 1, - "decimal": 0 - }, + "name": "rtu template", + "plugin": "Modbus RTU", + "params": { + "param1": 1, + "param2": "1.1.1.1", + "param3": true, + "param4": 11.22 + }, + "groups": [ { - "name": "tag2", - "type": 11, - "address": "1!400009", - "attribute": 3 + "name": "group1", + "interval": 2000, + "tags": [ + { + "name": "tag1", + "type": 4, + "address": "1!400001", + "attribute": 1, + "precison": 1, + "decimal": 0 + }, + { + "name": "tag2", + "type": 11, + "address": "1!400009", + "attribute": 3 + } + ] } ] } ] } ``` - -## Template Instantiation - -*POST* /api/v2/template/inst - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 400 - * 2304 library failed to open - * 2502 template name too long -* 404 - * 2301 library not found - * 2501 template not found -* 409 - * 2002 node exist - * 2307 library not allow create instance -* 500 - * 1001 internal error - * 1010 server is busy - -### Body - -```json -{ - "name": "rtu template", - "node": "modbus-rtu", -} -``` - -### Response - -```json -{ - "error": 0 -} -``` - -## Template Multi Node Instantiation - -*POST* /api/v2/template/instances - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 400 - * 2304 library failed to open - * 2502 template name too long -* 404 - * 2301 library not found - * 2501 template not found -* 409 - * 2002 node exist - * 2307 library not allow create instance -* 500 - * 1001 internal error - * 1010 server is busy - -### Body - -```json -{ - "nodes": [ - { - "name": "rtu template", - "node": "node1" - }, - { - "name": "tcp template", - "node" "node2" - } - ] -} -``` - -### Response - -```json -{ - "error": 0 -} -``` - -## Add Template Group - -*POST* /api/v2/template/group - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 400 - * 2105 group parameter invalid - * 2107 group name too long - * 2502 template name too long -* 404 - * 2501 template not found -* 409 - * 2104 group exist -* 500 - * 1001 internal server error - * 1010 server is busy - -### Body - -```json -{ - "template": "modbus-template", - "group": "group1", - "interval": 10000 -} -``` - -### Response - -```json -{ - "error": 0 -} -``` - -## Del Template Group - -*DELETE* /api/v2/template/group - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 400 - * 2107 group name too long - * 2502 template name too long -* 404 - * 2106 group not exist - * 2501 template not found -* 500 - * 1001 internal server error - * 1010 server is busy - -### Body - -```json -{ - "template": "modbus-template", - "group": "group1" -} -``` - -### Response - -```json -{ - "error": 0 -} -``` - -## Update Group - -*PUT* /api/v2/template/group - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response Status - - -* 200 OK -* 400 - * 2105 group parameter invalid - * 2107 group name too long - * 2502 template name too long -* 404 - * 2106 group not exist - * 2501 template not found -* 500 - * 1001 internal server error - * 1010 server is busy - -### Body - -To update group name: -```json -{ - //template name - "template": "modbus-template", - //group name - "group": "gconfig1", - //group new name - "new_name": "group1" -} -``` - -To update group interval: -```json -{ - //template name - "template": "modbus-template", - //group name - "group": "gconfig1", - //interval(ms) - "interval": 10000 -} -``` - -To update both group name and interval: -```json -{ - //template name - "template": "modbus-template", - //group name - "group": "gconfig1", - //group new name - "new_name": "group1", - //interval(ms) - "interval": 10000 -} -``` - -### Response - -```json -{ - "error": 0 -} -``` - -## Get Template Group - -*GET* /api/v2/template/group - -### Request Params - -**name** required, name of the template. - -### Request Headers - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 400 - * 1003 request param invalid -* 404 - * 2501 template not found -* 500 - * 1001 internal server error - * 1010 server is busy - -### Response - -````json -{ - "groups": [ - { - "name": "group1", - "interval": 2000, - "tag_count": 2 - } - ] -} -```` - -## Add Template Tag - -*POST* /api/v2/template/tag - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 206 - * 2203 tag attribute not support - * 2204 tag type not support - * 2205 tag address format invalid - * 2206 tag name too long - * 2207 tag address too long - * 2208 tag description too long - * 2209 tag precision invalid -* 400 - * 2107 group name too long - * 2502 template name too long -* 404 - * 2106 group not exist - * 2501 template not found -* 409 - * 2202 tag name conflict -* 500 - * 1001 internal server error - * 1010 server is busy - -### Body - -```json -{ - "template": "modbus-template", - "group": "group1", - "tags": [ - { - "name": "tag1", - "address": "1!400001", - "attribute": 8, - "type": 4, - "precision": 0, - "decimal": 0, - "description": "", - "value": 12 - }, - { - "name": "tag2", - "address": "1!00001", - "attribute": 3, - "type": 3, - "decimal": 0.01 - } - ] -} -``` - -### Response +otherwise returns the error code. ```json { - "index": 2, "error": 0 } ``` - -## Update Template Tag - -*PUT* /api/v2/template/tag - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response status - -* 200 OK -* 206 - * 2201 tag not exist - * 2203 tag attribute not support - * 2204 tag type not support - * 2205 tag address format invalid - * 2206 tag name too long - * 2207 tag address too long - * 2208 tag description too long - * 2209 tag precision invalid -* 400 - * 2107 group name too long - * 2502 template name too long -* 404 - * 2106 group not exist - * 2501 template not found -* 500 - * 1001 internal server error - * 1010 server is busy - -### Body - -```json -{ - "template": "modbus-template", - "group": "group1", - "tags": [ - { - "name": "tag1", - "address": "1!400001", - "attribute": 8, - "type": 4, - "precision": 0, - "decimal": 0, - "description": "", - "value": 12 - }, - { - "name": "tag2", - "address": "1!00001", - "attribute": 3, - "type": 3, - "decimal": 0.01 - } - ] -} -``` - -### Response - -```json -{ - "index": 2, - "error": 0 -} -``` - -## Del Template Tag - -*DELETE* /api/v2/template/tag - -### Request Headers - -**Content-Type** application/json - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 206 - * 2206 tag name too long -* 400 - * 2107 group name too long - * 2502 template name too long -* 404 - * 2106 group not exist - * 2501 template not found -* 500 - * 1001 internal server error - * 1010 server is busy - -### Body - -```json -{ - "template": "modbus-template", - "group": "group1", - "tags": [ - "tag1", - "tag2" - ] -} -``` - -### Response - -```json -{ - "error": 0 -} -``` - -## Get Template Tag - -*GET* /api/v2/template/tag - -### Request Params - -**template** required, name of the template. - -**group** required, name of the group. - -**name** optional, to filter by tag name. - -### Request Headers - -**Authorization** Bearer \ - -### Response Status - -* 200 OK -* 400 - * 1003 request param invalid -* 404 - * 2106 group not exist - * 2501 template not found -* 500 - * 1001 internal server error - * 1010 server is busy - -### Response - -```json -{ - "tags": [ - { - "name": "tag1", - "type": 4, - "address": "1!400001", - "attribute": 8, - "description": "", - "precision": 0, - "decimal": 0, - "value": 12 - }, - { - "name": "tag2", - "type": 14, - "address": "1!00001", - "attribute": 3, - "description": "", - "precison": 0, - "decimal": 0, - } - ] -} -``` diff --git a/en_US/api/error-code.md b/en_US/api/error-code.md index a0347159..57783773 100644 --- a/en_US/api/error-code.md +++ b/en_US/api/error-code.md @@ -86,10 +86,9 @@ This document describes the errors that neuron will reply to sender when calling * 2406 license hardware token not match * 2407 license detect bad clock * 2408 license module invalid -* 2409 license hardware token not found -* 2500 template already exists -* 2501 template not found -* 2502 template name too long +* ~~2500 template already exists (deprecated)~~ +* ~~2501 template not found (deprecated)~~ +* ~~2502 template name too long (deprecated)~~ ## plugin common error codes @@ -107,9 +106,10 @@ This document describes the errors that neuron will reply to sender when calling * 3013 plugin name too long * 3014 plugin not found * 3015 plugin device not response -* 3016 plugin does not support template +* ~~3016 plugin does not support template (deprecated)~~ * 3017 plugin does not support write tags -* 3018 plugin does not support synchronous reading +* 3018 plugin does not support sync reading +* 3019 plugin does not support requested operation ## FILE error codes diff --git a/en_US/configuration/south-devices/mtconnect/mtconnect.md b/en_US/configuration/south-devices/mtconnect/mtconnect.md new file mode 100644 index 00000000..bf40a3d8 --- /dev/null +++ b/en_US/configuration/south-devices/mtconnect/mtconnect.md @@ -0,0 +1,44 @@ +# Overview + +The Neuron MTConnect plugin accesses devices installed with MTConnect Agent through the HTTP protocol. + +## Parameter Configuration + +| Parameter | Description | +| --------- | ------------------------------------------------ | +| host | Target Device IP address or binding IP address | +| port | Target Device port or binding port, default 5000 | +| ns_prefix | namespace prefix | +| ns_uri | namespace uri | + + + +## Support Data Type + +* uint8 +* int8 +* uint16 +* int16 +* uint32 +* int32 +* uint64 +* int64 +* float +* double +* bool +* string + +## MTConnect Agent +For detailed information on the installation and usage of MTConnect Agent, please visit this link [cppagent](https://github.com/mtconnect/cppagent). + +## ADDRESS +The plugin address is in the form of XML XPATH. + +## Address Examples + +| Address | Type | Des | +| ---------------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------------- | +| //m:Angle[@dataItemId='Babs'] | float | Absolute angle of rotation axis B | +| //m:DeviceStream[@uuid='Mazak']/m:ComponentStream[@componentId='LYI1']/m:Samples/m:Position[@dataItemId='LYI1actm'] | double | Mechanical coordinates of linear axis Y | +| //m:DeviceStream[@uuid='Mazak']/m:ComponentStream[@componentId='Lct1']/m:Events/m:InputOutputSignal[@dataItemId='LPlcMonitorIO_1'] | bit | IO signal | + diff --git a/zh_CN/api/configuration.md b/zh_CN/api/configuration.md index b890b245..ae0a4c87 100644 --- a/zh_CN/api/configuration.md +++ b/zh_CN/api/configuration.md @@ -102,6 +102,7 @@ Neuron 将为 IIoT 平台提供一系列 API 服务,用于查询基本信息 * 200 OK * 400 * 2001 node 类型无效 + * 2004 node 配置无效 * 404 * 2301 未找到插件库 * 409 @@ -115,6 +116,13 @@ Neuron 将为 IIoT 平台提供一系列 API 服务,用于查询基本信息 "name": "modbus-tcp-node", //plugin name "plugin": "Modbus TCP" + //setting (optional) + "params": { + "param1": 1, + "param2": "1.1.1.1", + "param3": true, + "param4": 11.22 + } } ``` @@ -1645,9 +1653,9 @@ node 字段选填,不填此字段时 core 不可以为 false,此时仅切换 } ``` -## 添加 Template +## 批量添加 Drivers -*POST* /api/v2/template +*PUT* /api/v2/global/drivers ### 请求头部 @@ -1667,17 +1675,21 @@ node 字段选填,不填此字段时 core 不可以为 false,此时仅切换 * 2208 tag 描述太长 * 2209 tag 精度无效 * 400 + * 1002 请求 body 无效 + * 2010 node 名称太长 + * 2011 node 不允许删除 * 2105 group 参数无效 * 2107 group 名称太长 - * 2502 模板名字太长 + * 2304 库打开失败 * 3013 插件名字太长 - * 3016 插件不支持模板 + * 3019 插件不支持请求的操作 * 404 + * 2301 库未找到 * 3014 插件不存在 * 409 * 2104 group 已存在 * 2202 tag 名称冲突 - * 2500 模板已存在 + * 2307 插件不允许实例化 * 500 * 1001 内部错误 * 1010 程序繁忙 @@ -1686,26 +1698,36 @@ node 字段选填,不填此字段时 core 不可以为 false,此时仅切换 ```json { - "name": "rtu template", - "plugin": "Modbus RTU", - "groups": [ + "nodes": [ { - "name": "group1", - "interval": 2000, - "tags": [ - { - "name": "tag1", - "type": 4, - "address": "1!400001", - "attribute": 1, - "precison": 1, - "decimal": 0 - }, + "name": "rtu template", + "plugin": "Modbus RTU", + "params": { + "param1": 1, + "param2": "1.1.1.1", + "param3": true, + "param4": 11.22 + }, + "groups": [ { - "name": "tag2", - "type": 11, - "address": "1!400009", - "attribute": 3 + "name": "group1", + "interval": 2000, + "tags": [ + { + "name": "tag1", + "type": 4, + "address": "1!400001", + "attribute": 1, + "precison": 1, + "decimal": 0 + }, + { + "name": "tag2", + "type": 11, + "address": "1!400009", + "attribute": 3 + } + ] } ] } @@ -1721,39 +1743,10 @@ node 字段选填,不填此字段时 core 不可以为 false,此时仅切换 } ``` -## 删除 Template - -*DELETE* /api/v2/template - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 请求参数 - -**name** 可选,要删除的模板的名字。若未提供该参数,则删除所有模板。 - -### 响应状态 - -* 200 OK -* 404 - * 2501 模板不存在 -* 500 - * 1010 程序繁忙 - -### 响应 - -```json -{ - "error": 0 -} -``` -## 获取 Template +## 获取 Drivers -*GET* /api/v2/template +*GET* /api/v2/global/drivers ### 请求头部 @@ -1763,594 +1756,67 @@ node 字段选填,不填此字段时 core 不可以为 false,此时仅切换 ### 请求参数 -**name** 可选,要获取的 template 的名字。 +**name** Optional, list of names to filter out driver nodes (separated by ',') +**name** 可选,指定要过滤的南下节点名字列表(以 ',' 分隔)。 未指定 **name** 参数时,则返回所有模板的列表。 ### 响应状态 * 200 OK + * 2005 node 设置未找到 * 400 * 1003 请求 param 无效 * 404 - * 2501 模板不存在 + * 2003 node 不存在 * 500 * 1001 内部错误 * 1010 程序繁忙 ### 响应 -未指定 **name** 参数时,则返回所有模板的列表。 - -```json -{ - "templates": [ - { - "name": "template1", - "plugin": "modbus tcp" - }, - { - "name": "template2", - "plugin": "opc ua" - } - ] -} -``` - -如果请求指定了 **name** 参数,则返回相应模板的详细信息。 +如果成功,返回所有南向节点。 ```json { - "name": "rtu template", - "plugin": "Modbus RTU", - "groups": [ + "nodes": [ { - "name": "group1", - "interval": 2000, - "tags": [ - { - "name": "tag1", - "type": 4, - "address": "1!400001", - "attribute": 1, - "precison": 1, - "decimal": 0 - }, + "name": "rtu template", + "plugin": "Modbus RTU", + "params": { + "param1": 1, + "param2": "1.1.1.1", + "param3": true, + "param4": 11.22 + }, + "groups": [ { - "name": "tag2", - "type": 11, - "address": "1!400009", - "attribute": 3 + "name": "group1", + "interval": 2000, + "tags": [ + { + "name": "tag1", + "type": 4, + "address": "1!400001", + "attribute": 1, + "precison": 1, + "decimal": 0 + }, + { + "name": "tag2", + "type": 11, + "address": "1!400009", + "attribute": 3 + } + ] } ] } ] } ``` - -## 实例化 Template - -*POST* /api/v2/template/inst - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 400 - * 2304 库打开失败 - * 2502 模板名字太长 -* 404 - * 2301 库未找到 - * 2501 模板不存在 -* 409 - * 2002 node 已存在 - * 2307 插件不允许实例化 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -```json -{ - "name": "rtu template", - "node": "modbus-rtu", -} -``` - -### 响应 - -```json -{ - "error": 0 -} -``` - -## 多节点实例化 Template - -*POST* /api/v2/template/instances - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 400 - * 2304 库打开失败 - * 2502 模板名字太长 -* 404 - * 2301 库未找到 - * 2501 模板不存在 -* 409 - * 2002 node 已存在 - * 2307 插件不允许实例化 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -```json -{ - "nodes": [ - { - "name": "rtu template", - "node": "node1" - }, - { - "name": "tcp template", - "node" "node2" - } - ] -} -``` - -### 响应 - -```json -{ - "error": 0 -} -``` - -## 添加 Template Group - -*POST* /api/v2/template/group - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 400 - * 2105 group 参数无效 - * 2107 group 名称太长 - * 2502 模板名字太长 -* 404 - * 2501 模板不存在 -* 409 - * 2104 group 已存在 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -```json -{ - "template": "modbus-template", - "group": "group1", - "interval": 10000 -} -``` - -### 响应 - -```json -{ - "error": 0 -} -``` - -## 删除 Template Group - -*DELETE* /api/v2/template/group - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 400 - * 2107 group 名称太长 - * 2502 模板名字太长 -* 404 - * 2106 group 不存在 - * 2501 模板不存在 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -```json -{ - "template": "modbus-template", - "group": "group1" -} -``` - -### 响应 +否则返回错误玛。 ```json { "error": 0 } ``` - -## 更新 Template Group - -*PUT* /api/v2/template/group - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - - -* 200 OK -* 400 - * 2105 group 参数无效 - * 2107 group 名称太长 - * 2502 模板名字太长 -* 404 - * 2106 group 不存在 - * 2501 模板不存在 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -更新 group name: -```json -{ - //template name - "template": "modbus-template", - //group name - "group": "gconfig1", - //group new name - "new_name": "group1" -} -``` - -更新 group interval: -```json -{ - //template name - "template": "modbus-template", - //group name - "group": "gconfig1", - //interval(ms) - "interval": 10000 -} -``` - -同时更新 group name 和 interval: -```json -{ - //template name - "template": "modbus-template", - //group name - "group": "gconfig1", - //group new name - "new_name": "group1", - //interval(ms) - "interval": 10000 -} -``` - -### 响应 - -```json -{ - "error": 0 -} -``` - -## 获取 Template Group - -*GET* /api/v2/template/group - -### 请求参数 - -**name** 必需,template 的名字。 - -### 请求头部 - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 400 - * 1003 请求 param 无效 -* 404 - * 2501 模板不存在 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 响应 - -````json -{ - "groups": [ - { - "name": "group1", - "interval": 2000, - "tag_count": 2 - } - ] -} -```` - -## 添加 Template Tag - -*POST* /api/v2/template/tag - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 206 - * 2203 tag 属性不支持 - * 2204 tag 类型不支持 - * 2205 tag 地址格式无效 - * 2206 tag 名字太长 - * 2207 tag 地址太长 - * 2208 tag 描述太长 - * 2209 tag 精度无效 -* 400 - * 2107 group 名称太长 - * 2502 模板名字太长 -* 404 - * 2106 group 不存在 - * 2501 模板不存在 -* 409 - * 2202 tag 名称冲突 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -```json -{ - "template": "modbus-template", - "group": "group1", - "tags": [ - { - "name": "tag1", - "address": "1!400001", - "attribute": 8, - "type": 4, - "precision": 0, - "decimal": 0, - "description": "", - "value": 12 - }, - { - "name": "tag2", - "address": "1!00001", - "attribute": 3, - "type": 3, - "decimal": 0.01 - } - ] -} -``` - -### 响应 - -```json -{ - "index": 2, - "error": 0 -} -``` - -## 更新 Template Tag - -*PUT* /api/v2/template/tag - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 206 - * 2201 tag 不存在 - * 2203 tag 属性不支持 - * 2204 tag 类型不支持 - * 2205 tag 地址格式无效 - * 2206 tag 名字太长 - * 2207 tag 地址太长 - * 2208 tag 描述太长 - * 2209 tag 精度无效 -* 400 - * 2107 group 名称太长 - * 2502 模板名字太长 -* 404 - * 2106 group 不存在 - * 2501 模板不存在 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -```json -{ - "template": "modbus-template", - "group": "group1", - "tags": [ - { - "name": "tag1", - "address": "1!400001", - "attribute": 8, - "type": 4, - "precision": 0, - "decimal": 0, - "description": "", - "value": 12 - }, - { - "name": "tag2", - "address": "1!00001", - "attribute": 3, - "type": 3, - "decimal": 0.01 - } - ] -} -``` - -### 响应 - -```json -{ - "index": 2, - "error": 0 -} -``` - -## 删除 Template Tag - -*DELETE* /api/v2/template/tag - -### 请求头部 - -**Content-Type** application/json - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 206 - * 2206 tag 名字太长 -* 400 - * 2107 group 名称太长 - * 2502 模板名字太长 -* 404 - * 2106 group 不存在 - * 2501 模板不存在 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - -### 请求体 - -```json -{ - "template": "modbus-template", - "group": "group1", - "tags": [ - "tag1", - "tag2" - ] -} -``` - -### 响应 - -```json -{ - "error": 0 -} -``` - -## 获取 Template Tag - -*GET* /api/v2/template/tag - -### 请求参数 - -**template** 必需,template 的名字。 - -**group** 必需,group 的名字。 - -**name** 可选,用于过滤 tag 名字。 - -### 请求头部 - -**Authorization** Bearer \ - -### 响应状态 - -* 200 OK -* 400 - * 1003 请求 param 无效 -* 404 - * 2106 group 不存在 - * 2501 模板不存在 -* 500 - * 1001 内部错误 - * 1010 程序繁忙 - - -### 响应 - -```json -{ - "tags": [ - { - "name": "tag1", - "type": 4, - "address": "1!400001", - "attribute": 8, - "description": "", - "precision": 0, - "decimal": 0, - "value": 12 - }, - { - "name": "tag2", - "type": 14, - "address": "1!00001", - "attribute": 3, - "description": "", - "precison": 0, - "decimal": 0, - } - ] -} -``` diff --git a/zh_CN/api/error-code.md b/zh_CN/api/error-code.md index eac55810..652d9494 100644 --- a/zh_CN/api/error-code.md +++ b/zh_CN/api/error-code.md @@ -92,9 +92,9 @@ * 2408 license 模块无效 * 2409 license 硬件标识未找到 -* 2500 模板已存在 -* 2501 模板不存在 -* 2502 模板名字太长 +* ~~2500 模板已存在 (废弃)~~ +* ~~2501 模板不存在 (废弃)~~ +* ~~2502 模板名字太长 (废弃)~~ ## 插件常见的错误代码 @@ -112,9 +112,10 @@ * 3013 插件名字太长 * 3014 插件不存在 * 3015 插件设备未响应 -* 3016 插件不支持模板 +* ~~3016 插件不支持模板 (废弃)~~ * 3017 插件不支持写点位 * 3018 插件不支持同步读 +* 3019 插件不支持请求的操作 ## FILE 错误码 diff --git a/zh_CN/configuration/south-devices/mtconnect/mtconnect.md b/zh_CN/configuration/south-devices/mtconnect/mtconnect.md new file mode 100644 index 00000000..f985120c --- /dev/null +++ b/zh_CN/configuration/south-devices/mtconnect/mtconnect.md @@ -0,0 +1,42 @@ +# 概览 + +Neuron MTConnect 插件通过 HTTP 协议访问安装有 MTConnect Agent 的设备。 + +## 设备设置 + +| 字段 | 说明 | +| --------- | ------------------------------- | +| host | 设备 IP 地址或者绑定地址 | +| port | 设备端口或者绑定端口, 默认 5000 | +| ns_prefix | 命名空间前缀 | +| ns_uri | 命名空间标识 | + +## 支持的数据类型 + +* uint8 +* int8 +* uint16 +* int16 +* uint32 +* int32 +* uint64 +* int64 +* float +* double +* bool +* string + +## MTConnect Agent +MTConnect Agent 的安装和使用,详细内容请访问此链接 [cppagent](https://github.com/mtconnect/cppagent)。 + +## ADDRESS +插件地址为 XML XPATH 形式. + +## 地址示例 + +| 地址 | 数据类型 | 说明 | +| ---------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------- | +| //m:Angle[@dataItemId='Babs'] | float | 旋转轴 B 绝对值角度 | +| //m:DeviceStream[@uuid='Mazak']/m:ComponentStream[@componentId='LYI1']/m:Samples/m:Position[@dataItemId='LYI1actm'] | double | 线性轴 Y 的机械坐标 | +| //m:DeviceStream[@uuid='Mazak']/m:ComponentStream[@componentId='Lct1']/m:Events/m:InputOutputSignal[@dataItemId='LPlcMonitorIO_1'] | bit | IO 信号 | + diff --git a/zh_CN/configuration/south-devices/siemens-s7/s7.md b/zh_CN/configuration/south-devices/siemens-s7/s7.md index 6f6b5530..21a07d2f 100644 --- a/zh_CN/configuration/south-devices/siemens-s7/s7.md +++ b/zh_CN/configuration/south-devices/siemens-s7/s7.md @@ -72,7 +72,6 @@ Neuron 实现的 S7 ISOTCP 分为两个插件,其中 Siemens S7 ISOTCP 插件 | C | int16/uint16 | 读/写 | 计数器 | 计数器 C | | DB | int8/uint8/int16/uint16/bit/int32/uint32/float/double/string | 读/写 | 全局数据块 | 变量内存 V,全局数据块1 | - :::tip 对于全局数据块 DB,在 PLC 侧诸如 DBX,DBW,DBB 之类的地址,直接转化为 DBW 即可,不需要做字节换算,如 DBX1 -> DBW1。 :::