Jump to content

Re: write to file


Rayc

Recommended Posts

Hello All

I have a wee problem (well, I'm scratching my head) which may be quite simple for others...but.

I am collecting data from inputs, building an array and then saving the array points to a file using 'Write LABVIEW Measurement File". This is working fine.

Now I want to add a timestamp (with the seconds field) to each set of sample points, but am having a mental block when it comes getting the above VI to accept the two different data types.

What am I doing wrong here, and what am I missing.

If anybody can help I would be most appreciative.

Thanks and best regards

Ray

Link to comment

If i'm reading the question correctly, I would suggest that one possibility would be that you could transform both the timestamp and datapoints to a string before putting them together in an array and writing them to a file. If you have an example that you can post of what your trying to do I might be able to come up with a better suggestion.

Dave

Link to comment
If i'm reading the question correctly, I would suggest that one possibility would be that you could transform both the timestamp and datapoints to a string before putting them together in an array and writing them to a file. If you have an example that you can post of what your trying to do I might be able to come up with a better suggestion.

Dave

Hello Dave, Aristos

Firstly, thanks for the reply.

I am using the Express VI "Write LABVIEW Measurement File". I have tried to bundle both the string data (which is the format from the "Get Date/Time String", and my data which 1-D array) and connect them to the "signals" input of the file saving VI, but it baulks at this.

I have also attempted to change the string data (time) to a number and add to the array, but the output format is not appropriate for my needs.

The problem seems to be with the Express VI, and what it likes to see at it's input.

I would like to post a copy (or even a cutout) of what I am attempting, but the project this belongs to is "commercial in confidence", so I am not permitted.

Before I give up and return to the lower-level file saving VI's, I"ll spend some more time on this.

Thanks again fellas

Ray

Link to comment
  • 2 months later...

You might want to have a look at this example VI: ./examples/file/plat-tdms/TDMS - Write data (events).vi. It logs an array of values, a timestamp (fully qualified) and a comment string within a loop. An example that reads the file is included, so is a more generic TDMS File Viewer.

If you are using an older version of LabVIEW, try ./examples/file/storage/Write Event Data.vi. Does the same thing, but with a TDM file as opposed to a TDMS file. Reader / viewer are included here as well.

Hope that helps,

Herbert

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.