11-09-2017 05:37 PM
I'm using the above block diagram to calculate respiratory rate. It's mostly working, however, when I export the data into an excel file, I notice that data is collected and displayed every 100ms up to 10 seconds, and every 1s thereafter.
Ex; I can see data points for .1, .2, .3, .4 - 1 second, which creates a very nice curve. But, the data points for 10-11 seconds are all clumped together at 10 and 11 seconds, breaking the curve.
I think inherently in the program, there is a function somewhere which makes it so that after 10 seconds, something changes about the data collection. But, for the life of me, I cannot find where or what to change (I am pretty new at Labview.)
If someone could help me with this problem, that would be great.
Thanks,
-ExperimentGuy
11-09-2017 06:21 PM
It would help if you posted your actual VIs. It is very hard to debug an image.
11-09-2017 06:45 PM
Well, your file write is kind of weird. Why do you convert a float number, to a string, to an array of integer numbers, to dynamic data, and then write it? You lose a ton of data that way.
One of the conditionals on your string has it sometimes read "calculating" and sometimes show real numbers, and that "Calculating" string is getting jammed into your measurements because of that.
Can you just wire the data from directly before the first string conversion all the way over to the Signals input (through the dynamic data converter if you must)?
11-10-2017 09:49 AM
Hello ExperimentGuy,
I agree with the two posts above mine, which ask for the original VI, or at least a snippet of it, so the community can help you debug further this application: Use VI Snippet to Store and Share Reusable Code Sections.
You might want to use some of the debugging tools that LabVIEW has built in to understand what might be happening to your application, and perhaps discover what might be causing this behavior: Debugging Techniques in LabVIEW
Warm regards,
11-10-2017 06:03 PM
Your time information is being generated by the conversion of your I32 array into dynamic data. You are creating false time information, why not record the actual time index for each data point? Use time functions (Tick (ms) for example) and some basic math to determine the actual time for each iteration of your for loop. A shift register and some basic subtraction gets you the time elapsed (in ms) for each data point from the beginning.
Record this data along with your raw measurements (get rid of that silly Write to Measurement File express VI while you're at it).
11-11-2017 02:23 AM
Thank you for the very robust response! I see now how the picture I provided is not very useful to you guys.
Sorry for the delay in response; I've been traveling - I've now attached the 4 programs provided by AndyCandy to calculate respiratory rate. These are the original programs - the only major change I made was to change "Sample Size" towards the top of the image from 1000 to 20,000 in hopes of collecting more data. It is clear to me now that it is not that simple.
11-11-2017 02:25 AM
Thank you very much for your feedback. I will get on top of learning the contents of your post (as I do not see how to accomplish that yet) and do my best to incorporate them into the VI.
11-11-2017 02:26 AM
I replied to my original post and posted the entire files supplied by AndyCandy. Thank you very much for your interest in helping!
11-11-2017 02:27 AM
My apologies, I'm don't comprehend the meaning of your question. I simply downloaded the files provided by AndyCandy (which I attached in a new post replying to my original post) and do not understand very much about Labview. I don't follow the logic of why he did what he did, or if it was efficient, or how best to modify it to make it better. However, I will do my best to read about the topics you are mentioning, and understand them better.