LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Subset with LabVIEW 6.1

Hallo,

I need a subset of an arry included in a file. For that I search a number in the array. But in my VI doesn't find the number. I added the VI and the txt-file. The number to be found is the third one of the txt-file. What is my fault?

Thanks for helping !!

Arno
Download All
0 Kudos
Message 1 of 5
(3,065 Views)
The problem i think lies with your decimal point separator. I have attached a modified vi that should fix your problem. There is a function in the string conversion palattes that will allow you to use the comma as a decimal point. I think it is the "use system decimal point" option.
0 Kudos
Message 2 of 5
(3,065 Views)
The comma is OK because Arno uses a german OS where the decimal separator is defined as comma, so this is not the problem.

The problem is, that he reads it first as SGL, then converts to EXT, this yields e.g. 2.8810699999999999E-42 which is not equal to the test number.
Your way is correct. You read it directly as EXT.
0 Kudos
Message 3 of 5
(3,065 Views)
Thanks for helping. But since I am using LabVIEW 6.1 I cannot open your VI which is written in LabVIEW 7. Please convert it to 6.1 or send back a picture of your code.

(Under Windows 9x: Open the diagram, press Alt+Print (Druck in Germany, next to F12) paste the picture in MS Paint, save it as JPG or BMP or whatever and send it to the Forum.)

Arno
0 Kudos
Message 4 of 5
(3,065 Views)
Try the following on your diagram:

double-click the "Read from spreadsheed file.vi" and look at its diagram.

-- In the center, you see a SGL array named "type(empty)". right-click on it and select "representation..EXT".
-- Repeat with the two terminals on the right (all rows, first row).

Now save the VI in your own folder with a new name (e.g. "Read EXT from Spreadsheet file.vi"), you also might want to change the icon, e.g. just fill the background with a different color.

See if this helps.

Of course with real data you should never use "search array" with floating point numbers. The chance of getting a hit is near zero. Alternatively, you might try to find the array element that is closest to your test number (e.g. subtract it from the array,
take the absolute value, then find the minimum using "array Min Max".
0 Kudos
Message 5 of 5
(3,065 Views)