擅长:python、mysql、java
<p>那是因为您正在设置<code>id=</code>。你知道吗</p>
<p>从<a href="http://openopc.sourceforge.net/api.html" rel="nofollow noreferrer">docs</a>(我的重点):</p>
<blockquote>
<p>Requesting properties for a single item returns a list of (id, description, value) tuples. Each tuple in the list represents a single property. </p>
<p>>>> opc.properties('Random.Int4')</p>
<p>[(1, 'Item Canonical DataType', 'VT_I4'), (2, 'Item Value', 491), (3, 'Item Quality', 'Good'), (4, ...</p>
</blockquote>
<p>以及:</p>
<blockquote>
<p>The <strong>optional id parameter</strong> can be used to limit the returned value to that of a <strong>single property</strong>... </p>
<p>>>> opc.properties('Random.Int4', id=1)</p>
<p>'VT_I4'</p>
</blockquote>