Simultaneous Sampling using a DAQ BNC2110

Hey folks,
So I'm trying to take data from two different photo diodes plugged into a NI BNC2110 DAQ but for some reason it's collecting a specified amount of data from one channel then it moves onto the other. I'd like for these to be collected at the same time but cannot figure out how to do it.
I've attached my code as well as a sample of the data I've collected from a HeNe laser power fluctuation. After viewing the image you should see that Channel 2 is distinctly out of phase from Channel 0 whereas these should be directly in phase. Weird.
Any help would be appreciated.
Attachments:
Light Sensor Comparison.vi ‏68 KB
Phase Difference problem.PNG ‏82 KB

It's not at all weird since that is the way you programmed the acquisition. You have one task for one channel that you start and then stop and then you start/stop a task for a different channel. You need to have a single task with both channels specified in the physical channel constant and change from 1Chan NSamp to NChan NSamp.
p.s. You don't have any sort of loop. Please don't say you are using the Run Continuous button. If you are, stop doing that and place a while loop around the code you want to run. The code up to the Start Task and the Clear Task should be outside the loop.
Message Edited by Dennis Knutson on 06-15-2010 02:11 PM

Similar Messages

  • Simultaneous Control Using GPIB / DAQ

    I am working on a project that is a continuation of a previous project. It involves controlling the temperature and pressure in two vacuum chambers. The original project controlled only one chamber and the original code contained a number of global variables. In order to control the temperature and pressure, the LabVIEW code reads in values from a data logger thru the GPIB interface. To regulate the temperature/pressure, a DAQ card is used to control a heater and a series of pressure valves. The client wishes to keep the original code and is asking me to incorporate code to accomodate the second chamber. One computer will be running identical LabVIEW programs(with different global variables and sub-VIs), one to control each chamber.
    I am fairly new to LabVIEW and looking for a starting place or sample code that I can look at. I have duplicated the current code, renaming sub-VIs and global variables. The solution I have come up with so far is to have a VI that does all of the reading and writing, but I am unsure as to how the chamber LabVIEW programs will access it whenever a reading is needed or the temperature/pressure needs to be adjusted.
    If further explanation or the original code is needed let me know, and thanks in advance for any advice that can be offered

    Hi lrsantos,
    It's unfortunate that you have to maintain the original architecture of the code, because this type of application would most likely be better implemented in a single top-level VI with subVIs. However, if that is not an option, I understand.
    So, using notifiers you are able to easily transfer information between "independently-running" VIs. There is a very good example program on this (Wait on Multiple Notifiers.vi) that ships with LabVIEW. You can access this by going to Help->Find Examples->Search "notifiers". This actually does almost exactly what you are thinking about doing. You can make a 3rd VI that reads the information off of the USB port and then sends that information (via Notifier1 or Notifier2, depending on the chamber) to its respective VI. For example, one VI would be waiting for a notification (and data) from Notifier1 and the other VI from Notifier2. You could then process this information accordingly. Like I mentioned, this shipping example should show you exactly how to do this with the exception of 1 thing. If you are passing notifiers between top-level VIs, you will need to write the "notifier out" to a global from your 3rd VI and read it back into your 1st and 2nd VIs (to be passed to Wait on Notification functions).
    As far as priority goes, you won't need to do anything. The way that I described the "3rd" VI as operating is more like a Producer of data and the "1st" and "2nd" VIs act like Consumers. Therefore, the Consumer VIs don't ever really "access" the 3rd VI, they are actually sent data from the 3rd VI.
    Hope this helps!
    Travis H.
    LabVIEW R&D
    National Instruments

  • Need help to choose a DAQ for simultaneous sampling

    We need to choose a DAQ for simultaneous sampling. The restrictions are:
    a) 2 channels
    b) The signals on both channels are not continuous. A valid input on the channels is signaled by a falling edge in a third line that can be used as a trigger.
    c) The rate of these signals can be up to 50000 per second but they do not arrive in a periodic way.
    d) The timing:
    The trigger is a pulse of 600 ns
    The signals on the channels are stable 200ns before the leading edge of the trigger pulse and remain stable for 900ns.
    We have seen the PCI-6143 but we are not sure if it is the best choice.
    We have some questions:
    1) Does the 6143 fulfill the timing requirements ?
    2) Is it posible and easy to set the board to take one sample after the trigger ?
    3) Is there a better choice than the 6143 to solve the problem ?
    4) Can we solve this problem programming in VB or VC++ and using the software that comes with the board or do we need to buy extra libraries ?

    1) Does the 6143 fulfill the timing requirements ?
    Yes, the 6143 should fulfill these requirements. It has a 250 KS/s sampling rate per channel which should give you 5x oversampling at the 50 kHz maximum bandwidth you indicated. The minimum delay from the recognition of the trigger to the first sample on this board is 100 ns which falls within the 900 ns window.
    2) Is it posible and easy to set the board to take one sample after the trigger ?
    It's not clear to me whether you want to take a single sample after a trigger and stop or use the trigger as an external sample clock to acquire several samples at the rate of the trigger. In either case, it's possible and relatively easy to do so. The only quirk is that the minimum number of samples to acquire for a hardware timed acquisition is two samples. This means if you really only want one point after the trigger, you'll have to setup the hardware to acquire two samples and then throw the second one away in software.
    3) Is there a better choice than the 6143 to solve the problem ?
    This seems like a pretty solid choice for the application you described. However, you didn't mention what the amplitude of your input signals are. The 6143 has a fixed +/- 5 volt range. If this isn't sufficient, you'll have to provide signal conditioning or choose a board with a wider input range. Also, I'm assuming your trigger signal is a TTL signal. If it's an analog signal, you'll want to choose a board with an analog trigger circuit (the 6143 doesn't have an analog trigger). The PCI-6111 is a 2 channel board with a +/- 42 volt input range, an analog trigger, a 5 MS/s sampling rate, and will also meet all of your requirements. The only down side of the 6111 is that it is more expensive and is a 12 bit converter instead of 16 bit. The PCI-6120 has even more functionality than the 6111 and has a 16 bit converter at 800 KS/s. PXI has some more simultaneous offerings, but I'm assuming you want to stick with PCI. You can also check out some of our modular instrument offerings such as the PCI-5102. I'm not as familiar with the modular instruments, so you'll have to check out the specs for yourself. Whether there is a better choice or not is pretty subjective. That will depend on how much you're willing to spend for the features and specs you really care about. From the information you provided, the 6143 will be the lowest cost solution that meets the requirements you specified.
    4) Can we solve this problem programming in VB or VC++ and using the software that comes with the board or do we need to buy extra libraries ?
    The DAQmx driver provides interfaces to both of these programming environments at no extra cost.

  • 6602: How to use 8 counters simultaneously in C++ using traditional Daq for frequency measurement

    Hi Everybody;
    I'm new to Ni-DAQ cards and working on NI PCI-6602 Card in Borland C++, I should use Traditional DAQ for my project. Now I want to use all the 8 counters simultaneously for frequency measurement.
    1.Where should I connect my External signal, to source or gate, at present I have connected to source.
    2. How to set parameters and start the counters simultaneously, what are the parameters to be set for frequency measurement.
    3.How to start counting.(parameter settings)
    4.Should I set any PFI Lines or by default are they set to counters.
    status = GPCTR_Set_Application (1, gpctrNum, ND_SIMPLE_EVENT_CNT)
    status = GPCTR_Change_Parameter (1, gpctrNum, paramID, paramValue)
    iStatus = GPCTR_Watch(1, gpctrNum, ND_ARMED, entityValue);
    status = GPCTR_Watch (deviceNumber, gpctrNum,ND_COUNT, entityValue)
    what is the paramID in my case, Clear and appropriate answers would be very helpful and thanks in advance.
    Message Edited by Pavan K on 07-11-2009 12:38 AM

      I have made a program with LabVIEW 5.1 based on NI 6602, in which four counters were used.
      Counter 3 is used to generate pulses, which are directed to the gates of counter 0, 1 and 2. 
      The source terminals of counter 0,1 and 2 receive pulses, individually, to count how many pulses appear during the time interval of each gate pulse.
      The results are stored in a data file.
      In order to test its performance, only one signal of ramdom pulses is sent to counter 0,1 and 2.
      But I find that at the beginning the counts for the three counters are the same, but the following counts are totally different!
      What's wrong? And how to solve such a problem? Does it have something related with synchronization?
      Thank you very much!

  • Simultaneous sampling with a PCI-MIO-16XE-10 board

    Hello,
    I am using LabView with a PCI-MIO-16XE-10 board. I would like to make simultaneous sampling in multi channels. How can I do?
    Thank you for your help.

    Your question should be posted under "Measurement Devices >> Multifunction I/O" instead of "Real-Time DAQ" because the PCI-MIO-16XE-10 board is not a real-time device. The category "Real-Time DAQ" is reserved for 7030 real-time devices.
    The PCI-MIO-16XE-10 multiplexes channels across one amp and one A/D converter; therefore, it cannot perform true simultaneous sampling. Consider using the SC-2040 accessory, which has 8 simultaneously sampling differential amplifiers. Alternately, you can purchase a different board like the PCI-6110, which can perform true simultaneous sampling because it has individual A/D converters and amps for each channel.

  • Can you simultaneous sample multiple SCXI-1520 cards in multiplexed mode?

    Can you simultaneous sample multiple SCXI-1520 cards in multiplexed mode?
    In parallel mode, you can have all channels sampled and held, and then have each
    of your E or M series cards multiplex through each of the 8 channels of each card.
    This yields simultaneous sampling on all channels at a faster rate in this "SCXI-1520
    Parallel Mode" than you can derive from the "SCXI-1520 Multiplexed Mode."
    Does the "SCXI-1520 Multiplexed Mode" also provide the capability to Simultaneous
    Sample and Hold, all be it at a slower net throughput yield then the "SCXI-1520 Multiplexed Mode?"

    Hello,
    Thank  you for posting to the NI Forums! The SCXI-1520 User Manual does indicate the Simultaneous Sample and Hold can be used with Multiplexed Mode. Please refer to the last two paragraphs of page 69 and the first paragraph of page 70 for a better explanation. Hope this helps! Let me know if you have further questions!
    Message Edited by Margaret F. on 04-21-2009 05:25 PM
    Regards,
    Margaret Barrett
    National Instruments
    Applications Engineer
    Digital Multimeters and LCR Meters

  • How to detect Simultaneous Sampling on Device

    How do I detect SSH on a device using the DAQmx API.
    Or other method?
    -cpede

    Hello cpede
    I am not fully sure of what you actually are looking for. The only devices we have which supports simultaneous sampling are the S-series devices and the DSA boards.
    You can see if any of these boards are present in your system by using the system property and getting the device names and input the device names in the device property to get the product type. The product type will give tell you the name of the board as in PCI-6110.
    Hope this answers your question.
    Regards
    Mohadjer

  • PXIe-4499 simultaneous samples multi-modules

    Hello,
    I have three PXIe-4499 simultaneous samples modules in a PXIe-1082 chassis.
    I built a single AI voltage task which includes all the chnls on the three modules.
    Do I need to do anything special to ensure all modules use the same sample clock?

    Bert,
    Channel expansion is by far the easiest way to synchronize channels in DAQmx.  If all channels are in the same task they will share a sample clock and start simultaneously.  

  • SCXI 1520 Simultaneously sampling

    Hi there,
    for my application i need to read simultaneously all the channels from 2 SCXI 1520 modules. (2 x 8 = 16 channels)
    The control module will be SXCI 1600 and the  software  -  Signal Express. Is this possible ?

    Hello metrisys,
    I believe that it is possible to simultaneously sample from analog input channels on two SCXI-1520 modules that are controlled with the SCXI-1600.  PFI 0 of the SCXI-1600 is used to transmit the signal that triggers an acquisition for the SCXI-1520s.  You would need to configure the acquisition to recognize the signal from PFI 0 of the SCXI-1600 as the start trigger, and add all of the channels on the two SCXI-1520s to the scan list of your analog input task. For your convenience I've posted a link to a knowledge base article titled 'Synchronizing Multiple SCXI Simultaneous Sample-and-Hold (SSH) Modules.'  
     http://digital.ni.com/public.nsf/allkb/A01F8168AFCFE9DC86256B3300758CD0?OpenDocument
    Best wishes,
    Wallace F.
    National Instruments
    Applications Engineer

  • Simultaneous sample and hold

    Hello everyone,
    This is the hardware we are using our project and our labview version is 8.2
    NI cDAQ-9172
    NI-9025 Analog Input card
    I wasnt able to find any information if this current setup is capable of simultaneous sampling and holding.  Eventually, we want to monitor and control synchronous machines.  I'm new to labview and if this equipment is capable of simultaneous sampling and holding does anyone have a sample program to illustrate this.  from NI.com i did find some programs (thermocouples) that had "DAQmx create channel's" in paralled with eachother.  I wasnt sure if that layout executed simultaneous sample and hold.
    thanks in advance

    Neither the NI 9205 nor the NI 9211 are simultaneous sampling modules.  There are three analog input modules for CompactDAQ that support simultaneous sampling:
    NI 9215 - 100 kS/s 16-bit +/-10V
    NI 9233 - 50 kS/s 24-bit +/- 5V w/ AC coupling and IEPE excitation
    NI 9237 - 50 kS/s 24-bit for bridge sensors
    Please post if your application isn't handled by one of these modules.  I suspect the 9215 will be a good choice, since it supports the same voltage range as the multiplexed NI 9205 that you already have.
    Kyle

  • Can I use my DAQ on two different computers?

    Hi there.
    Sorry if this might seem like a stupid question but I'm trying to save money lol. I have two test stations, each station has it's own computer and power supply. The power supply powers a certain device and the computer communicates with it via an USB to RS422 serial converter. I am using the 2 analog outputs on my NI-USB 6008/6009 DAQ to control the 2 power supplies. AO 0 to control the power supply on station #1 and A0 1 to control the power supply on station #2.  I can control these 2 power supplies just fine with one computer connected to my DAQ. But i need each computer to be running tests independently. I only have 1 DAQ but 2 computers, is there way to use this DAQ on both computers???
    thanks for any help!
    Don't think twice.
    Solved!
    Go to Solution.

    No.  Because there is no way you can take one USB-DAQ and plug it into two computers at the same time.
    You would probably be better off having one PC that communicates with the USB-DAQ and have your application on one computer talk to the other computer to pass commands and get back data from the USB-DAQ, probably by way of TCP/IP.
    I would actually make an application that only handled the USB-DAQ operation.  Then have the program that runs on each computer be the same and talk to the USB-DAQ application which would act like a TCP/IP server.  The program that is on one PC would call the IP address of the other PC.  The program that is on the same PC as your USB-DAQ server would just call the local host to establish communication.

  • How do I use two DAQ cards in one Labview code? Current I'm getting error " error 200558 occurred at DAQmx Create Channel.vi. One task cann't contain multiple independent devices". Can someone help me?

    The two DAQ cards are NI PCI-6070E & NI PCI-6052E. The Labview I'm using is labview 7 Express and the Window system is Window XP. I'm using NI SCXI-1000 chasis and SCXI-1102 & 1102B two modules plus a feedthrough SCXI-1180. 1102 is connected through SCXI-1349 cable to DAQ card 6052E while 1102B is connected through SCXI-1349 cable to DAQ card 6070E. SCXI-1180 is connected to 6070E through SCXI-1349 adaptor on the back of 1102B.

    Sarah, thank you for replying my question. It seems that I'm making progress everyday (smile). I'm able to run the test using both daq cards in my code now. But as I'm moving forward, I'm getting new questions too. How do I use one STOP button to control both tasks and how can I save data into one single file?
    I attached my code here hoping you can get the specifics on my application by looking at the code. Thanks very much!
    Thanks.
    Attachments:
    DAQmx_Task_Example_plus_voltage_2.vi ‏416 KB

  • How do I find the ports a pre existing program used in DAQ?

    Hi all, 
    I am setting up a laser displacement sensor and trying to utilize a pre existing program that was created by graduate students before me. There are 4 wires coming from the laser displacement sensor that need to be connected to the DAQ but we have no information telling us where these wires are supposed to attach to the DAQ in order to run the pre existing program correctly. 
    Is there any way that we could figure this out? 
    Thank you for your help,
    mccutchen12c

    James, 
    Thank you for your help! Yes, we have looked at a couple different methods on how to tell if the information had been programmed by the previous grad students and we haven't had any success in finding that information. So I believe you are right in assuming its not documented.. We will do a better job of documenting for future grad students after us. 
    I have attached our code. Any insight you could give would be greatly appreciated!
    We have an Acuity AR200-6 laser displacement sensor with green, yellow, black and a wire that isn't wrapped that all lead to the serial port in the back of the computer and ground. We then have white, blue, orange and brown wires that do not have a location.. We did some research and the are as follows:
    white: laser disable
    blue: buttons disable
    orange: voltage output
    brown: voltage RTN
    We are starting to wonder if we are just not supposed to use the DAQ.. Can you confirm the connection is solely through a serial port? 
    Cheers, 
    Carley

  • How to control a digital output signal using the DAQ assistant?

    I am using a USB 6251 DAQ board and would like to control a switch. I am gathering airflow, pressure, and acoustic data on the same board (analog input) and would like the switch to trigger when the airflow value is within a pre-determined range. Finally, I would like to reverse the polarity of the switch (to off) about a second after the initial digital signal, all of which is during continuous data acquisition.
    I am able to actuate the switch only when pressing the "run" button in the DAQ assistant window. I am proficient with data acquisition but have never tried programming an output... Please help!
    Thanks!
    -a troubled researcher
    P.S. I am running LabVIEW 8.5 as well.

    blsmith4,
    You probably won't get the control of the digital port on your card by only using the DAQ Assistant. One of the following examples should provide you the functionality that you would like out of the box:
    Digital - SW - Timed Output (Simple)
    Digital - Continuous Output (More Complex)
    Continuous Write Digital Port - External Clock - Non Regeneration (Most Complex)
    Let me know if these work better for you.
    Best,
    Jason M.
    Applications Engineer
    National Instruments

  • Samples using UTL_FILE package

    hello;
    I would like to use the utl_file package: fopen, put_line ...
    can you send me some samples using this package.
    thanks to your help
    mam
    null

    declare
    T1 UTL_FILE.FILE_TYPE;
    begin
    begin
    T1:= UTL_FILE.FOPEN
    ('/u02/applmgr/10.7p161/eye/3.3.1/out','filename.dat','w');
    EXCEPTION
    WHEN UTL_FILE.INVALID_PATH THEN
    DBMS_OUTPUT.PUT_LINE('Invalid Path');
    WHEN UTL_FILE.INVALID_MODE THEN
    DBMS_OUTPUT.PUT_LINE('Invalid Mode');
    WHEN UTL_FILE.INVALID_OPERATION THEN
    DBMS_OUTPUT.PUT_LINE('Invalid Operation');
    end;
    UTL_FILE.PUT(T1,'PROD DATE ');
    UTL_FILE.PUT(T1,'PRODUCT ');
    UTL_FILE.PUT_LINE(T1,'INTEREST TYPE ');
    UTL_FILE.PUT(T1,'LEASE NUMBER ');
    begin
    UTL_FILE.FCLOSE(T1);
    EXCEPTION
    WHEN UTL_FILE.WRITE_ERROR THEN
    DBMS_OUTPUT.PUT_LINE('write error');
    WHEN UTL_FILE.INVALID_FILEHANDLE THEN
    DBMS_OUTPUT.PUT_LINE('Invald File Handle');
    end;
    END;
    mamoudou (guest) wrote:
    : hello;
    : I would like to use the utl_file package: fopen, put_line ...
    : can you send me some samples using this package.
    : thanks to your help
    : mam
    null

Maybe you are looking for