Digital outputs while sampling analog inputs

I am currently developing a program using LabView 2012 SP1.  I am interfacing with a NI USB-6009 DAQ using NI-DAQmx 9.5.5f4.  I am attempting to acquire a voltage reading on three analog inputs (AI0, AI3, and AI4) at 1 second from startup and at 20 seconds from startup.  The three digital ports: P0.0, P0.1 and P0.2 are used to turn on transistors for the signals in question and must remain high during the ~20 seconds the readings will take place.  I have figured out how to acquire 20 samples over 20 seconds on the analog inputs but have trouble with the digital outputs.  The DAQ assistant is not a good option and the USB 6009 has limitations that are not necessarily covered in the example code im finding.  Basically I need to turn on (write hex 7) to port P0.0-2, acquire my analog samples for 20 seconds, then bring port P0.0-2 low and end the program.  Can anyone help walk me through this?  Thank you in advance.
RJ
I surf therefore I am....

Solved it.  See attached vi.  
I surf therefore I am....
Attachments:
Level.vi ‏69 KB

Similar Messages

  • Send counter/digital outputs while acquiring analog data

    Hello all
    I am looking to acquire analog inputs on several channels, and send single TTL pulses out at different times during acquisition using a UBB-6221 board.  The delays from the beginning of acquisition and the output of the TTL's should be handles by a control on the front panel.  I have gotten this to work using software timing and an inexpensive board before, but the program needs to be more accurate than this (hence hardware timing).  I am writing the program using LabView 8.2 and DAQmx, but if needed, I have 8.5 available as well.  I am plenty familiar with the general LabView program, but am not comftorable with DAQmx, which I assume I need to use (I have only really used the Assistant).  If there is an example of this somewhere, or if someone has done this in the past, I would really appreciate the help!
    thanks!
    Solved!
    Go to Solution.

    Hi LVhelpME, 
    There are a number of different ways to
    do this, but I created a quick method which makes a digital waveform
    with the requested number of samples and rate, and then allows you to
    specify at what time you want to insert a "trigger" (which basically
    means it will place a high in at that point in the waveform). I did this
    by using only 3 functions and a for loop which iterates depending on
    how many triggers you wish to insert. You can use a similar method or just make this code into a subVI that will create your correlated digital data according to total number of samples, sample rate, and what specified times you want the triggers to occur at. I have attached the VI below for LabVIEW 8.0 and later, as well as a screenshot showing what the digital waveform will look like based on what values are entered for trigger times. In the screenshot below, you will see that there are 2000 total samples which are output at a rate of 100 Hz. Thus, the total waveform will last for 20 seconds, and the trigger times are entered as 5, 10, and 15 seconds.
    The next image shows a zoomed in view of the trigger that is created at the 5 second mark, which will last for the sample period of 0.01 seconds (period of 100 Hz sample clock).
    Hope this helps,
    Message Edited by dansch on 11-22-2008 04:24 PM
    Daniel S.
    National Instruments
    Attachments:
    CreateTriggerLine.vi ‏19 KB
    FrontPanel.png ‏57 KB
    FrontPanel2.png ‏36 KB

  • Error 10800 while testing analog input PCI-4451

    I'm testing the PCI 4451 device under Windows 2000 and with NI-DAQ 6.9.2 (with Max 2.2 french version)
    The analog output work properly but the input doesn't seem to work. I have tested with a GBF. I have also tested by connecting directly the analog output on the analog input and generating a 50KHz signal at 5V but it doesn't work. It always return an error 10800 (timeOutError). I haven't select any trigger. It display a graph with 1 or 2 peak an the beginning but all others samples have the value 0 in the graph. So the graph seems like a constant value of zero exepts the 1 or 2 peak.
    I've tried a lot of combinaison and nothing work. :-(
    configuration of the NI PCI-4451 :
    IRQ : 19
    DMA : 0, 1 and 2
    AI : +/- 10V
    differential
    AO : bipolar
    Accessory : BNC-2140
    PS : I've translated from french so there could have some mistakes.
    Is there anyone who have an idea ? (or others tests I can do ?)
    pcb

    Vous adoptez la bonne demarche - Si la carte ne "repond" pas dans MAX, ce n'est pas la peine d'aller plus loin.
    Ce que je vous conseillerais de faire :
    1- Aller dans le panneau "proprietes" et choisissez "tester les ressources" - cela vous permettra de savoir si la carte repond aux commandes du driver.
    2-Si oui, lancer les panneaux de tests et generer un signal de 1 khz avec un GBF (en gardant la frequence d'echantilloonnage par defaut de 51200S/s)
    Si vous obtenez un warning "10800", essayez de fermer le panneau de test (cela va envoyer une commande de "reset" a la carte puis relancer le panneau de test immediatemment apres)
    Le seul cas de figure ou j'ai pu rencontre ce comportement etait apres avoir synchronise plusieurs car
    tes 4451 - Les lignes des cartes "esclaves" n'ayant pas ete remises a zero apres coup.
    Je doute toutefois que vous soyez dans ce cas de figure.
    2bis- Si le panneau "tester les ressources" vous renvoie une erreur, cela signifie que la carte ne recoit pas les commandes du driver.
    Le plus simple dans ce cas etant probablement d'eteindre votre PC et de placer la carte dans un emplacement PCI different. Au redemarrage, de nouvelles ressources seront affectees a la carte et cela permettra eventuellement d'eliminer les conflits potentiels.
    Si aucune de ces deux methodes ne vous apporte un resultat, je crains que vous ne deviez contacter votre agence National Instruments pour proceder a un remplacement de cette carte.
    J'espere que ces informations vous seront utiles.
    Gerald

  • Control analog output based on analog input

    Dear forumers,
    I am pretty new to the labview programming so excuse me if this was posted before.
    I use: Labview 8.5 + PCI 6229
    I want to create a real time feedback: to control analog output based on analog input. The task is very simple - if the ai1 (analog input 1) voltage is larger than a constant, then decrease the voltage of the ao1 (analog output 1) by a constant. Otherwise increase the voltage of ao1 by the same constant.
    All should work for 10 seconds.
    I have tried to implement this using 2 daq asistants and various methods. The problem is that I get the whole signal recorded from the ai1 ( 10 seconds) and then modified and released to the output (another 10 seconds). The execution takes 20 seconds instead of 10 and it is not realtime at all.
    Is it a must to make vi in "run continuous" mode to make it work ?
    Please help :}.
    I am attaching 2 examples.
    1. Main idea what I am trying to accomplish
    2. Very simple example that still does not work in real time simultaneously.
    Attachments:
    example-main.vi ‏180 KB
    example-simple.vi ‏147 KB

    nooto wrote:
    Thank you for your suggestion.
    I understand the simple arithmetic you are talking about. However I do not understand why it takes 20 seconds instead of 10 to complete the task. In other way to say - why it reads the whole input first (10 seconds) then write the output ( 10 seconds).
    Why doesn't ir read and write simultaneously?
    If I use Elapsed Time function - what feedback response time can I expect ? Is it good to use Elapsed Time if i need fast response time? In my application i would I need about 1 milisecond response time. Currently in the example the rate is 50 Hz, later I would like to change the rate to 1000.
    You simply don't understand the underlying paradigm of LabVIEW -
    dataflow. You have a dependency between the first DAQ Assistant and the
    second. The second simply will not start until the first finishes. There
    is no way around that given your condition that the output depends on
    what you read.
    If you want 1 millisecond response time then you will have to swithc to a real-time OS. Windows does not have that kind of resolution and there is way to much jitter.

  • SB X-FI Titanium.. Digital output works but Analog Signal M.I.A.

    @SB X-FI Titanium.. Digital output works but Analog Signal M. I.A. Hi Guys,
    I recently installed a new hard dri've on my machine after my power supply failed and fried it. After reinstaling Vista 64 and my drivers I noticed that my sound card was not working properly.
    In.. control pannel > Sound > Playback I see my soundblaster listed but only the digital out is showing. There are two other icons listed.. one is for "Digital Output Device 2-High Definition Audio Device.. and one for a 3-High Definition Audio Device. I don't remember these being listed when my sound card was working properly before the HD crash.
    No icon representing my analog output (Left/Right, Center, and Rear?Speakers)?is displayed. I reinstalled the drivers, updated the drivers, reformatted my HD and started all over again but nothing works.
    I made sure that my motherboard sound card is disabled.. I am really stumped.. The sound card used to work quite well.. Has anyone else had this problem and been able to fix it's
    Here is my system info:
    Motherboard: Gigabyte GA-MA790FXT-UD5P (Realtek Audio Disabled)
    Sound Card: Internal Sound Blaster X-FI Titanium
    Any advice is much appreciated.

    DRe: SB X-FI Titanium.. Digital output works but Analog Signal M. I.A. High definition audio device is what your card is detected as until you install the original CD driver or the Daniel K 2.0 support pack. Then you can update to the newest Creative drivers. I tried to format just like you and thought that I would just download Creative's newest driver and start from there. No Go!!? The newest Creative driver seems to install, but then after reboot like you, I have multimedia audio device.
    So take out your CD if you have it, and run the driver setup only. Then using just this driver you can install all of the newer Creative updates. The Creative auto updater is installed along with your original driver and you will see it detect all available updates.
    Easiest solution of all,
    Try this pack and save yourself a load of hassle........
    http://forums.creative.com/t5/Sound-Blaster/SB-X-Fi-Series-Support-Pack-2-0-05-5-2009/td-p/527485
    This will install a very proper Creative driver, and applications that will work very very well on your system compared to the CD orignals

  • Create 4 digital output pulses base on input ttl signal

    Hi
        I am a beginner in Labview and would appreciate any advice on how to solve the following problem.
    I am creating a TTL pulse train, and would like to send that into Labview as input.  For every falling edge detected on the input signal, I'd like Labview to generate 4 digital output pulses.  For each output pulse, I'd like to be able to specify the delay, and duration.       The picture should illustrate it more clearly, with the numbers showing the intended order of magnitude.
    System:  NI PCI-6733 DAQ card, Labview 8.5
    My daq card has 2 24-bit timers, and 8 digital I/O but I don't know what the best approach is for creating between 4-8 output pulses of this precision..should it be handled in hardware, or in software?  And how would I go about it
    Thanks,
    -Sidney
    NI Hardware: PXI-7853R, PCI-5122, PCI-6733, PXI-1036, PCI-MIO-16E-4, PCI-6110
    Computer Hardware: Xeon Quad Core - 2.33 Ghz, 8 GB RAM
    Software: Labview 2009, Labview FPGA 2009, Vista 64-bit, MAX 4.6, DAQmx 9.0, NI-SCOPE 3.5
    Solved!
    Go to Solution.

     Hi Yann,
       Wow, thank you so much for this example!  I'm trying to take a look at it, but when I run it.. it responds with the following error message
    Error -200452 occurred at Property Node DAQmx Trigger (arg 1) in DAQmx Start Trigger (Digital Edge).vi:1->reprise-1.vi
    Possible reason(s):
    Measurements: Specified property is not supported by the device or is not applicable to the task.
    Property: Start.TrigType
    Task Name: _unnamedTask<49>
    This is strange too, because ive already used the Digital Edge Start trigger for a different application with this card.
    -Sidney
    NI Hardware: PXI-7853R, PCI-5122, PCI-6733, PXI-1036, PCI-MIO-16E-4, PCI-6110
    Computer Hardware: Xeon Quad Core - 2.33 Ghz, 8 GB RAM
    Software: Labview 2009, Labview FPGA 2009, Vista 64-bit, MAX 4.6, DAQmx 9.0, NI-SCOPE 3.5

  • What is the best way to Sync Digital Output(TTL) with Analog Output?

    I am trying to generate Analog waveform that synchronize the rising edge of a digital signal(TTL). The ttl will be used as trigger for camera. The board I have is USB-6343X. In my draft,  I used a clock as ttl so I can tune frequency easily. Could any one tell me what's the best way to accomplish such task? My draft seems working, but I hope there's more neat way. Thanks in advance for any help!
    Kind regards,
    Eric

    Hi Econg,
    You should be able to trigger your TTL output with the analog output by using the ao/StartTrigger as your trigger source on the counter task. You wouldn't have to have the extra Get Full Terminal Name.vi in your analog output task.
    Here is an example using your modified code. You will have to change the cDAQ1/ao/StartTigger to *your device*/ao/StartTrigger, but it should then trigger the counter output at the exact time when the analog output starts.

  • Is Digital Output worse than analog output in 5.1 set

    Hi, I've read in this forum (I don't remember where) that Digital Output doesn't sends 00% of sound, instead it reduces its quality by something (encode / decode) so I would like to know your opinions and if this is true or false?
    I have plans for using 5. sound.

    The sound card, as I said before, will send out DolbyDigital or DTS recorded on a DVD-Video. This is because the encoding process happend in the studio, at the making of the disc.
    Any other surround sound, created in your computer (like the games) will not be encoded surround on the digital out. That goes for X-Fi also.
    And Yes, the DD and DTS are compressed formats, but are waaay batter that any other compressed format. DTS in my opinion is the best, but occupies more space on disc (higher bitrate).
    The only uncompressed surround is the one on the SACD discs or the one on DVD-Audio (actually this is compressed but without loosing information, kinda like the zip files).
    There are sound chipsets capable of Dolby Digital encoding: one is the nVidia's nForce2 motherboards with SoundStorm (not in production anymore). This is the same chip used in XBOX (that has DD out).
    The others are some chips made by C-Media: CMI8768+ (only the PLUS variant) and CMI8788 (this has DTS encodin also). But the encoding is done software, and occupies some 0% of the processor time. Not really good...
    Message Edited by SoNic2367 on 04-2-2006 08:2 PM

  • Why do i get an offset while acuiring analog input

    HI all,
    I have posted the question before but no body replied to that. Plese tell me how to acquire analog input for example sine wave of 5volts pk-2-pk using analog channels. When i connect the wires and using a labview or visual basic 6.0 software, try to acquire the voltage then i do get a wave but that has an offset included with it. like the wave starts from 5 volts and goes upto 10 volts. So please help me out for this. I will be very much grateful to you.

    Hello shami81,
    There are several things that can be occuring for you to see the
    behaivior you are discribing. The most basic is that the signal you are
    inputting from your source has a DC offset. Assuming this is not the
    case, there are several other things that it could be.  If the device
    is wired with the incorrect grounding setup, that could cause an
    offset.  The way to check this is to use our Field Wiring and Noise Considerations for Analog Signals developer zone article to make sure everyting is hooked up correctly.
    In order to make sure that the code is not a factor, the best way to
    look at the signal is with Measurement and Automation Explorer.  If you
    open a test panel (My System»Devices and Interfaces»NI DAQmx Devices,
    then right click your device) that will allow you to see exactly what
    the hardware is seeing.  If this still has the offset, then we know
    that the issue is not with the signal analysis, but in the hardware or
    the actual signal.
    Many of our devices allow you to change the input coupling as well.  If your device has this functionality, then you could use AC coupling, which would remove the DC offset.
    In order to help narrow down the possibilities, some more information
    about your setup would be helpful. Specifically, information about the
    device you are using, the driver you are programming with, how you have
    your signal hooked up, which program are you using (example program or
    your own code), and possibly a screen shot of your code or what you are
    seeing would help greatly.
    I hope this gives you a starting point, please post back with that
    information if you still cannot find the source of the offset.
    Neal M.Applications Engineering       National Instruments        www.ni.com/support

  • How to trigger a TTL output with an analog input

    Hello,
    I have an apparatus for measuring the flame speed of various hydrocarbon/air mixtures.  The chamber uses central ignition as the means for igniting the mixture.  My goal is to film the ignition process with a high speed Phantom video camera.  I control the ignition with an analog output signal from a SCC-68 DAQ.  I would like to trigger the camera with the same signal that triggers the ignition sequence.  The camera is triggered with one TTL pulse so ideally I would connect the output analog voltage signal to an input analog voltage port that would be used to trigger a counter output that generates one pulse.
    I have a sample VI that triggers a digital pulse each time the analog trigger level is met and it works for what I am trying to do but I do not understand how the two channels are connected. I also can't figure out how to make the VI end after just one pulse.  In the VI the digital counter is supposedly triggered using the /Dev1/ai/StartTrigger slot on the DAQ but nothing is connected to this slot.
    I need to first figure out how to make the output_pulses_on_sine_wave.vi terminate after a single pulse is generated. Then I can try to incorporate it into the VI that I use to control the ignition and measure the temperature and pressure once the mixture is ignited.
    John
    Attachments:
    output_pulses_on_sine_wave.vi ‏27 KB

    I am using the USB-6259, sorry for the confusion.  I would be nice if I could trigger with an analog signal to the ignition system but it is controlled with a high voltage relay that operates when 12 volts are supplied to it. It really isn't a trigger as much as powering on the high voltage relay. To control it, I have a 12 V supply line that is switched closed using a SCC-RLY module.  Could I somehow connect the 12 V supply to one of the buses and use a digital trigger to supply the 12V on command to the high voltage relay?
    Thanks for the quick response. 

  • Application exe not displaying analog input measurements

    i am using the compactDAQ cDAQ 9172, after building the exe all the other digital and analog output ports are working properly whereas the analog input section is displaying the value as Zero, if i read read this channel from the max, it reads the values without any  errors.what might be the issues.

    Hi Kodeeswar:
    I have a couple suggestions first try to create your analog input application with no digital or analog output task just "analog input" and then build the executable and try it again; second if it is possible for you please try updating to the new drivers of (NI DAQmx), and third reinstalling the last version of the “labview run time engine”. Also the 9172 is the chassis so which module are you using to handle the Analog Input application? To synchronize multiple modules or chassis if this is your case these links might be able to help you so please take a look at:  NI CompactDAQ Module Synchronization,  Synchronized Continuous Analog Input Across. I hope I was able to help you.
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters

  • How to read back the output state for digital output or anlog output ?

    I use NI-pci 6221(68PIN) Accquistion card to do measurmet,after i do digital output ,or anlog output ,I find that the output will be maitained by the card.even after i exit my accquistion program.But if i reset the card ,the ouptut also will be reset.
    Now if i don't reset the card ,how can i read back the output state,?

    Hi Mike,
    There is no way for you to internally route an analog output to an analog input. The only solution is to physically connect the two lines together with a wire.
    I came to this conclusion through the following steps:
    1- Start MAX and select the DAQmx device under "Devices and Interfaces>>NI-DAQmx Devices" that you want to internally route signals through.
    2- Click on the "Device Routes" tab on the bottom of the right hand window (It defaults to the "Attributes" tab)
    3- Line up the Source with the Destination to see if the connection can be internally routed (either direct or indirect)
    I came to the above conclusion by following these steps for a PCI-6251 DAQ device (the analog output & input do not exist in the "Device Routes" tab therefore they do not support internal routing), but you should verify this for your specific hardware. Let me know if you have any other questions/concerns.
    Cheers,
    Jonah Paul
    Applications Engineer
    National Instruments
    Jonah Paul
    Marketing Manager, Embedded Software
    Evaluate the LabVIEW RIO Platform! - ni.com/rioeval

  • MyDAQ, Increase Digital Output?

    Hi y'all,
    I'm currently working with a myDAQ trying to trigger three 3V relays through the digital outputs. My main problem is instead of giving me 5V when triggered, the digital outputs are only giving me ~2V since they can turn on an LED, but they don't switch my relays. Is there any way to increase the voltage coming from the digital outputs?
    I've tried using the analog outputs instead (since they can put out 10V), but can't seem to get those to work the same as the digital outputs. I essentially just want to press a button and the output to send a steady voltage >3V and then turn off once I press the button again. I got this to work with the digital outputs, but the analog outputs throw me buffer errors and other input errors I can't seem to fix.
    I'm a beginner to LabVIEW and myDAQ and would appreciate any help! Thanks!

    Hello SNorrell,
    According to the myDAQ's specifications, each DI/O line can source a maximum of 4mA, which won't be enough to drive your coils unless you use multiple outputs to drive each.  I don't recommend attempting that. 
    Depending on how many relays you need to use, however, it's likely that you can get a few to work without additional hardware by using the built-in 5V supply line to drive the lines and grounding them at the DO.  Invert the logic on your digital lines so that they go low to turn on the relays. You'll need to account for power-up conditions and ensure your hardware doesn't toggle on or off unexpectedly when powering on the DAQ or the PC. You'll also want to ensure you're not driving too much current to the digital pins, refer to the documentation for current and voltage limits.
    Regards,
    Tom L.

  • Triggered and continuous analog input togeather?

    Hi,
    I have a program set up based off a shipped LV example involving digital triggering of the analog inputs. It looks at a pulse and reads in ten points from the rising edge continuously. It appears that we are missing some pulse triggers and only reading in 126 triggers/sec instead of 128. We double checked the pulse and the frequency is correct (128Hz) so it seems as if the LV program is missing some of the pulses. Therefore, I want to use another analog input channel on the same 6062E daq card to continuously read in the waveform and see which pulses are being skipped. Is this possible?

    Lisa,
    I don't believe the E-series architecture will allow triggered and continuous analog input operations to occur in parallel. It is possible to set up different gains/input ranges but I'm 95% sure that the functionality that you are after isn't there.
    If you are looking to keep track of the number of pulse seen by your application you could consider the use of a counter to count the number of rising edges seen by the NI 6062E - basically daisy chain the pulse train to the trigger input and the GP_CTR Source pin of the counter you wish to use. There are a number of examples around that should help with this. Running the counter and analog input operations in parallel shouldn't be a big problem - it might be that you would want to set up a buffered event co
    unt operation for the counter as this will allow you to track and monitor every single trigger event seen by the counter while your analog input operations continue in parallel.
    The other aspect to consider is benchmarking your application with the Profiler. If the problem is that you consistently only see 126 triggers/second, perhaps your acquisition loop is not running fast enough to cope with the data. This can be especially true if any data processing or file storage is taking place inside the acquisition loop. The Profiler will allow you spot bottlenecks and get a better understanding as to the performance of your application.
    I appreciate this is perhaps not a direct answer but hope that it gives some ideas as to how to track down the cause of the problems you are experiencing.
    Jeremy

  • "Out of range" error at analog input

    Hello!
    I use a PCI 1200 card with Nidaq 6.6.0 and Labview 5.1 support files on Windows NT for data aquisition. My programm has one digital channel and three analog input channels. I didn't write the programm myself but bought it in 1999 together with an apparatus which delieveres all these signals. I have only a Labview Executable which runs with LabView Runtime Engine 5.1.1 and the daqdrv, the serpdrv and one .lrm file.
    The programm was running fine till the computer broke down. I had to reinstall the whole system and everything seems to work except the readings of the three analog input channels (one K-thermocouple and 2 times voltage). In the MAX the test panel says "out of range" for the channels. The digital channel (which is for switching valves in the apparatus) works fine!
    What can be wrong?
    - It's not the PCI card, I borrowed another one - it produces the same readings (And I tried all PCI buses in the computer)
    - The Measurement and Automation Explorer MAX recognises the card and the card passes the test.
    - I tried different settings like DIFF, NRSE and RSE, bipolar and unipolar but nothing changes for good.
    - The settings of my four channels were saved in the daqdrv, that's why I think the mistake is not in the channel settings, but somewhere else.
    I have checked the "Checking your board settings" support files from NI but nothing seems to help.
    Any idea from you will be much appreciated!
    Thanks a lot!

    Hello,
    You should update your NI-DAQ driver by downloading and installing the following links:
    http://digital.ni.com/softlib.nsf/websearch/50F49E43A22C0D2186256BF3006B9A96?opendocument&node=13207...  (choose the right one)
    http://digital.ni.com/softlib.nsf/websearch/E470663AFB8A9EDD86256D8800543B4B?opendocument&node=13207...
    I hope it will work after the updates!
    Regards
    Christian Mergl

Maybe you are looking for