LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to add a time stamp to an array

 

 Currently the VI that I have attached has the capacity to log data from the set of 14 arrays. I currently have a tick counter hooked up. However, I would like to add a time stamp that will display the elapsed time in seconds from the begining of the data logging. Could anyone help me out with that? Please see the attached VI and sorry for how messy it is, I have yet to go back and clean up the wiring. 

 

the mess of arrays on the lower left hand of the while loop feed into the "Index Array" building block and from there they will be scaled (for most of the wires the multiplyer is just there so that I can see what channel they will be when I hook it up for logging) The wires then feed into a "Build Array" Building block and I assmed that is where I had to hook up the time stamp for me to be able to log it.

 

Thanks,

0 Kudos
Message 1 of 5
(3,420 Views)

I'm not sure I completely understand the VI, but have you thought about using a cluster?  Just bundle a timestamp (from Get Date/Time in Seconds, convert to double if you want) with various arrays (or with an array of the arrays; a 2D array).  Also, try pressing Ctrl-U on the block diagram.  It cleans up the wires for you atomatically 🙂

 

Jeremy

0 Kudos
Message 2 of 5
(3,405 Views)

A cluster will not work because you can't pass a cluster to the Write to Spreadsheet file.

 

While looking at the VI really, really hurts my eyes, in order to use an array, all data types must match. You would convert the DBLs to strings and the timestamp to a string, add the timestamp to the value array with the build array, and then use the Write to Spreadsheet set for string data.

Message 3 of 5
(3,402 Views)

mets501 wrote:

  Also, try pressing Ctrl-U on the block diagram.  It cleans up the wires for you atomatically 🙂

 

Jeremy


That tool does not exist before LabVIEW 8.6.  The original poster attached a VI from LV 8.0

 

Attached is the VI where I ran Block Diagram cleanup in 8.6.1f1 and back saved to LV 8.0.  I went through and cleaned up almost all the coercion dots as well.

 

The original poster should start working from this file since it is much cleaner than the one they posted.

Message 4 of 5
(3,379 Views)

Thanks for all the help.  Still working out some bugs but progress has been made.

Regards.

Martin

0 Kudos
Message 5 of 5
(3,348 Views)