LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add notes to csv file while aquiring data

I am new to DAQ and not quite sure how or even if it is possible to do this. I am currently taking in pressure and temperature measurments. As it stands right now I write down notes on certain paremters or things that happen during testing in a notebook (by hand). In doing so I right down the time and what happend and all that good stuff. After testing I will add the notes at the particular time intervals to the cvs(typing them in manually). Is it possible to add notes directly to the csv file when aquiring data? I am using just the simple write to spreadsheet File.vi. As I mentioned I am new and did notice that there is a report vi. Might that be the way to go?
0 Kudos
Message 1 of 10
(3,572 Views)
Off the top of my head I would look into using an event structure. You would have a button on the front panel of your vi that fires off a Text box or subvi. The thing you would have to track is the file position so you put the information into the correct area of your file. The question is than can you stop your aquisition while you write your notes?
Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 2 of 10
(3,565 Views)

Well stoping the data while I take my notes is not that big of a deal. Infact I dont think I would want to do that. But what you are describing seems exctly what I want to do. Could you point my in the direction of an example or something to further explain?

 

Thanks much

0 Kudos
Message 3 of 10
(3,541 Views)

How exactly would you like the comments written?
Because if you write comments intermittenly through your data, if you move the data to excel or anything else, it isnt going to handle the text well. I would recommend either writing comments all at the beginning or at the end.

Since in your case you will be commenting during the test, I would recommend all at the end.

Cory K
0 Kudos
Message 4 of 10
(3,536 Views)

Why not use a separate file with timestamps. Then you can log the time then you started writing your comment. That way you can time the vent closer to the thing you want to comment. Use a separate loop for comment writing. This loop will most of the time do noting so insert a "wait (ms)" function and set the time as high as 500



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 10
(3,528 Views)

GovBob, I think you have the correct idea on what exaclty I want to do. After looking at the event and how it operates, I believe it is exaclty what I want. I am looking for how to get a text box to type in whatever comments I want, then perhaps press a button such as "add" and have labview add it to my csv, then clear the text box and wait until I want to add something else. I do not think getting the comment to the right place on the csv file will be a huge deal. Any suggestions on getting a text box and being able to fire off?

 

Thanks all for the help

0 Kudos
Message 6 of 10
(3,504 Views)

lkdfjaio1241 wrote:

GovBob, I think you have the correct idea


Who is GovBob.....TFR30E.gif

Smiley Very Happy



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 10
(3,501 Views)

Well that would be me Lil' Red Rooster Smiley Wink Smiley Very Happy

lkdfjaio1241: Since you are new this is a great opportunity to learn a bunch on a fun project. I would take a look at the Producer Consumer (events) template. With an event structure you don't want it to be unresponsive to user input when it is processing a loop.This involves using queue's. Also (if you don't already) make sure you understand how a state machine works. If it was me I would use a subvi for comments in the producer loop.

 How I would invision this is that you would have a Producer loop with an event structure in it. A start button would trigger a consumer loop that would start your DAQ acquisition through a named queue. You would also have a comments button event case. This would fire a second consumer loop through a different named queue which would capture the location of where you were at in the .csv file and popup a subvi where you would write your comments. In this manner you would be still running your acquisition. You could then commit your comments at the end of your application when you fire the stop event case.

 Cory's comment is very valid: how are you going to view this data? And what version of LabVIEW are you using. I might try my hand at modeling this if I have time this weekend.

Hope this helps

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 8 of 10
(3,492 Views)
The user who has the second reply
0 Kudos
Message 9 of 10
(3,489 Views)
I view the data by using excel, that way if any further manipulation is needed it can be done easily. I dont think that the text will mess up that much. I plan on putting the comments as the last piece of data. Also on top of that, most of the time the comments are not very large. I would presume that what is meant by excel will not handle the text well is that a large paragraph would be difficult to read in one cell. However most the time it would usually just be one sentence and on rare ocasion, maybe two. I am runing version 8.2. Thanks for all the help
0 Kudos
Message 10 of 10
(3,484 Views)