LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Time Stamp to Spreadsheet

Solved!
Go to solution

I am creating a spreadsheet of temperature readings using DAQ Assistant. When I try to add a timestamp the value placed into the spreadsheet is always 77. What am I doing wrong?

 

Thanks!

 

Ben

0 Kudos
Message 1 of 3
(3,120 Views)
Solution
Accepted by topic author bsetter

Actually, you aren't using the DAQ Assistant.

 

You are using something called DAQNavi Assistant which I have never heard of before.

 

But the problem is in your code where you get the timestamp value then convert that to a string.  You are then converting the string to a byte array.  So if your time is 1:01 PM, you  now have a string of characters "1" ":" "0" "1" "space" "P" "M" and they show up as the ASCII equivalents.  That Array of ASCII values gets converted an array of doubles then a dynamic data type.

 

The value 77 is the ASCII value for "M".  My guess it is afternoon and you are basically sending the value of 77 for the character M to your data file.

 

Try to get rid of the express VI's and the dynamic datatype and convert them to real LabVIEW data types in your code as soon as you can.  You should probably convert all of your numbers to strings early on since that is ultimately what you want to see in your text file.  By converting to strings, you can control the format of each of your pieces of data, then combine those string elements into an array that you send to the Write to Spreadsheet File.

0 Kudos
Message 2 of 3
(3,106 Views)

Thanks! I ended up converting everything to strings and it worked. 

0 Kudos
Message 3 of 3
(3,094 Views)