Jump to content

Save array to xls file


cooky

Recommended Posts

Hi everyone,

I have written a vi that saves a waveform to a dat file using the 'Write Waveforms to File' function, I have also successfully written a vi that reads this file back, converts it into a 2D array and displays it on a XY graph.

I can save (export) this dat file to a xls format, however the date format is wrong. It uses the seconds since 1904, want I want to use is the traditional dd/mm/yy hh:mm:ss format.

Can anyone help me with this??

Thanks,

Cooky.

Link to comment
  • 2 weeks later...
Hi everyone,

I have written a vi that saves a waveform to a dat file using the 'Write Waveforms to File' function, I have also successfully written a vi that reads this file back, converts it into a 2D array and displays it on a XY graph.

I can save (export) this dat file to a xls format, however the date format is wrong. It uses the seconds since 1904, want I want to use is the traditional dd/mm/yy hh:mm:ss format.

Can anyone help me with this??

Thanks,

Cooky.

Hii Cookie,

While saving the data into the excel file you arer getting the wrong date format mean you are writng it from the graph, bcoz the problem of 1904 is also in the real time graphs when we are displaying the data into it, of that problem what you can do is I ve written all the proc below and i also ve attached the sample vi.

By default, waveform charts and graphs display the absolute time at time 0 as 7:00:00 PM, 12/31/1903 on a Windows based system. Property nodes can be used to get the correct absolute time to display on the x-axis of the waveform chart.

First, right click the chart on the front panel and select X Scale >> Formatting. Then set the format to Absolute Time.

Create a property node for the waveform chart by right-clicking on the chart on the block diagram and selecting Create >> Property Node. Expand the property node to display two properties. Select the Format property and the Offset property. The Format property is located under X-Scale >> Format and Precision >> Format, and the Offset property can be found under X-Scale >> Offset and Multiplier >> Offset. Right click on the property node and select Change All to Write.

For the Format property, the context help shows that there are multiple inputs to this property. Wire in a value of 7 to set the format to Time and Date.For the Offset property, first wire the output of the Get Data/Time in Seconds VI to the input of the To Double Precision Float VI. Then wire the output of the To Double Precision Float VI to the Offset property.

In addition, if you know the number of data points plotted to the chart per second, you can set the Multiplier property located under X-Scale >> Offset and Multiplier >> Multiplier. If there are x data points generated per second, wire in a value of 1/x to the Multiplier property. A simple example program "Chart with Timestamp" that demonstrates how to do that is attached

If you are not facing the problem of such kind then what you can do is using get date/time in seconds and after that you can add the format Date/time string.

Download File:post-3625-1134103439.vi

Thanks & Regards,

Nishant Desai

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.