09-11-2013 06:24 PM
Ok so I must be over thinking on how to do this. I am trying to run a section of my code when I recieve a True value. When False I do not want it to do anything. Ive tried using a true/false case structure but the requirement to hook the false case to something is screwing me. Also tried a while loop but it just latches on and never reads the false after its already on.
Solved! Go to Solution.
09-11-2013 06:28 PM - edited 09-11-2013 06:30 PM
@joedirt wrote:
Ok so I must be over thinking on how to do this. I am trying to run a section of my code when I recieve a True value. When False I do not want it to do anything. Ive tried using a true/false case structure but the requirement to hook the false case to something is screwing me. Also tried a while loop but it just latches on and never reads the false after its already on.
"requirement to hook the false case to something". What do you mean? Post your code so we can see. Do you have some wire that passes out of the case structure to some other code or to an indicator?
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
09-11-2013 06:34 PM
I have data coming out of the case structure in the true case. but in the false case it requires that data point to be connected. And I dont want it to do anything. But I can't connect it to anything. and if I set it to default it doesn't work. Basically I only want that portion of the code to run when i get True, when False I dont want to write anything to the spreadsheet file.
09-11-2013 06:45 PM - edited 09-11-2013 06:45 PM
Then place the file writing code also inside the case structure!
(btw, your code is completely silly. ou are building an array with one element, measuring the size as one, subtracting one, then getting the element at index zero. This is always the exact same value that entered he case structure a nanosecond earlier. You can delete all that code and only leave a wire and it would not make any difference.)
09-11-2013 06:48 PM
09-11-2013 06:53 PM
Okay and I will check out tutorials. I just did all that silly code because I wanted to take the last element of the array and write it to the spreadsheet without adding other values, BUT at the same time enable it to append to file because Ill repeat this code over.
09-11-2013 06:58 PM - edited 09-11-2013 07:00 PM
@joedirt wrote:
Okay and I will check out tutorials. I just did all that silly code because I wanted to take the last element of the array and write it to the spreadsheet without adding other values, BUT at the same time enable it to append to file because Ill repeat this code over.
You don't have an array until you make one right there out of a single element. There are no "other values". There is one element in the array, which is the first and the last element and exactly same as the value you used to build the array. Once you do the tutorials, you'll laught about your code. It is absolutely pointless.
09-11-2013 07:09 PM
Guess I am just confused because if that true case is on for more than a few seconds, I get more than 1 value in my spreadsheet file. But it doesnt really matter either way for this application since its only gonna be on for <1second
09-11-2013 07:24 PM
You get one row (time and value) whenever you append to the file, so it all depend on the loop rate. If some entries seem to have the same timestamp, your time resolution is not set high enough.