LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make my VI acquire faster

I have a data acquisition VI running on a RT PXI controller.  I'm trying to get 1ms loop times on it.  So far I have analog inputs and analog outputs running.  It seems to have no late iterations for about 12 or 13 seconds and then all of sudden it starts piling up iterations very quickly.  I will attach my code.  Can anyone suggest some ways to get this VI to acquire faster?
 
Thank You.
0 Kudos
Message 1 of 3
(2,825 Views)
From looking at your code, I would guess that the problem is with fgv_doubles.vi.  I think in your "Write" and "WriteSubArray" cases, you really want to use "Replace Array Subset" instead of "Insert into Array."  Your current code is making the array grow everytime you write to it.  After a certain point, the array becomes so large that the reallocations to grow it take a very long time.  I bet that if you use "Replace Array Subset" instead, you won't have any problems meeting your deadline.  Let us know if that fixes it, or if I completely misread your code and you really did mean "Insert into Array". 

Greg
Message 2 of 3
(2,810 Views)
Thank you so much Greg, you were absolutely 100% correct.  Hahah, for some reason i just figured insert into array meant to place it there, not to push the rest of the array down before putting it in there. 
 
So for anyone reading this that might glance over it:
 
Replace Array Subset places items in an array that's already dimensioned at a certain position.
Insert Into Array redimensions the array and places items at a certain position.
 
Thanks!
Message 3 of 3
(2,803 Views)