LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you split 1 d array into sections

Hi
 
Ive got two arrays and find the different elements  and put them into a sub array . What i want to is split these arrays into section for indentifcation purpose.
 
 
Thanks
 
Download All
0 Kudos
Message 1 of 10
(4,147 Views)


jihn wrote:
Ive got two arrays and find the different elements  and put them into a sub array . What i want to is split these arrays into section for indentifcation purpose.

You need to be more clear on what you want ot do.
  1. Do you want to place the elements that are different in a new array or the elements that are the same?
  2. If you want to elements that are different, they will differ between the two input arrays. Do you want them from both arrays and how should they then be arranged in the subarray?
  3. What should the different sections contain?
  4. Are the two input arrays of the same size?

You should also be very careful with the "boolean to 0,1". The output is only I16, so if your input arrays are large and contain more than ~32k different elements, your VI will fail. You should convert to I32 before you sum the elements!

Message 2 of 10
(4,126 Views)
Hi jihn,

additionally to Altenbach's comments you should also keep in mind:
- It's "dangerous" to check floating point numbers for equality (or for unequality in your case)! "1.1+1.1" will not be the same as "2.2" Smiley Tongue
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 10
(4,080 Views)

Hi,

If you could post some more information on what you are trying to do with some data examples of what you want to put in and get out of the arrays I would be more than happy to look into this for you.

Thanks,

Applications Engineer
0 Kudos
Message 4 of 10
(4,036 Views)

GerdW said "1.1+1.1" will not be the same as "2.2"

?! .......  I don't  think so

0 Kudos
Message 5 of 10
(4,022 Views)
Hi Pnt,

this has been discussed many times before. Float have limited precision!

Attached is an example to demonstrate this behaviour in LV7.1: "1.1*1.1" is not "1.21"


Message Edited by GerdW on 12-05-2007 11:51 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(4,016 Views)
You are right..Smiley Surprised
Did not knew that....!
0 Kudos
Message 7 of 10
(4,012 Views)

That is true for DBL and EXT types.

Correct ?

0 Kudos
Message 8 of 10
(4,009 Views)
Hi Pnt,

this behaviour is immanent for all floating point types...
You cannot avoid it, you have to live with it (means: always test your programs for correct operation - or use your own math routines Smiley Wink).
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(4,005 Views)

Hi,

I am unsure exactly what type of data your working with, but if you want to split sub sections I'd suggest using the "Get Sub Section" vi, plenty of array examples exist in the LabVIEW examples section under "help > examples > search tab". Plenty of array vi's exist in LabVIEW and each has it's speciality. If you pass me a VI with the data you want and the outputs you'd like to see I'd be happy to make you an example that closer matches your question.

Thanks,

Applications Engineer
0 Kudos
Message 10 of 10
(3,938 Views)