LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic Read/Record Voltage

I am very new to LabVIEW and am in need of some help/guidance. Currently have the latest LabVIEW 2018 installed with a usb-6001. I am trying to record an analog pulsed signal (0-2 vdc) that repeats every 125msec. I have experimented with the peak detector ptbypt and not really sure on how to incorporate the peak Boolean into a record data function.

 

Ultimately I want the program to record every peak that repeats every 125msec and use that data on the analog output on the usb-6001. I would like the analog output to hold that voltage output for about 50 msec or so.

 

I will include what I have experimented with so far in LabVIEW.

 

I appreciate you taking time out of your day to read this and help/guide me through this process.

0 Kudos
Message 1 of 5
(2,246 Views)

OK, a number of questions:

  • Describe the signal a little better.  I'm unclear what an "analog pulsed signal" means.  Is it basically either (around) 0 v or +2 v?  Is it "low" most of the time, then pops "high" for some (unknown) amount of time?
  • When you say "repeats every 125 msec", what does that mean?  Is 125 msec an "exact" or "approximate" number?  
  • I assume you know the difference between the Peak Detector (which takes a waveform, i.e. many equally-sampled-in-time values and finds the peak in the sample) and the PtByPt version, which takes "the next point" and asks "Is this a peak"?
  • I notice you are sampling at 1.25kHz and taking 125 samples.  This seems weird to me.  I generally stick with "rounder" values, like 1kHz and 100 samples (the math is easier).  Is there any relationship between the 125 samples and the "125 ms repeat"?
  • With the sampling mentioned in the previous point, you get points every 100 ms, and can ask "Where, in the last tenth-of-a-second, is the peak, assuming there is a peak?"  Note that there will be an (unknown) delay between the time you know where the peak is and the peak itself.  
  • If your Mystery Signal is a single pulse of width 1ms every 125 ms, then some of your samples of 100 ms will not have any peaks.  Is that OK?
  • How much LabVIEW code have I mentioned?  How many points deal with the "How" of your problem, and how many with the "What"?  Which is more important when starting out?  [Hint -- I have a colleague whose code I help to debug.  My first question is "What are you trying to do", and his answer is to tell me how he is doing something.  That's when I start yelling at him ...]

Bob Schor

0 Kudos
Message 2 of 5
(2,205 Views)

Bob,

 

Thanks for the reply I really appreciate it and I will do my best to answer the questions that you have.

  • Describe the signal a little better.  I'm unclear what an "analog pulsed signal" means.  Is it basically either (around) 0 v or +2 v?  Is it "low" most of the time, then pops "high" for some (unknown) amount of time?
    1. The signal is from a sensor that measures pressure changes in a cylinder the higher the pressure the higher the peak of the signal coming out of the sensor, I will include a trace of an average signal.
  • When you say "repeats every 125 msec", what does that mean?  Is 125 msec an "exact" or "approximate" number?
    1. 125msec is an exact number as the cylinder spins at 450 rpms
  • I assume you know the difference between the Peak Detector (which takes a waveform, i.e. many equally-sampled-in-time values and finds the peak in the sample) and the PtByPt version, which takes "the next point" and asks "Is this a peak"?
    1. I am still learning the different technical terms and what I have learned from others before me they always called it a peak detector, I apologize that my wording my not be correct and thought this was the way to go as I am looking for the peak of the signal so I can measure it.
  • I notice you are sampling at 1.25kHz and taking 125 samples.  This seems weird to me.  I generally stick with "rounder" values, like 1kHz and 100 samples (the math is easier).  Is there any relationship between the 125 samples and the "125 ms repeat"?
    1. the 125 samples was testing in relation to the 125msec repeat, as for the 1.25khz I was using that to seeing how it changed my data displayed on the graph.
  • With the sampling mentioned in the previous point, you get points every 100 ms, and can ask "Where, in the last tenth-of-a-second, is the peak, assuming there is a peak?"  Note that there will be an (unknown) delay between the time you know where the peak is and the peak itself.
  • If your Mystery Signal is a single pulse of width 1ms every 125 ms, then some of your samples of 100 ms will not have any peaks.  Is that OK?
    1. That would be fine as long as there is a threshold that I don't record the information as I don't want to skew the data.
  • How much LabVIEW code have I mentioned?  How many points deal with the "How" of your problem, and how many with the "What"?  Which is more important when starting out?  [Hint -- I have a colleague whose code I help to debug.  My first question is "What are you trying to do", and his answer is to tell me how he is doing something.  That's when I start yelling at him ...]
    1. I hope I don't frustrate you with all this and really do appreciate you taking the time to help me I wish I knew this better but unfortunately the only plc coding I have done over the last 6 years has been with OPTO 22.

 

 

Bob hope this information is what you were looking for and thanks again for the help.

0 Kudos
Message 3 of 5
(2,187 Views)

@ElectronicBlacksmith wrote:

Bob,

 

Thanks for the reply I really appreciate it and I will do my best to answer the questions that you have.

  • Describe the signal a little better.  I'm unclear what an "analog pulsed signal" means.  Is it basically either (around) 0 v or +2 v?  Is it "low" most of the time, then pops "high" for some (unknown) amount of time?
    1. The signal is from a sensor that measures pressure changes in a cylinder the higher the pressure the higher the peak of the signal coming out of the sensor, I will include a trace of an average signal.  Thanks.
  • When you say "repeats every 125 msec", what does that mean?  Is 125 msec an "exact" or "approximate" number?
    1. 125msec is an exact number as the cylinder spins at 450 rpms  Oh, boy, a Math Error.  450 rpm (not rpms) has a period of 133.33333 ms.  125 ms corresponds to 480 rpn.
  • I assume you know the difference between the Peak Detector (which takes a waveform, i.e. many equally-sampled-in-time values and finds the peak in the sample) and the PtByPt version, which takes "the next point" and asks "Is this a peak"?
    1. I am still learning the different technical terms and what I have learned from others before me they always called it a peak detector, I apologize that my wording my not be correct and thought this was the way to go as I am looking for the peak of the signal so I can measure it.  If your sample consists of an "entire waveform", just use the "ordinary" Peak Detector function.  Use the one found on the Signal Processing/Signal Operation Palette.
  • I notice you are sampling at 1.25kHz and taking 125 samples.  This seems weird to me.  I generally stick with "rounder" values, like 1kHz and 100 samples (the math is easier).  Is there any relationship between the 125 samples and the "125 ms repeat"?
    1. the 125 samples was testing in relation to the 125msec repeat, as for the 1.25khz I was using that to seeing how it changed my data displayed on the graph.  Another Math anomaly.  If you want your sample to be one period, then it needs to be ... one period!  If you are sampling at 1.00 kHz, then 125 samples will be 125 ms, which you say (but see the Math comment above) is the correct period of revolution.  If you are sampling at 1.25kHz, then 125 samples = (125/1250) s = 0.1 s = 100 ms.  100 != 125.
  • With the sampling mentioned in the previous point, you get points every 100 ms, and can ask "Where, in the last tenth-of-a-second, is the peak, assuming there is a peak?"  Note that there will be an (unknown) delay between the time you know where the peak is and the peak itself.
  • If your Mystery Signal is a single pulse of width 1ms every 125 ms, then some of your samples of 100 ms will not have any peaks.  Is that OK?
    1. That would be fine as long as there is a threshold that I don't record the information as I don't want to skew the data.  Fuzzy thinking.  What do you want to do?  Find the peak every revolution.  To do this requires (exactly) one revolution's worth of data.  Fix your sampling rate.
  • How much LabVIEW code have I mentioned?  How many points deal with the "How" of your problem, and how many with the "What"?  Which is more important when starting out?  [Hint -- I have a colleague whose code I help to debug.  My first question is "What are you trying to do", and his answer is to tell me how he is doing something.  That's when I start yelling at him ...]
    1. I hope I don't frustrate you with all this and really do appreciate you taking the time to help me I wish I knew this better but unfortunately the only plc coding I have done over the last 6 years has been with OPTO 22.then 

And I've never heard of OPTO 22 -- is that like Fortran, or Basic?  [I'm kidding -- you probably have never heard of Fortran or Basic ...]. 

 

Bob hope this information is what you were looking for and thanks again for the help.  You are most welcome.  Design first, document second, code last.  [Most people Code first, then spend many times the effort and time debugging, and never produce Documentation nor have a Design in mind].


Bob Schor

Message 4 of 5
(2,178 Views)

Bob,

 

Thanks and I feel like an idiot for missing that easy math problem thanks for the help. I will work on it more tonight and tomorrow hopefully I can get this figured out.

0 Kudos
Message 5 of 5
(2,175 Views)