LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

input data from two different ports


blizabeth37 wrote:

Thanks for all your help!

 

I have tried the many suggestions with little luck.

 


Evidently you did not understand what I said in my last post, and you don't understand data flow.  I'll try to explain again.

 

Look at your code, look at the wires from the two Get Date/Time functions.  Each loop iteration, they both will get the exact same time.  These two functions are not in any case structure, there is no trigger as to when they will execute.  They will both execute at the same time and will produce the same timestamp.  hence the subtraction will always be 0.

 

Now look at Raven Fan's code.  He is getting the time values from the property nodes for AbsTime.  Notice that the times are written to the property node only when a certain condition exists because the write property nodes are inside case structures.  This means that the first AbsTime is written when the start switch is pressed.  Now both Get Date/Time functions will get the same time, but only the Start AbsTime property node will be written with this timestamp.  The stop AbsTime property node has not yet been written.  When stop is pressed, both Get Date/Time functions will get the same timestamp, but only the stop property node is written.  Now you have two property nodes with two different timestamps.  As Ravens Fan has done, you subtract the two Property Node values to get good results.

 

I hope this is now clear to you.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 11 of 11
(338 Views)