Jump to content

get xy waveform last value


cromax

Recommended Posts

QUOTE (cromax @ Nov 27 2008, 06:42 PM)

hello

I want to use get xy waveform function with the Aim to get the last value of waveform acquisition.

What index i can use in this function?

I read in a help that if i don't use any index i get the o component and not the last.

It's true?

thank you

Last index = length - 1

And yes, if you don't wire any index, you'll get the first result (index=0).

Link to comment

Thanx NevilleD,

That's really neat and faster and more compact than always going with "Index array"("Array Length" -1). I tried it and was surprised to see it working, even if you change the length of it. If you do that, without an index, it takes the "n" last elements in the array. LabVIEW Help file specifies this behavior. Neat!

I'll reuse that one for sure.

Olivier

Link to comment

QUOTE (normandinf @ Dec 1 2008, 12:57 PM)

It is easier, although my benchmarks show it's 3 times slower than the "Index array"("Array Length" -1) way. Averaged on a million operations with 100-element array, using "Delete from Array" resulted in a 7.2us execution time per loop, compared to 2.25us per loop for the "Index Array" method. Actually, other methods are faster too:

Based solely on execution speed, you should use the IndexArray(Length-1) method... but reversing the array is not bad for a 100-element array.

Sure, its the lazy programmer's way to get at the final element. It also conserves valuable block diagram space; and with multi-core processors, it shouldn't make too much of a difference. That being said, if I want a routine to be really fast, I use the Index array with (N-1) as input.

It might be slower because a buffer might need to be allocated for the remaining N-1 element array. Did you have that wired as well?

Neville.

Link to comment

QUOTE (Neville D @ Dec 1 2008, 04:16 PM)

It might be slower because a buffer might need to be allocated for the remaining N-1 element array. Did you have that wired as well?

There were no difference (or sub microsecond) for unwired index or 0-wired.

And I totally agree with your usage assessment. I, too, am lazy most the time... :P

EDIT: I didn't try wiring the DeleteArray index with (length-1)... (If we did, then the output changes from Scalar to Array)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.