LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why the control passes the previous value to my function?

I want to use a control to subscribe to value of a modbus register through datasocket and pass the present register value to other functions. I found that after subscribing, the control shows the present register's value but pass the previous value to others instead of current value. When I put breakpoint into the program, the operation is correct. But when I remove the breakpoint away, that strange thing happens again. It looks as if there is some delay. How can I solve it?

Thank you for your help.

Steven
0 Kudos
Message 1 of 2
(2,405 Views)
Hello Steven,

Thank you for contacting National Instruments.

Are you using Data Socket (DS) VIs or front panel DS? Front panel DS only performs constant periodic updates. The VIs let you programmatically control the timing of your reads and writes. Try using the VIs and time the register updates to occur between the DS reads and writes. This should keep the current values of your register updated.

For DS examples, go to Help >> Find Examples. Select Directory Structure in the Browse Tab. Double click the "comm" folder, then the datasktx.llb folder. Look at the DS Reader and DS Writer VIs.

I hope this helps.

Sean C.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,405 Views)