LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

opc frequency

I try to collect data from festo PLC via opc server. I use open datasocket, read datasocket and close datasocket labview functions. I have a problem. Data in opc server changes 10 times per second. It's low. I had try read sine function from ni.opc.demo.server and got the same frequency. I don't find any frequency properties of datasocket server.

Thank you.

0 Kudos
Message 1 of 4
(2,339 Views)

I am not clear on what your question is as it seems like your DataSocket Read is occurring at the same rate as the data on your OPC Server.  Are you trying to read at a rate slower than your server's update rate or faster (and get potentially stagnant values)?

 

There are two things you can do to change your rate of reading from the DataSocket Read:

 

  1. To change your rate of reading and set your maximum update rate on your reader, you can add
    ?updaterate=rate_in_ms

    to the end of your opc url.  So, if your url is

    opc://ni.opc.demo.server

    then you would make it

    opc://ni.opc.demo.server?updaterate=20

    if you want to set your maximum update rate to 20 milliseconds.

  2. One of the inputs into DataSocket Read is ms timeout.  This value sets how slowly the VI could possibly run. If we set this value to a number smaller than how quickly we can read from the OPC Server or how quickly the OPC Server values update, then we will start pulling stale values.
Clemens | Technical Support Engineer | National Instruments
Message 2 of 4
(2,195 Views)

Thank you for your answer.
You wrote about url options:

?updaterate=rate_in_ms

What more options we can add to url?

0 Kudos
Message 3 of 4
(2,184 Views)

You're welcome!  The only other url parameter I know of for opc url in DataSocket is deadband.  So if you had the two parameters added on, it might look something like 

?updaterate=100&deadband=0.7
Clemens | Technical Support Engineer | National Instruments
Message 4 of 4
(2,161 Views)