10-20-2015 11:07 AM
Hi guys, I have a question.
But before that, I would like to say this is my first post here. I have looked around the forum for a similar post but could not find one that was helpful toward solving my problem. Also, I am not an experienced Labview user. I work as an undergraduate lab assistant on campus and we use Labview to record data for our experiments. I did not set up the Labview the way it is. The previous person did. I am simply running experiments as instructed
Our experiments are simple. We record voltage readings vs. time. (Time is on the X axis, and voltage on teh Y axis)
Simple right?
Well the problem is that when we are recording an experiment for an extended period of time, Labview will only record the last 17 minutes of the experiments... In other words, if we ran our experiment for 30 minutes, the first 13 minutes of data gets deleted. And Labview keeps deleting earlier data as it keeps recording... only leaving the most recent 17 minutes... It is apparent because the graph of the data only keeps to the most recent 17 minutes and when we export the data to microsoft exel, only the most recent 17 minutes of readings are there.
WHY? WHy only 17 minutes?! I did not see anything in the setting specifying 17 minutes!
We record with the frequency of 1 data per second.
The instrument that we have is the NI9215 and NI 9219 connected to National Instrument NI cDAQ-9174 reader.
Our set up is as followed: the computer is connected to the National Instrument, and it is connected to a DC power supply outputting a constatnt voltage towards our device.
Any help on how to change the setting would help. because I have tried minor tweaks but nothing seems to work.
10-20-2015 11:12 AM - edited 10-20-2015 11:14 AM
Pictures of your screen of the front panel and a little of the code doesn't help us much. If it's just a school thing, you should be able to share the code so we can see inside those Express VIs.
17 minutes at 1Hz is approximately 1000 samples. Charts have a default history of 1024 unless you right-click and change it.
This will fix your issue with the chart, but not the data output. You almost certainly have your express VI to pull 1000 samples and then write them to file. Double-click the express VIs to configure them and play around with the settings.
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe." - Abraham Lincoln
Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-20-2015 11:12 AM
10-20-2015 11:28 AM
As others have said, the export to excel function on the right-click menu of the chart exports the history of the chart - which is probably set to 1024 elements. You can increase the history length and the chart will hold/display more data.
What you might want to think about doing is saving the data to a file - if the PC/software crashes or you close the program without exporting the data to excel you would lose your data with your current setup but if you saved the data to a file then you could just open the file up in Excel and you'd have all of the historic data!
10-20-2015 11:33 AM
@Sam_Sharp wrote:
What you might want to think about doing is saving the data to a file
His picture of his screen of his code shows that he is using a Write to Measurement File express VI but is still seeing only 17 minutes. It think there are two problems here: the chart, and the express VIs. I bet his data on file is 1000 data points (something to do with his acquisition settings) and his chart data is 1024 points.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-20-2015 04:18 PM
I think you can see by the comments that the problem lies in poorly-designed LabVIEW Code. [Believe it or not, it is possible to write Bad Code in LabVIEW, as much as we'd like to think otherwise].
We typically record from 16-24 channels at 1000 samples/sec, and have no problems recording for far more than 17 minutes. Of course, we aren't trying to keep all that data in memory, don't use Express VIs for data acquisition or saving, and do other "Good LabVIEW Code" things.
We're more than willing to comment on the code you are running, and to suggest how it might be improved (it may take only a few "tweaks" to get it past the 17-minute barrier), but for this to happen, we need the code. Do not attach images of the code, attach the VIs, themselves. I'm guessing (and hoping!) that, in fact, you have multiple VIs involved in this Project, all located within a single Folder on some PC (and, maybe, within a LabVIEW Project -- wouldn't that be nice?). If so, compress the enclosing Folder and attach the resulting .zip file. You are sure to get helpful (?) comments.
Bob Schor
10-20-2015 06:13 PM
@Bob_Schor wrote:
[Believe it or not, it is possible to write Bad Code in LabVIEW, as much as we'd like to think otherwise].
I've never heard anybody say the otherwise. And I run into bad LabVIEW code almost every day. Unfortunately, I am forced to work with the bad code and spend as much time trying to get it to work as it would have taken to completely rewrite it.
10-20-2015 07:22 PM
I got a complaint like this about some code I wrote not long ago. My code did write a log file, but somehow the user didn't realize that, and he was clicking Export to Excel at regular intervals to make sure he didn't lose any data, then merging the files. He was a lot happier when he found out that the program generated a log file of all the data, with no additional effort required on his part.
10-20-2015 07:34 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-21-2015 09:08 AM
Crossrulz,
My comment about the possibility of writing bad code in LabVIEW was supposed to be "tongue-in-cheek", a joke. One of the Good Things about LabVIEW is that, with a little bit of care, one can write largely-self-documenting code that is relatively easy to understand, easy to grasp, easy to maintain and modify. However, "LabVIEW Spaghetti", while more colorful than Spaghetti Code in most Text languages, is easily as difficult and frustrating to contemplate (sometimes "Starting Over" is the faster and safer alternative).
BS