01-17-2017 05:09 AM
I have a project where i do have lot of data(hexadacimal) as output of some test results. This data should undergo some calculation like addition,subtraction,multiplication etc. Finally these values should be compared with the reference values and display the result and also indicate whether the test is passed/failed.
can i use Labview for this? I know some basic maths like addition,subtraction etc can be done using Labview but difficult part is handling this data i.e copying data from Text file then reading,calculating and then comparing with refernce values and display the final result. can this be done?Where to save this reference values?where to save/handle this large data?
Ex : 1,2,2,2,6,8,2,5,3,9
Add all: 1+2+2+2+6+8+2+5+3+9 = 40
check whether this 40 is between 10 to 80 range. Is 10< 40 >80.?
then display as Pass.
This is just example. I have lot of data to handle in similar way. How with Labview?
01-17-2017 05:38 AM
Hello,
This is very simple task to be done in LabVIEW.
The first VI reads a file with comma separated values, then takes the first row and add all elements. The result is checked to be in range of 10 and 80 including the limits.
This code is enclosed in the post and was developed using LabVIEW 2016.
01-17-2017 06:09 AM
Thanks correa. Yes that helps me lot to get basic idea how to do this.
But main question is, similar to below example i have many many lines of data and different reference values for different conditions.
so how can i read data as array/table and then do some calculations and then compare with a reference values.
what approach i should use if i have data of 1000 lines and each line i have to add seperately and compare with 5 different references at different conditions.?
ex: 1,2,5,6 add all, then check is this in the range of 10 to 100
1,2,4,8 add all, then check is this in the range of 10 to 50
1,2,5,5 add all, then check is this in the range of 50 to 100
.
.
similar way what if i have 100 lines?
01-17-2017 06:29 AM
Hi sacsk,
similar way what if i have 100 lines?
Whenever you need to do a task several times you should use a loop to repeat that task!
This applies to all programming languages, not just LabVIEW…
LabVIEW also assists you as it allows autoindexing in loops: this way you can easily iterate over all rows in a 2D array and additionally over all elements of a second array holding your conditions!
01-17-2017 08:03 AM
Hello sacsk,
As mentioned by GerdW, you should have repeated tasks in a loop.
I have updated the code to match what you are asking for.
Just bare in mind that if your file has 100 lines, the upper and lower arrays must have the same size becaus the are being indexed as input in the for loop. You may change the code to check for every line if the result belongs to a given range.
I would suggest for you to look for some tutorials about LabVIEW online.