LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why value returned by datasocket updates every one second?

I am using labview object to retrieve modbus register value using datasocket. I configure the poll rate of Modbus to 0:00001 (1ms I think). I read the labview object every 250ms in a loop and store the data into a file. After reading the file, I found that the value changes every four data. It looks as if the software only reads the modbus register once every one second. Is it the way it works or is there anything wrong with my setting?

I appreciate your help and look forward to your reply.

Steven
0 Kudos
Message 1 of 5
(2,515 Views)
Hi Steven,

The "ms timeout" on the DataSocket Read VI specifies how long to wait for a value update. Default is 10s.
You might be interested in reading the following KB:

What update rate can I get from DataSocket communicating with an OPC server?
http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/b58c6ca2be2b99da862569880076e168?OpenDocument

With the OPC protocol, you can also specify the update rate in the URL:
opc:\\machine\ National Instruments.OPCModbus\Modbus Demo Box.4:0?updaterate=100

Hope this helps.

Kileen
0 Kudos
Message 2 of 5
(2,470 Views)
Hi, KileenC

Thank you for your reply.

I read the document you mentioned and tried again. It still give me the same result.

Here is a simplified labview code. Would you please check it for me and give me further suggestions?

I appreciate your help and look forward to your reply.

Steven
0 Kudos
Message 3 of 5
(2,455 Views)
Hi Steven,

I've modified the VI you sent to use the new DataSocket VI's, rather than the old compatibility VI's. These VI's should allow you to specify the update rate within the DataSocket URL. You would specify the update rate and deadband in the following way:

opc:\\ServerName\OPCServer\ItemName?updaterate=100&deadband=0.7

If you have any further questions, please post a reply.

Regards,

Kristi H
National Instruments
Message 4 of 5
(2,436 Views)
I used your method and solved the problem. Thank you for your help.

Steven
0 Kudos
Message 5 of 5
(2,427 Views)