From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-19-2016 12:50 AM
Hi there Labview Professionals,
I have an issue with coding some simple if else statements using text file data.
As attached from the text file I have provided. (When you open the text file, there are 3 long columns of data, variables C G and D respectively.) I have to check the C and G values if they are larger than 0.65.... if one of the values are larger than 0.65, I have to increment a count and the boolean button would light up indicating there is one. The entire process continues throughout the data.
So far, I have only managed to create the if else statement with fixed numeric points. Does any of the professionals know how to replace the fixed numeric points through the text file?
Much appreciated!
Solved! Go to Solution.
10-19-2016 01:25 AM
10-19-2016 01:29 AM
@Hatef.fouladi wrote:
I got a bit confused what you really want but
I think you have to work with In Range and Coerce Function vi
and also Boolean function
Apologies if its too confusing for you.
Basicially, when I load the data file, the if else statement will scan the 3 columns and check individually if any value is larger than 0.65, if it is larger than 0.65 I have to make a output stating that 1 of the data has a value larger than 0.65 for which I have to make use of the boolean button to act as some kind of "LED" to light up if there is a value larger than 0.65.
Only the third column is not affected by the if else statement and data will be continued to be read.
10-19-2016 01:37 AM
10-19-2016 01:51 AM
@Hatef.fouladi wrote:
now what is your problem to solve?
I couldn't link the text file path to the entire if else statement.... am I short of something or what do I need to add it so that the text file data can be read and data can be scanned for values larger than 0.65?
10-19-2016 02:09 AM
Hi
I could not open your file since I am having LV2014. But from your ques i suppose you can open the text file and read the first 2 columns and compare whether its >0.65. i.e read first column and compare. then read second colum and compare.
10-19-2016 02:10 AM
@Nghtcrwlr wrote:you can open the text file and read the first 2 columns and compare whether its >0.65. i.e read first column and compare. then read second colum and compare.
How do you do this part? This is what I couldn't do. I have only managed to create the "greater than" portion....
10-19-2016 02:12 AM
Hi Lexen,
I have to check the C and G values if they are larger than 0.65.... if one of the values are larger than 0.65, I have to increment a count and the boolean button would light up indicating there is one. The entire process continues throughout the data.
Trying to translate your text "word by word" into LabVIEW:
Read the file, index the columns, compare with your threshold value, "light" a boolean indicator, increment a "count"…
10-19-2016 02:28 AM
GerdW was a bit faster than me 😛
10-19-2016 02:32 AM