LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slider control value update delay

Hi,
I'm running V6.0.2, and I have a TCP connection that needs to recieve
an value every 500ms. However, when the slider that provides the
value is being adjusted via a continuos mouse drag for more than a
moment it stops the while loop until the value is updated (presently
about every second, as near as I can tell). How can I make sure the
slider doesn't hold up the while loop while it is being dragged?
Thanks,
Ryan
0 Kudos
Message 1 of 3
(2,760 Views)
Hi Ryan,
The easiest way to go about this is to use front panel DataSocket since it sounds like you want to publish the data on your slider. You can look at 'Front panel datasocket read' and 'Front panel DataSocket write' examples that are shipped with LabVIEW. All you do is right-click on your control (slider) >> Data Operations >> DataSocket Connection. You enter the DataSocket protocol something like dstp://ipaddress/data and you're ready to write or read (publish or subscribe) data. As long as your VI runs, you will be sending out data.

If for some reason you can't use DataSocket please let me know and we can find an alternative solution for TCP.

I have also attached a couple of VIs (build in LV 7) that show you how to use the event structu
res to only write the data after the mouse up event on the slide control. You can download the LV eval from ni.com/labview and view this VI.

Good luck
Feroz
Download All
0 Kudos
Message 2 of 3
(2,760 Views)
First of all you might want to check that nothing in your loop is causing it to run in/block on the user interface thread (for example, I believe that using control references would cause this) and that nothing elsewhere in your program is hogging processor time (make sure all loops contain a short or even zero wait (ms)).

If this is still a problem, you could try splitting the task into two VI's: one reads the slider and sends the latest value to a notifier or a functional global (LV2-style global), while the other one runs independently and reads the latest value from the notifier (with zero timeout) every 500 ms. The transmitted value might sometimes lag behind the actual slider value while it's being dragged but it shouldn't hold up the actual transmission.
0 Kudos
Message 3 of 3
(2,760 Views)