1

我想通过服务器从我的底层系统发送一个字符串到我的客户端。我在 OPCModeler(统一自动化)中制作了一个模型。

OPCModeler 中的 OPC 模型

现在为了将底层系统连接到 nodemanager,我使用了以下 xml 代码。带有 Int32 的变量是可以的。字符串得到错误:

BadNodeId 未知。

<UnderlyingSystem.Configuration
xmlns="http://yourcompany.com/underlyingsystem"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
 <GModel>
<Name>GMaschine</Name>
<Type>1</Type>
<Properties>
  <Name>actChannelNo</Name>
  <DataType>i=6</DataType>
  <Value>0</Value>
  <Range>0:10000000</Range>
</Properties>
<Properties>
  <Name>axisName</Name>
  <DataType>i=12</DataType>
  <Value>"0"</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>axisNo</Name>
  <DataType>i=6</DataType>
  <Value>0</Value>
  <Range>0:10000000</Range>
</Properties>
<Properties>
  <Name>axisType</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>cleaningProgramPath</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>connection</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>feed_value</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>guid</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>hardware_SN</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>hardwarePlatform</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>id</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>ipAddress</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>loadUnloadProgramPath</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>location</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>machineReady</Name>
  <DataType>i=1</DataType>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>motionStatus</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>name</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>platformVersion</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>timezone</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
<Properties>
  <Name>type</Name>
  <DataType>i=12</DataType>
  <Value>0</Value>
  <Writeable>false</Writeable>
</Properties>
</GModel>
 </UnderlyingSystem.Configuration>
4

1 回答 1

0

也许有点拿铁,但为了将来参考,nodeIds 存储在 csv 文件中,而不是 xml 文件中。

对于您在 xml 中的每个节点,您在 csv 中都有相应的节点。一个好的起点是 OPCU 基金会,您可以在此处查看基本模型:https ://opcfoundation.org/UA/schemas/

于 2016-07-15T09:45:26.837 回答