LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time elapsed between each iteration

Solved!
Go to solution

Thanks so much for your patience and generosity of your knowledge. I am going to spend a few hours studying and testing the code you sent me to see if I can figure out how it is functioning.  Upon looking at the code, there is a lot I don't understand, but, I think I can figure it out with some effort.  I am going to hook it up to my voltage hardware and step through it, and see if I can develop my own understanding of how the individual components are operating. 

 

One thing in particular that I am struggling with is the presence of TWO DAQmx Read's, one inside the sequence structure and one outside.  Does the value measured inside the sequence structure go to the shift register BEFORE the DAQmx Read in the WHILE loop (outside the sequence structure) executes? 

 

If YES, how do you achieve the V2-V1, V3-V2, V4-V3 calculation?  If the value read in the sequence structure is always the value that is subtracted, are we getting V2-V1, V4-V3, V6-V4 instead of V2-V1, V3-V2, V4-V3?  Why wouldn't we be getting V2-V1, V4-V3, V6-V5?  Am I reading it wrong?

 

As I said, I will be stepping through it today, and maybe I'll understand it better after I observe the probes!!!

Dave

0 Kudos
Message 11 of 13
(591 Views)

Dave,

 

There was a bug in that last version. The Previous Value should not have gone to the shift register.

The Current Value should go to the shift register (it then becomes the Previous Value in the next iteration of the loop).

This has been fixed in the attached version. Oops!

 

> One thing in particular that I am struggling with is the presence of TWO DAQmx Read's, one inside the sequence

> structure and one outside.

 

Note that the case statement inside the sequence structure is controlled by the loop iteration counter (the blue i).

The first DAQ read (inside the sequence structure)  is only executed once (when "i" = 0).

 

>  Does the value measured inside the sequence structure go to the shift register BEFORE the DAQmx Read in the

>WHILE loop (outside the sequence structure) executes?

 

In the new fixed version, the value measured inside the sequence structure never goes to the shift register.

 

Sorry for the confusion.

 

steve

 

 

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 12 of 13
(581 Views)

Steve,

That is GREAT!!! I studied the earlier vi and I found the shift register problem myself, so, it was GREAT to see you offering comment confirming my analysis!!!  I guess I am learing SOMETHING!  Success.  Now, I understand much better how your vi works.  I get the mechanism you are using to get the first measurement in the case structure now.  I am going to run the new version and follow the probes and keep studying it!  This is so rewarding, finally!!! THANK YOU!

Dave

0 Kudos
Message 13 of 13
(577 Views)