LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a VISA read function to read the serial port, but the first iteration of every cycle shows the data from the last iteration of the last cycle

Attached is the vi.  Ignore the portions which are used to delete the first two data points for the graph, as well as elapsed time tracking.  I believe that i have eliminated the need for this, with the exception of this last nagging problem.  Every time I run the vi, the time stamp which shows up in the iteration (generated by the instrument, not the pc) is the last time stamp from the last cycle run.  Can anyone save me?  I feel a maniacal laugh welling up inside.
0 Kudos
Message 1 of 4
(2,795 Views)
OK scratch the last posting...now I have it so that the fist iteration is all 0's, (except the tiem which is 8:00pm, which I know is the eqivalent of time zero.)... Apparently, something in my sequencing is off, since I appear to be saving the 1st data point to file prior to having received it from the serial port?  Can ANYONE help?
0 Kudos
Message 2 of 4
(2,790 Views)
Dan--

Are you receiving leftover data from the last iteration?  Here is a couple of things to try:  1.)  Enter a small wait VI between your VISA Write and Read.  2.)  Try to use Error Handling.  It provides a good debugging tool when something goes wrong in your program.

-Mark
0 Kudos
Message 3 of 4
(2,772 Views)
It's because your time stamp shift register is uninitialized.  When it runs a second time, the shift register "remembers" the last value it held from the previous execution.

0 Kudos
Message 4 of 4
(2,762 Views)