LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a VI to send ONLY recently changed controls to an instrument... help :)

Hey everyone, I just started learning labview about 7 days ago, so I'm not very familiar with the best way to do things.

I've got a program that is using GPIB to control an electronic load. The front panel has a variety of controls, such as Resistance, Voltage, and the like. In all, I have about 9 pieces of data that I am sending to the load (each around 5 bytes long). The problem I have is that it resends this information constantly, even if you haven't changed anything (As it's all just in a big while loop that waits for a stop button). This results in a fairly substantial delay (~1.5 sec) between button press and actual response. When I cut the code down to one pie
ce of data being resent, the delay is virtually imperceptible.

So, what I want to do is set it up so that it only sends the data when you change something. The only way I know of would require an immense amount of boolean checks, and would be rather tedious to code. Is there some simple way of doing this?

Thanks,
-Dobbs
(If anyone wants to see the VI I can send it if you'd like)
0 Kudos
Message 1 of 3
(2,631 Views)
I guess in your case, you could add a "send" button (latch when release action) in the loop, linked to a case selector, so that when you press it, the data are collected and sent.
otherwise, if you want it to be automatic, you can put everything in a cluster, and use a shift register to detect a value change, and trigger the send action.

Find enclosed two examples,
hope this helps.
Download All
Message 2 of 3
(2,631 Views)
This may or may not help depending on the instrument you are using. The delay with resending commands isn't just from the data transfer but also because most instruments go ahead and reconfigure, even though there is no change in configuration.

IVI Instrument drivers provide for "State Caching", maintaining the state of the instrument and only sending commands when a value changes or becomes invalid. If there is an IVI driver for this instrument then you could use that driver and avoid sending redudant commands.

For more information on IVI please refer to:
http://zone.ni.com/devzone/devzone.nsf/webcategories/5FB594A1C20D93E3862569FD0071D18A?opendocument

and
http://www.ni.com/ivi/

Regards,
Kamran - NI
An
Message 3 of 3
(2,631 Views)