系统平台WebService接口配置
首先编写一个WebService
打开SMC 点击Wonderware-WEBSVC -> REST
在REST Parameters 配置 WebService Address 匿名访问。
Device Items 中添加Name ww.post.result Item Reference $op$ww.post.result
在 SOAP中添加
在OI.WEBSVC.1 中选择PORT->SOAP 添加Device Items 如Name:mes.errormsg Item Reference:
$op$mes.proxy.errormsg
在系统平台中创建CMNJOPCClient_AssyLine_WS1 OPCClient,选择General Server node:localhost,
Server name: OI.WEBSVC.1
点击Scan Group 添加WSGroup 设置Update Interval 5000 毫秒
设置Attribute mes.inputs.content Item Reference PORT.SOAP.mes.inputs.content
在系统平台里创建WSProxy UserDefine 类型,添加Attributes WS_Rest_Body DataType为String类型,
I/O :CMNJOPCClient_AssyLine_WS1.WSRest.ww.post.body
选择一个测试站点,在Scripts 页签添加脚本如下:
WSProxy.WS_Rest_Body = "{""system"":" + """ESOP""" + ",""method"":" + """ToolChange""" + ",""content"":""" + "AssyLine1" +"|" + "000002820230-001" + """}";
WSProxy.WS_Rest_Run = true;
LogMessage(WSProxy.WS_Rest_Body);
在HMI工单管理界面添加调用
Graphic NJ_SU_WOLIST
1) Symbol Scripts
OnChangeOrder2
Me.var_MESWorkOrder=strMesOrderNo;
Me.var_PartNo=strPartNo;
'start call esop for changetools
WSProxy.WS_Rest_Body = "{""system"":" + """ESOP""" + ",""method"":" + """ToolChange""" + ",""content"":""" + Me.var_MesLineName +"|" + strMesOrderNo + """}";
WSProxy.WS_Rest_Run = true;
2) 关闭工单按钮
Edit Animations
'start call esop for changetools
WSProxy.WS_Rest_Body = "{""system"":" + """ESOP""" + ",""method"":" + """GetToolTime""" + ",""content"":""" + Me.var_MesLineName +"|" + strMesOrderNo + """}";
WSProxy.WS_Rest_Run = true;