01-11-2021 02:13 AM
Hi everyone,
I have two txt files that have 1-D array each. I need to prepare a look up table that maps both files. Do you have any idea? I am new to LabVIEW.
Also, the two files don't necessary always have the same number of elements, it depends on the test plan. the txt files are generated by another LabVIEW program.
One more thing, the value that the program should find doesn't necessary to be found, so It should be calculated based on the relation between the nearest point and the desired output.
I am open for other ideas as well!
Solved! Go to Solution.
01-11-2021 02:25 AM
Hi Ahmed,
@AhmedAl-Omoush wrote:
I have two txt files that have 1-D array each. I need to prepare a look up table that maps both files. Do you have any idea? I am new to LabVIEW.
Use Threshold1DArray. Prepare an array of [XY] points before calling this function - don't forget to read its help!
@AhmedAl-Omoush wrote:
Also, the two files don't necessary always have the same number of elements, it depends on the test plan.
Please provide an example for that use case of "different number of elements", together with examples of expected output for given input values!
01-11-2021 02:36 AM
Hi GerdW,
attached are the two txt files. for example I need to find the y value of -6 as x-value.this should be calculated based on the nearest point or the function that related x &y.
for numbe rof elements, here in the txt files, they have 4-elements, but this is variable and could be 29 or 16 or any random number.
Best,
Ahmed
01-11-2021 03:15 AM
Hi Ahmed,
what have you tried so far?
Where are you stuck?
Mind to attach your current VI?
@AhmedAl-Omoush wrote:
for example I need to find the y value of -6 as x-value.this should be calculated based on the nearest point or the function that related x &y.
Just 4 easy steps: please try on your own!
01-11-2021 04:19 AM
My problem is with matching the value.
Here I tried different value but it always refers to the first element in the column (89.2)
01-11-2021 04:43 AM
@AhmedAl-Omoush ha scritto:
My problem is with matching the value.
Here I tried different value but it always refers to the first element in the column (89.2)
In your example, you should reverse both X and Y arrays before processing.
P.S.: if X and Y are related in a graph, I don't see how the number of ordinates could be different from the number of abscissas
01-11-2021 04:43 AM - edited 01-11-2021 04:46 AM
Hi Ahmed,
there are two problems with your VI:
See this:
This is a (quick &) very dirty solution to your problem.
Please follow pincpanters suggestion, read the LabVIEW help as suggested by me - and provide the data in those text files in a compatible way for the Threshold function!
01-11-2021 04:49 AM
Thank you! much appreciated. Now it's working