LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop timing question

Can someone explain to me why the top version executes in 26uS and the bottom one takes 1200uS?
 
This is on RT 8.01 on an 8176 controller.  And this is part of a much larger program.
 
Lee Jay
0 Kudos
Message 1 of 6
(3,298 Views)

hi there

i assume because the lower solution (the slow one) invokes the memory manager (a 2D array is created by autoindexing). then the upper "replace array subset" is called 4 x 62 = 248 times, the lower 512 times.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 6
(3,295 Views)
Really?  I thought it created a 1D array from the 2D.  But I see your point that it has to do that 562 times.
 
Lee Jay
0 Kudos
Message 3 of 6
(3,291 Views)

each time you create a (new) array the memory manager is called, this happens when you "create" a 1D array from the 2D array and when you create the 2D array from the 1D array (see attachment).

btw: calling memory manager may inhibit determinism on RT platforms.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 4 of 6
(3,283 Views)

Thank you for your help.  I've been slowly learning just how slow the memory manager in RT actually is.  I've even asked for a new RT feature.  I'd like a way for RT to cause an error (like a broken wire or similar) during editing whenever you do anything that will call the memory manager, and I want this precisely because doing that destroys determinism on the RT system.

Thanks again.  I'm now on the hunt through my program to find any auto-indexing.

Lee Jay

0 Kudos
Message 5 of 6
(3,274 Views)

you may also take a look at this:

http://zone.ni.com/devzone/conceptd.nsf/webmain/3ef39f7bc420236b862569a80078b9ed
http://zone.ni.com/devzone/conceptd.nsf/webmain/732CEC772AA4FBE586256A37005541D3

as far as i remember there's also some information about memory managment at the RT LabVIEW help files

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 6 of 6
(3,265 Views)