01-11-2008 01:25 PM
exo wrote:
If I remove the sequence the vi stops working.
01-11-2008 01:26 PM
01-11-2008 01:27 PM
01-11-2008 01:46 PM
01-16-2008 08:29 AM
01-16-2008 09:17 AM
exo wrote:
HI.
I'm back. The vi is attached; it's behavior is real strange. I fixed some of the problems but not all.
When I start the vi, output and file are cleared but once the first sensor readings are complete, the reading from the last run show up in the file indicator.That's because you are writing your string to the local variable for File inside the loop.
Once I stop the while loop, I have to wait for the timer before it truly stops. How do I stop immediately.You may need to set up a statemachine type of architecture. Put a case structure inside of the while loop. One case contains the "read data" like you have now. The other case would be "Idle". Let the while loop run faster with perhaps a 1000 millisecond wait timer. To a comparison. If the time value is less than 60 seconds, execute the Idle case again. If the value is >= 60 seconds, execute the "Read Data" case. Make the time to search for equal to "Now" + 60 seconds. This means 2 shift registers to add, one for the next case to execute, the other contains the time value that is 60 seconds away that you are comparing to. With faster loop iterations, it allows the stop value to be checked every second and stop the while loop early. As it is now, if you hit the stop button right as the while loop starts and the stop button is read, you would be force to wait almost 2 minutes for it to truly stop, 60 seconds for that iteration to run, and 60 seconds for the following iteration to run once the stop value is read to be True.
Finally as written, the program reads from the temperature twice, once from each sensor. If I remove the sequence, it only reads from the first sensor, or, at least only seems to record one sensors data in the file. (I don't really care I'd just like to know)
I don't see anything about your code that would explain that. Clean up the code first, then try verifying that behavior again.Also no need to write a value to an indicator and to its local variable at the same time. (Writing empty string to file indicator and file local variable at beginning. Also, to "Output" local variable and indicator inside of loop".)
Thanks.
01-16-2008 09:33 AM
01-16-2008 09:41 AM
Quick question. What kind of machine is this VI running on? When I opened it up, then tried to close it, it said there were changes. One was "VI recompiled" the other said "VI converted from a different platform". What platform are you running this on?
01-16-2008 09:45 AM
01-16-2008 10:22 AM