LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

speed of execution

Heya, I'm new to LabVIEW and I've been working on a control system for a cube-shaped underwater remotely operated vehicle. The programme was great until I put the DAQ assist in and now it runs very slowly. Does anyone have any ideas on how to speed it up?

 

Basically it takes the input from an xbox controller (Dpad, left and right triggers and A button) and uses the Dpad for direction (digital output to 4 motor, 1 placed on each corner, two forward facing and two backward facing) the triggers increase and decrease the speed which is an analouge output voltage between 2 and 5 (5 is slow speed, 2 is high speed) and the A button switches lights on and off.

 

At the same time a user input is compared to an analogue input from a pressure sensor to control depth. Based on the difference of these values, a bilge pump is run and/or a valve is opened/closed.

 

All in all, I've got 1 analogue input from the pressure sensor, 2 analogue outputs (the speed of the motors and the bilge pump) and 7 digital outputs (4 for the motors, 1 for the bilge pump, 1 for the valve and 1 for the lights).

 

If anyone has any ideas on how to make it run more quickly that would be fantastic, it's for a group project due in at the end of April so I'm a little panicked.

 

Many thanks

0 Kudos
Message 1 of 3
(1,980 Views)

First of all, you might consider how to encompass logical parts of your vi into subvi's.  Your block diagram wouldn't fit on my 20" monitor.

 

It looks to me like you could reduce the number of samples that you are acquiring.  For example, you have a Analog 1D waveform output for N channels on the lower left part of the diagram.  You are then converting an array of waveforms to dynamic then to a scalar. If you just need on data point, then just acquire one point on one channel.

 

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 3
(1,961 Views)

Here is a clean version to start with. I did not change anything in the execution

 

But you will see that it is much easier to follow this way. I also noticed that you have a timeout in your loop of .3 seconds when a certain condition is met. You need to change the way this works so that your loop does not get stuck waiting on the timeout.

 

Example.png other than a few things that should not make a difference.

Tim
GHSP
0 Kudos
Message 3 of 3
(1,939 Views)