# Tag Ondemand poll

**URL:** <https://forum.inductiveautomation.com/t/tag-ondemand-poll/5489>\
**Category:** Ignition\
**Created:** [November 28, 2012, 3:32pm UTC](https://forum.inductiveautomation.com/t/tag-ondemand-poll/5489 "2012-11-28T15:32:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcorkern](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rcorkern](https://forum.inductiveautomation.com/u/rcorkern)\
**Post date:** [November 28, 2012, 3:32pm UTC](https://forum.inductiveautomation.com/t/tag-ondemand-poll/5489/1 "2012-11-28T15:32:11Z")

</div>

i have a popup Window that I want to be able to perform an onDemand poll of a tag’s value but I’m getting hung up on how to do this. I don’t think my syntax is correct but this is what I have so far in the event handler of the button that will do this:  
qv = system.opc.readValue(event.source.parent.getComponent(‘ServerLabel’).text + “/” + event.source.parent.getComponent(‘FolderLabel’).text + “/” + event.source.parent.getComponent(‘TagNameLabel’).text)  
event.source.parent.getComponent(‘Numeric Label’).value = qv

(This is the error I get when running it - TypeError: readValue(): expected 2 args; got 1)

I’m bringing in the tag path from 3 label boxes

Thanks!

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [November 28, 2012, 4:29pm UTC](https://forum.inductiveautomation.com/t/tag-ondemand-poll/5489/2 "2012-11-28T16:29:34Z")

</div>

The reason for that error is your missing the opcServer parameter for readValue(), it expects a tagPath string and opcServer string.

[inductiveautomation.com/support/ … dvalue.htm](http://inductiveautomation.com/support/usermanuals/ignition/system_opc_readvalue.htm)

---

<div class="post-metadata">

**Author:** ![rcorkern](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rcorkern](https://forum.inductiveautomation.com/u/rcorkern)\
**Post date:** [November 28, 2012, 4:30pm UTC](https://forum.inductiveautomation.com/t/tag-ondemand-poll/5489/3 "2012-11-28T16:30:12Z")

</div>

I changed “system.opc.readValue” to “system.tag.read” and I think made a little progress… Now I’m just getting “TypeError: can’t convert to double”

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [November 28, 2012, 4:37pm UTC](https://forum.inductiveautomation.com/t/tag-ondemand-poll/5489/4 "2012-11-28T16:37:36Z")

</div>

If you used the same code as above, it was probably because you tried to assign the variable qv (a QualifiedValue) into a Numeric Label value (a double). Try this:

```auto
event.source.parent.getComponent('Numeric Label').value = qv.value
```
