LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-time waveform chart timing

HI,

 

I have been struggling with my VI for a project I am trying to do. My project is calculating BPM using a heart rate sensor. I have been able to calculate this. However, I want a graph to show BPM vs time in between each reading. I have noticed that the sensor reads every 10 seconds and wanted the graph to read it only 10 seconds. However, the graph continues to read the entire time and the BPM is not corresponding with the correct time. I have tried both a waveform graph and chart. Any help will be appreciated thank you! 

 

I am using a Vernier heart rate sensor and a DAQ.

0 Kudos
Message 1 of 2
(1,907 Views)

Sigh.  What you need to do is to Learn LabVIEW.  You need to understand the Principle of Data Flow, which governs the rate the Loop runs, the order in which functions operate, etc.

 

Here are some questions and comments:

  • Express VIs should (almost) never be used for serious work.  They are designed to fool "beginners" (such as yourself) that they will do all of the work/thinking for you.  Not true.  What they will do is "hide the details", which usually means there's no hope in understanding what is going on inside them unless you write a big Comment explaining such things as:
    • What the Express VI does (the name certainly doesn't tell me!)
    • If data are being acquired, what kind, how many channels, what sampling rate, how many points.
  • Dynamic Data Wires are even worse than Express VIs!  Indeed, the first thing you do with it is to throw away all of the timing information!
  • DAQmx is not difficult to learn, and can provide its data as Waveforms (which are data + sampling information in a cluster).
  • Are you running a "continuous" or "episodic" process here?  That is, are you dealing with a continuous stream of data (and hope to do continuous analysis) or "Take some data, analyze it, some time later take more data, analyze it, repeat until I say Stop"?  The structure of your program suggests episodic, but as I can't see "inside" the Express VI, I'm worried it might be trying to run in "continuous" mode.  That's a problem.
  • I see code, but none of it makes sense.  Except for "Waiting for start", there's no indication what is supposed to be happening.
  • For that matter, what are the data?  You talk about BPM and a heart rate sensor -- does it output a voltage proportional to heart rate, or does it output a waveform showing heart beats and you need to deduce the rate?
  • I see you are doing some computations.  Of what?  Why?  What do the "magic numbers" mean?  [I can guess, but I shouldn't have to guess ...].
  • Try to keep all of your wires going from left to right.  That means that the Write to File function needs to be moved way to the right and not have a "backwards wire" running into it.
  • What do you want the plots to show?  Do you know the difference between a Chart and a Graph in LabVIEW?  [You are using Graphs, and it seems to me that your task, and a word in your Title, suggest "Chart" ...].
  • Before you do any more work on this Project, spend a few hours with some of the LabVIEW tutorials mentioned on the first page of this Forum.  Learn more LabVIEW -- it will serve you well.

Bob Schor

 

 

0 Kudos
Message 2 of 2
(1,887 Views)