LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Old Clip vs New Clip VI

Solved!
Go to solution

Hi,

 

In my old program, clip.vi (attached) was used. Now, I'd like to use Y[i]=clip{X[i]}.vi (under signal processing->singal operation) instead. But, the output seems different if I use the new VI.

My inputs are array and I'm using Laview 2009.

 

Thanks,

Jay

0 Kudos
Message 1 of 6
(2,848 Views)

Where did you get your VI from?

 

It does not do the same thing as Clip VI on the palette.  That one takes the array and forces any values out of range to be at the limits of the range.  (Actually, I have no idea why this VI exists as you can just pass the array through an In Range and Coerce function.)

 

Your VI removes any elements that are out of range  It doesn't "clip" them to the range, it out right removes them.  So the remaining array becomes shorter, and any elements that are after an out of range element get shifted towards the beginning of the array.

0 Kudos
Message 2 of 6
(2,827 Views)
Solution
Accepted by jeongho20000

 


Actually, I have no idea why this VI exists as you can just pass the array through an In Range and Coerce function.


 

There are two reasons:

1. Getting more time to relax by waiting for the VI to complete.

2. Getting a reason to beg for an new machine with 64 bit OS and a lot of GByte of RAM.

 

BTW: The times displayed are in milliseconds for an array of 4000000 elements.

 

 

I ran into an optimization trap. The zero value for In Range and Coerce will only occur when you don't use any output. I added a wire to compare if the arrays are identical. Now I get 200 ms for the In Range and Coerce and 250 ms for Clip.vi.

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 3 of 6
(2,790 Views)

Thank you so much for your reply. I understood the problem now.

 

Best,

Jay

0 Kudos
Message 4 of 6
(2,778 Views)

I ran out ot editing time.

 

Another thing: the In Range and Coerce function will also run out of memory. I expected that this primitve will work on the same memory and does ot make a copy.

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 5 of 6
(2,774 Views)

Okay Jay,

 

Why would you pick Waldemar's message as the solution to your problem?

 

You asked why they were different and I told you.

0 Kudos
Message 6 of 6
(2,748 Views)