--[[
|
编码: 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
|