1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| --[[
| 编码:
| 名称: Modbus测试
| 作者:
| 入口函数:ModbusStatusChange
| 功能说明:
| 变更历史:
| --]]
| m3 = require("oi_base_mobox")
| lua = require("oi_base_func")
| json = require("json")
| mobox = require("OILua_JavelinExt")
| wms_base = require("wms_base")
| wms_cntr = require("wms_container")
| function ModbusStatusChange(strLuaDEID)
| local nRet, strRetInfo
| local input_datajson
|
| -- 设备编码, 线体编号, 信号,订阅名称
| local device_code, unit_code, value, task_info, condition_flag, isexit
| -- 获取接口中的Data
| nRet, input_datajson = m3.GetSysDataJson(strLuaDEID)
| if (nRet ~= 0) then
| lua.Stop(strLuaDEID, "PLCStateChange无法获取数据包!" .. input_datajson)
| return 1
| end
| -- 打印获取的设备信息
| lua.DebugEx(strLuaDEID, "data_objs-->", input_datajson)
| end
|
|