LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

command delays

 

Hi everyone! I have a question about how to fix the delay between the time that something changes on the front panel and the time of execution. This program is set up to generate a certain voltage during a given time period, switch to a different voltage for another short period of time, and then revert back to the original voltage when we reset the elapsed time subVI. We are using subVIs from the high voltage power source being used. The switches need to happen fairly quickly and it is currently taking several seconds to update the voltages after we reset the elapsed time. Is there some way to change the program so that there is much less delay? We looked into using an event structure, but that does not seem to be an option for the version of LabView we are using

 

Thank you!  

0 Kudos
Message 1 of 9
(2,871 Views)

You will need to attach your VI.  That is the kind of question we have no possibly of being able to answer without seeing what you are doing now.

0 Kudos
Message 2 of 9
(2,868 Views)

Hi Eclerc,

 

there surely is a way! But without seeing your VI I cannot recommend a way… 😄

 

From your description it sounds like you're using sequence structures or a very "linear" style of coding.

I recommend a state machine instead.

Using an event structure to handle user input isn't a bad idea, too.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 9
(2,866 Views)

Gated_timed_injections.jpeg

Sorry about that, I thought the file was attached. Here is the link. Thanks again!

0 Kudos
Message 4 of 9
(2,829 Views)

I still don't see a VI file.  All I see is a screenshot that is kind of hard to see what is going on.

0 Kudos
Message 5 of 9
(2,818 Views)

Hello Eclerc95,

 

As RavensFan said, the VI itself as well as a better description of the driver VIs you're using (what hardware is this, and where did you get the driver from) would be extremely helpful. 

 

As for a few things that are discernible from the screen capture you provided:

 

-It looks like you're using something over a serial bus of some sort.  Be aware from the get-go that this hardware will not respond "instantly". 

-It is possible that the device itself provides a timer function similar to what you are attempting to achieve in software.  If so, that will be the fastest approach.  Without information on the hardware it's impossible to say, though.

-It appears that you are reinitializing and reconfiguring your hardware each time your main loop executes.  If possible you'll want to initialize and release your session outside of your primary loop.  Again, information on the driver VIs you're using would help us offer better advice. 

-You seem to be sending four separate commands to change channel voltages to the device in (an indeterminate) sequence.  Are the driver VIs you're using reentrant?  Does the interface provide a way to configure multiple channels at once? If you can cut down on the number of individual commands you need to send the device you may see an improvement in the response time.  That is, you should see an improvement in the response time, but that's another question that can't be answered without more information about the device and/or driver you're using.

 

The good news is that it definitely looks like there should be multiple ways to speed up your application!

 

Best Regards,

 

Tom L.
Message 6 of 9
(2,806 Views)

Thank you! I am working with the original poster (who is now enjoying Spring Break). I re-wired the VI to stop initializing the VISA with every loop, and the voltage is updating much more quickly. The hardware is a high voltage power supply from LabSmith:

 

http://labsmith.com/support/hvs448-high-voltage-sequencer/

 

We need all four voltages to update simultaneously, not sequentially, but this is quite common in microfluidics, and the LabSmith supply and drivers should be designed to do this without a problem. I've only checked the timing on one channel so far, but it looks good.

 

I have uploaded the new version of the VI in case you have other suggestions, as the two of us working on this are both LabView novices; however, I am hopeful that we are all set as far as the delay issue goes.

 

Thanks again!

0 Kudos
Message 7 of 9
(2,762 Views)

You can't update all 4 voltages simultaneously.

 

You are using a "serial" port.  That means all 4 command have to go out serially since you are using the same serial port.

 

The only way you can update all 4 voltages simultaneously is if the device provides a command to do that where you would set all voltages and the device executes the changes simultaneously.

0 Kudos
Message 8 of 9
(2,759 Views)

Sure - I should have been more precise in my language. For our application, the voltages need to update within a few tens of milliseconds of each other. If they do not update truly simultaneously that is fine, because the fluidic circuit they are going into will not respond any faster than that. So, the serial nature of the communications is not a problem, but the delay of several seconds between sending a command on the LabView front panel and getting the voltages to actually update was long enough to be a problem. I've checked and now that the VISA opening VIs are outside the while loop, all four voltages are updating quickly enough for us. Thanks again!

0 Kudos
Message 9 of 9
(2,743 Views)