LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

zeros in charts



exo wrote:
If I remove the sequence the vi stops working.


Meaning what? Broken VI? Different result? No output?
 
Attach the VI that is no longer working.
Message 11 of 41
(1,787 Views)
no output
0 Kudos
Message 12 of 41
(1,785 Views)
please attach the VI
Message 13 of 41
(1,784 Views)
Tried to solve my problem writing to file. This is ugly and it still doesn't produce a single line in the file for each iteration of the while loop.
Got to go. Have a nice weekend.
0 Kudos
Message 14 of 41
(1,776 Views)
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.

Once I stop the while loop, I have to wait for the timer before it truly stops. How do I stop immediately.

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)


Thanks.
0 Kudos
Message 15 of 41
(1,728 Views)


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.


0 Kudos
Message 16 of 41
(1,717 Views)
I made changes. They didn't help. It fact since I don't see the file output, things are worse.
0 Kudos
Message 17 of 41
(1,713 Views)

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?

 

 

0 Kudos
Message 18 of 41
(1,709 Views)
LabView 8.5 on a Mac
0 Kudos
Message 19 of 41
(1,707 Views)
The readings from the previous run are retained because the shift register is not initialized.

Lynn
0 Kudos
Message 20 of 41
(1,699 Views)