LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I improve the speed of my VI to work in real-time at higher sample rates?

I am currently trying to implement a multi-channel control system, the vi of which is attached. It effectively consists of a number of additions and multiplications in the processing subvi (also attached), however, for 7 inputs and 7 outputs I cannot get it to work at sample rates higher than 3kHz without experiencing an overwrite error. Does anyone have any tips as to how I can get the processing to work more efficiently such that I can get it to work at higher sample rates?
0 Kudos
Message 1 of 4
(3,143 Views)
I took a brief look at your control loop. Doing single scan I/O the way you are, it sounds like your 3kHz rate is about what I would expect. We built an inverted pendulum, and that was about the rate we got in Windows for two inputs and one output. Of course this was somewhat dependent on our machine speed. To go faster and get more reliability, we switched over to LabVIEW RT. It really just depends on how fast you need to go, and if you need reliable real-time.

Best regards,
Doug Norman
0 Kudos
Message 2 of 4
(3,143 Views)
The control loop is being run in LABVIEW RT on a PXI controller PIII 1.26GHz. I need to try and get the loop to run at 4kHz as well as guaranteeing it runs in real-time.
0 Kudos
Message 3 of 4
(3,143 Views)
Hi mattwilko,

I believe the first issue that you should address is the building of arrays.

This is mainly happening on the edge of your loops.

This is my reasoning.

Allocating memory in RT to handle an array that is growing will blow away your determinism.

I would suggets pre-allocating all of your storage and work with the data in-place.

In LV 7.1 there are some great new tools that will help nail down issue of this type.

If you have LV 7.1 you may want to upgrade so you can take advantage of the new tools.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 4
(3,143 Views)