BPM from analog input

Hi
We're currently working on a project and we got some issues finding the BPM when we connect the system to a NI USB-6009 for input.
The system works fine when we're simulating our signal, but the physical signal from a function generator connected through to the NI USB-6009 doesn't seem to work properly.
We've attached a little part of our system which describes this.
We appreciate any help you can give us.
Attachments:
NI BPM.vi ‏97 KB

BPM?  Beats per minute?  I haven't had an opportunity to look at your code, but will say that there is frequently (pardon the pun) a world of difference between passing a simulated signal into a program and what it might actually see when hooked to hardware. Look at the signal using the National Instruments Measurement & Automation explorer (MAX) that installed with your hardware/LabVIEW. It should allow you to see what is coming in and then you can compare it with the "theoretical" signal your simulation generated to see how they differ.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion

Similar Messages

  • How to get signal from analog input and send it to analog output (real-time​)

    Hi everyone,
    I am doing simple task in Visual C++ and I am using PCI-6221(37 pin).
    Basically, I want to send same signal from 'analog input' to 'analog output'
    at the same time (almost), to make it real-time application.
    Can someone please provide me sample program. 
    I would appreciate if you could provide me with the good tutorial which explains
    step by step everything about programing NI-DAQmx for C/C++.
    Best Regards,
    Khassan
    Solved!
    Go to Solution.

    This is my code in C++, you can optimize it if it looks too messy. This code reads signal from analog input and outputs it through analog output. 
    To make this code work additional  include directories and library directories must be added from NI.
    I hope it helps someone.
    #include <stdio.h>
    #include <conio.h>
    #include "NIDAQmx.h"
    #include <math.h>
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    int main(int argc, char *argv[])
    int32 error=0;
    TaskHandle taskHandleRead=0,taskHandleWrite=0;
    int32 read=0;
    float64 dataRead[1000];
    char errBuffRead[2048]={'\0'};
    char errBuffWrite[2048]={'\0'};
    bool32 done=0;
    int32 written;
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleRead));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleRead,"Dev1/ai0​","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Vo​lts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleRead,"",100.0,DAQ​mx_Val_Rising,DAQmx_Val_ContSamps,0));
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleWrite));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleWrite,"Dev1/ao​0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleWrite,"ai/SampleC​lock",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1​000));
    DAQmxErrChk (DAQmxStartTask(taskHandleRead));
    DAQmxErrChk (DAQmxStartTask(taskHandleWrite));
    while( !done && !_kbhit() )
    DAQmxErrChk (DAQmxReadAnalogF64(taskHandleRead,1,10,DAQmx_Val_​GroupByScanNumber,dataRead,1000,&read,NULL));
    DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleWrite,read,0,10.0,D​AQmx_Val_GroupByChannel,dataRead,&written,NULL));
    _getch();
    Error:
    if( DAQmxFailed(error) )
    DAQmxGetExtendedErrorInfo(errBuffRead,2048);
    DAQmxGetExtendedErrorInfo(errBuffWrite,2048);
    if( taskHandleRead!=0 )
    DAQmxStopTask(taskHandleRead);
    DAQmxClearTask(taskHandleRead);
    if( taskHandleWrite!=0 )
    DAQmxStopTask(taskHandleWrite);
    DAQmxClearTask(taskHandleWrite);
    if( DAQmxFailed(error) ){
    printf("DAQmx Error: %s\n",errBuffRead);
    printf("DAQmx Error: %s\n",errBuffWrite);
    printf("End of program, press Enter key to quit\n");
    getchar();
    return 0;

  • [newbie] Video import from analog input

    Hi all,
    Is there some device where we can import at higher resolution from analog input?
    http://www.elgato.com/video/video-capture
    Video Capture | elgato.com
    Info: Video resolution: 640×480 (4:3) or 640×360 (16:9)
    Video format Mac Software: H.264 at 1.4 MBit/sec or MPEG-4 at 2.4 MBit/se
    and this is old firewire and s-video.... what about usb 3.0?
    http://www.grassvalley.com/products/advc110

    What higher resolution analogue format are you referring to?
    Russ

  • How to read data from analog input and export it to a file using Components Works

    I've made a simple application (Delphi 5 using the activeX) that read data from analog input channel 0. After I read the data, I want to export it to a file using the Components Works on a 6035E NIDAQ. (I'm not using labview and don't want to use it)
    How can I do that???
    Regards,
    Francis

    Here's a sample code to do this...
    P.S.: If you read only one channel this code won't work.
    function MyFunction: Integer;
    var
    Low, High, i, j, ChannelCount, RowCount: Integer;
    Po: P;
    begin
    //you are reading multiple channel
    ChannelCount := VarArrayHighBound(Buffer, 1);
    RowCount := VarArrayHighBound(Buffer, 2);
    for i := 0 to ChannelCount do begin
    for j := 0 to RowCount do begin
    WriteToDisk(Buffer[i, j]));
    end;
    end;
    end;

  • Labviewcode wanted to count pulses from analog input

    Can somebody help me with the following problem?
    I don't have a Data Aquisition board so I use my steppermotor controller, the MID-7604, and it's analog input to read from a
    sensor (photointerrupter) which outputs 0 or +5 Volts. I want to count how many times an output of 5 Volts appears.
    The problem is that the signal is not a Waveform, so  the Daq functions in Labview won't work. I've tried to generate a waveform
    from the signal but also no results.
    What I have created now is a counter which counts every signal above an adjusted value. The problem is that it counts on and on
    when the signal is above the value, I want it to count one time. (like a trigger which detect a low to high level signal)
    In the attachment you see that program and an other I've found (event counter) doing what I want, but I haven't been able to transform it in to
    my own problem. Please help me on this because I'm stuck right now.
    Thanks in advance
    Message Edited by Trabuca on 07-04-2005 02:56 AM
    Attachments:
    monitor ain pulses with display.vi ‏31 KB
    Event_Counter.vi ‏39 KB

    Hi,
    there are some ways - one is using a shift-register.
    Attached is a flank detector - each time "Boolean" changes from 0 to 1 or 1 to 0 the count is increased by one.
    I hope that helps
    Greez
    Stefan
    Message Edited by mycroft on 07-05-2005 06:41 AM
    Message Edited by mycroft on 07-05-2005 06:41 AM
    Attachments:
    Change detector_LV.GIF ‏9 KB

  • How to trigger from analog input channel

    I am using a BNC-2110 into a 6062E card. And I am sure this question has been posted several times but I was unable to find a clear answer. I am trying to use the devices ai0 channel as my trigger source. I tried using a voltage source in the trigger reference, and that almost works but it only works for several loops before coming up with an error. If someone knows what I may be possiblely doing wrong or where to find this information, any assistance would be great.
    - there is always an easy way, but it is always the hardest to find

    Hey Henry,
    The BNC-2110 is just the connector block. What card do you have the is interfacing this block with your computer? (should be a PCI or PCI-express card). Are the GPS receivers outputting digital signals that conform to TTL compatible logic levels (are the signals 5V or 0V with no more than 1.6mA of current)? If they are outputting a digital signal, then you can send these signals into any of the PFI lines to act as a trigger (or to the trigger lines). 
    For example, if you would like to perform an analog acquisition each time the trigger hits and have an X series card, you can open up example finder (help»find examples...) and then open Hardware Input and Output»DAQmx»Analog Measurements»Voltage»Cont Acq&Graph Voltage-Int Clk-Retriggerable.vi. Then make sure your Trigger Source parameter is set to the same PFI line that you are sending your GPS signal to (on the BNC-2110, the trigger connections are really just PFI0 and PFI12, but these are common lines to use for triggers, but any PFI line will work). If you have an M series card, and cannot do retriggerable analog input, you can reference this example for how to use counters to workaround this limitation of our M series cards: https://decibel.ni.com/content/docs/DOC-6801
    If your GPS signal isn't digital, and is some arbitrary analog square wave, you can use an example like this: https://decibel.ni.com/content/docs/DOC-4657 to use the analog value to trigger you're reading (you just need to set the appropriate window for your analog signal in the VI).  I hope this helps!
    -Nathan H
    Software Developer
    National Instruments

  • How do I acquire multiple signals in the NI cDAQ 9172 using 2 analog input modules?

    Hi everyone,
    Is anyone familiar with using the NI cDAQ 9172?  This is my first time using it and I am not sure what exactly I am doing wrong... Alone with a NI 9233 analog input module, it works great.  I can grab my 4 signals from each channel and go.  However, when I add another analog input module to the mix, it gets an error.  It looks like it is reading only one and not the other.  It bombs at one of the DAQ start task and read task.
    Basically, the block diagram is just a double of the one 9233 working alone.  Is there something needed for input to make the 9172 working?  Any ideas?
    Any help is much appreciated.  Thanks!!

    Hi Jud,
    Both threads are correct.  The cDAQ-9172 has a single analog input timing engine, so both of your analog input modules will need to be in a single task.  The other VI you referenced shows one analog input task (with channels added from two modules) as well as an analog output task.  Analog output has a separate timing engine from analog input, so both of those can run in parallel independent tasks.
    The beginning of this thread is a good example; a single DAQmx Create Task followed by a DAQmx Create Virtual Channel for channels from each module.  Also, Getting Started with NI-DAQmx will give you the fundamentals for data acquisition, though I don't know how many of their examples use CompactDAQ.
    Regards,
    Kyle

  • I am getting a -50101 error when trying to get analog input from a compact rio

    I am just doing the initial setup of my compactRIO system and have been able to successfully add the cRio in Max and then into a new project.  I created a very simple VI with analog input that I am trying to read into an indicator, following one of teh tutorials.  The module I am reading the input from is a cRio-9201.  The input is voltage.  I have already added the module to teh project under the FPGA, which is under the RIO in the project tree.  Any ideas what I may be missing would be greatly appreciated!
    Thanks

    The 9201 C Series module needs to be created under the FPGA Target
    (cRIO-910x) in the LabVIEW Project. You can either discover the module
    or create it by type. In case you haven't created the FPGA Target
    (cRIO-910x) under the cRIO Controller (cRIO-900x), you must do that
    first. You also have the option of discovering the cRIO-910x or to
    create it by type. I suggest you do it through discovery, so you don't
    need to manually configure the addresses.
    As how to create the items, that's done through right-click on the
    cRIO-900x and select New>>Targets and Devices.... It will pop up
    a dialog in which you expand FPGA Target and it will discover the FPGA
    Target. Similar steps are followed to create the 9201 module.
    If you don't see the FPGA Target and C Series module options, then you
    need to make sure NI-RIO 2.0 is installed in you computer.
    JMota

  • How to synchronize analog input and output from two different USB daq boards

    Hi all,
    I have two very differnt USB boards the NI USB 6008, which I am using to acquire the data (Analog Input) and a NI USB 9263, it is an Analog Output only board that I am using to deliver a signal (in this case a square pulse). The reason why I am not using the 6008 Analog Ouputs is because I need to deliver negative voltages and need the full +/-10V range.
    Looking at similar posts I am pretty sure that I can't use an external trigger or a shared clock, I also tried to use the synchronization of timed structures but no cigar.
    I am including a quick vi that I whipped out showing how the signal jitters due to the lack of synchronization. The AO from the 9263 connects to the AI in the 6008 in this example.
    Solved!
    Go to Solution.
    Attachments:
    Test Pulse.vi ‏117 KB

    I talked to a specialist in the phone and tols me that it is not possible.

  • Can I read more than 2 analog inputs from myDAQ?

    Hello, 
    I am trying to read 3 voltage values. However, the myDAQ only has 2 analog inputs.
    There are multi-meter ports in the myDAQ as well. Could I read the 3rd value via this port?
    How would I read these values via the DAQ assit on labVIEW?
    Thanks in advance. 
    Yzhi 

    Hello Yzhi,
    You can acquire from the DMM and the analog inputs using two parallel tasks. The simplest way is to configure one DAQ Assistant for the AI channels, and another DAQ Assistant for the DMM channel. Be aware that the DMM is a software-timed single-point measurement (no hardware waveform acquisition), so you can't tightly synchronize the DMM with the Analog Inputs.
    Here is a screenshot demonstrating how to acquire from all three channels. You could also run the DMM in a separate loop so it doesn't slow down AI.
    Good luck and let us know if you have any other questions.
    Charles Y.
    National Instruments
    Attachments:
    myDAQ acquire two AI and DMM.jpg ‏196 KB

  • Analog inputs no longer working on Audigy 2 ZS Platinum Pro's external dr

    I have an Audigy 2 ZS Platinum Pro. After two years of use without problems, the analog inputs on the external dri've have stopped working. I get no signal from them, not even noise. All 3 inputs are silent, Line in / Mic and Line 2 in the front, and Line 3 in the back. Otherwise the dri've appears to function normally - I get output from the headphone jack, and the volume control knob works. I have not tested digital inputs or outputs, as I currently have no digital devices to connect to them.
    I had made no major changes to my computer - software or hardware - when the problems began. I recently added a new SATA hard dri've, but the Audigy dri've did work after that.
    I've taken steps suggested in another thread on this forum and uninstalled all Creative software and drivers, used the latest driver package's uninstall program as well as Driver Cleaner, and finally manually deleted everything related to Creative and Audigy from the system registry (and rebooted quite a few times in between). I then installed the original drivers from the CD that came with the sound card (a setup that has worked before), but still the problem persists.
    Any ideas on where to even begin looking for a solution? I find it hard to believe that it's a hardware problem, since three inputs suddenly went silent at the same time, and no other connections were affected. Yet I've done as clean a reinstall as possible, and that hasn't solved the problem.
    My current computer configuration:
    OS: Windows XP Pro (SP2 and all latest updates)
    CPU: Athlon XP 500+
    RAM: 2x 52 MB
    Motherboard: Abit AN7 (integrated sound chip disabled)
    Video card: Sapphire Radeon 9800 Pro
    Network card: D-Link DFE-530TX
    Hard dri've : Seagate ST320026A, 20 GB IDE
    Hard dri've 2: Maxtor 6L080J4, 80 GB IDE
    Hard dri've 3: Seagate ST330083, 300 GB SATA-II

    I don't have a Platinum Pro or the dri've, but a general hardware troubleshooting step I would take would be to remove the soundcard and either move it to another slot or re-seat it. Also, I'd disconnnect and reconnect all cables to and from the card and the dri've. If I had another machine I could try the card or dri've in, I'd do that. If I could borrow another dri've or even another card, I'd test those too. (Swapping parts is often the simplest diagnostic.) Yeah, maybe it's not a hardware problem, but I'd take these steps just to rule out some possibilities.
    Edit: And if you can remove or disconnect the SATA dri've and restore the system to the condition before you installed it, that's another good test.Message Edited by Katman on 2-8-2005 2:56 AM

  • How do I use the analog input (ADC) to drive a motion profile in MAX

    We are trying to use an anolog input signal from a DAQ card to control the motion contol axis.  For now, we want the motor speed to follow a sinusoidal voltage waveform, and later on, we will be using a more complex velocity profile. 
    In order to accomplish this task, we have searched the user forum, and found information suggesting to operate the servo motor in 'slave' mode under the 'gearing' option.  Therefore, we have set the Gear Master to 'ADC Channel-1', Mode set to 'absolute', Gear ratio 1:1, and provided the sinusoidal voltage (+/- 5V, 3 Hz) to the AIN1 connector on the MID-7654 controller.  When using the 1-D Interacitve 'single axis' control panel, the motor runs at constant speed in one direction only.  It does not react to the sinusoidal speed profile request as we expected. 
    How do we 'turn on' the 'slave' mode in MAX?  Please talk us through the necessary steps and settings?  Thanks.
    Staffan

    Staffan,
    you can configure and enablethe Gearing mode in MAX and it should be activated after saving the settings and initializing the board. In 1D-Interactive you can't use Gearing. For better flexibility I recommend not using MAX for configuring and enbling Gearing. You better should do this in your application.
    In fact there is a perfect LabVIEW-example that ships with the NI-Motion driver (Master Analog Input - Slave Axis Gearing.vi)
    I hope this helps,
    Jochen Klier
    National Instruments
    Message Edited by Jochen on 10-02-2007 08:37 AM
    Attachments:
    gearing.jpg ‏162 KB

  • Synchroniz​ing two counter frequency inputs with multiple analog inputs

    Hello all,
    I'm fairly new to LabVIEW and I'm trying to collec​t data from multiple sources with synchronized tim​ing on the acquisition but I'm having trouble figu​ring it out. My problem is that I've got two count​er frequency inputs, one optical tachometer readin​g one pulse per revolution, and a max machinery fl​ow meter with a k factor of 12000. I can't seem to​ figure out how to sync the timing with my multiple analog inputs. I've be​en attempting to get the tachometer  to sync with ​the analog inputs first by following the example l​inked here. (https://decibel.ni.com/content/docs/DOC-10785) So far each time I run it I either get a timeout e​rror on the DAQmx read or a "Multiple sample clock​ pulses were detected" error (see attached image).  It seems if I slow the sampling rate way down to ​say 10 hz and ensure that the tachometer signal is​ over 800-1000 RPM (13-17 Hz) before starting the VI then the program will run without errors until ​the RPM drops below that threshold then the "Multi​ple sample clock pulses" error occurs.  The code is attached below.
    Does anyone know of a more effective way of syncin​g counter frequency inputs with analog inputs?  I'd like to have a VI that can show 0 RPM (and ev​entually 0 flow as well, but I think I need to fig​ure out the timing of one counter before I add ano​ther as it seems I can't have two counters in the ​same task). Any help on this would be greatly appr​eciated.
    LabVIEW version 13.0
    cDAQ-9178 Chassis with NI 9401 for the two counter inputs and NI 9205 for the analog inputs.
    Thanks!
    Richard
    Solved!
    Go to Solution.
    Attachments:
    SimpleDAQ.vi ‏44 KB
    LV_Error.JPG ‏31 KB

    Maybe third times the charm? 
    So I've finally got a good handle on why the VI is having problems at low RPM though I'm somewhat embarassed how long it took me to do that
    Because I have the counter time synced to my Analog input task if it doesn't see at least two pulses between the two clock pulses set by the analog input task I get the -201314 "Multiple sample clock pulses" error. This seems fine at first as it just sets a minimum RPM that I can measure and it's well below the area I'm interested in so no problems there.  I tried a simple error handler that would clear the error when it happend assuming the loop would keep iterating until the RPM went above that minimum at which point I would get a signal again. This is not the case, the read function just continues to spit out the -201314 error even after the RPM is back in the readable range. So then I tried adding two case structures so that when the error occured it would stop the task, clear the error, and then start the task again on the next loop iteration (Code Attached). This also doesn't work as the error shows up again on the stop task and then AGAIN on the start task on the next loop iteration. It seems this error is not actually being cleared and once it happens it stays with the task regardless of what the error cluster is carrying. 
    Anyone have any ideas?  The only solution I can think of is to just clear all tasks and recreate them each loop iteration until the RPM is readable again but that strikes me as a horribly clunky solution.
    Richard 
    Attachments:
    SimpleDAQ_1_Start Stop.vi ‏48 KB

  • Audigy 4 Pro Hub Analog inputs problem

    &Analog inputs in Audigy 4 Pro external hub seem to be unsupported in Windows 7. Am I wrong?
    I installed latest drivers, set mixer to monitor sound from line in, also tryed win ASIO, but I am unable to get any sound from Line in/Mic in.
    Please help me clarify this issue, I?ve been trying to find an answer through different forums for hours! Thanks

    Issue solved... line in /Mic is now working. Audigy 4 pro analog input is supported using latest windows 7 drivers.

  • Analog Input and Output in One Single VI

    I need help in setting both analog input and output in one single VI. How do I assign channels to be either input or output? How do I simultaneously uses both in one single VI with a while loop structure?? Which AO am I suppose to use to obtain signal from the function generator I have built to feed into the DAQCard-1200?? Help!!
    Attachments:
    Test1.vi ‏48 KB

    One thing you'll need to be aware of is that you will need to DMA lines: one for AI and one for AO. If you don't, then you can configure the DAQCard to do without DMA using the Config VI. But you certainly can do this.
    As far as your function generator, you will want to do a buffered analog output. You will write your buffer of points to the buffer, and then tell NI-DAQ how fast to update your analog output channel with these values.
    So, you can be reading from AI and checking the AO process in the same while loop. Just make sure you handle the while loop execution (the wait it exits) correctly. This can get tricky when you're doing two types of measurements.
    J.R. Allen

Maybe you are looking for