1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--[[
   编码: WMS-XXX-101
   名称: 
   作者:
   日期:2025-06-03
 
   函数: 1
   功能:
 
   更改记录:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require ("oi_base_mobox")
require("WMS-DevComm")
function GetDeviceInfo( strLuaDEID )
    
    local canshu = {
      device_code = "S7_LINE",
      comm_code = "1001-WORK_MODE "
}
 
 
   local ssx_task_10 = WMS_ReadS7PLCCommsData(strLuaDEID, "S7_LINE", "1001-HEART")
    
    
    lua.Debug(strLuaDEID,debug.getinfo(1),"ssx_task_10-->",ssx_task_10)
        
    lua.Debug(strLuaDEID,debug.getinfo(1),"ssx_task_10-->","IN")
 
 
-- -- 开始调用接口1
--     local strHeader = ""
--     local strBody = lua.table2str(canshu)
--     local strurl = "http://127.0.0.1:5121/api/devctrl/readdata"
--     lua.Debug(strLuaDEID, debug.getinfo(1), "接口调用前参数:", strBody)
    
--     nRet, strRetInfo = mobox.sendHttpRequest(strurl, strHeader, strBody)
--     lua.Debug(strLuaDEID, debug.getinfo(1), "接口调用后返回信息:", strRetInfo)
--     if (nRet ~= 0) then
--         lua.Error(strLuaDEID, debug.getinfo(1), "接口调用失败! 原因:" .. strRetInfo)
--     else
--         local retAttrs = json.decode(strRetInfo)
--         lua.Debug(strLuaDEID, debug.getinfo(1), "retAttrs:", retAttrs)
--         local errCode = retAttrs["ResultCode"]
--         local errMsg = retAttrs["ResultMsg"]
--         if (errCode ~= 0) then
--             lua.Error(strLuaDEID, debug.getinfo(1), "接口处理失败! 原因:" .. errMsg)
--         end
--     end
 
end