Multiple waveform generation on analog output channels

hi,
I am writing data on the two analog output channels on my PCI-6052E card.But AO write takes only one dimensional array of waveform data. How can I simultaneously output seperate waveforms on each of the analog output channels(say sine on DAC0 and square wave on DAC1)?

I've had a similar experience I believe.
I had to create the two waveforms with function generators, suck out the Y
values, then Interleave them into one array.
Basically, point one was the first point in waveform1 for Dac0, point two
was the first point of the second waveform for Dac1.
Then that gets wired to the output block where you tell it to scan both
channels.
Confusing as labview eh??
"shiv" wrote in message
news:[email protected]..
> hi,
> I am writing data on the two analog output channels on my PCI-6052E
> card.But AO write takes only one dimensional array of waveform data.
> How can I simultaneously output seperate waveforms on each of the
> analog output channels(say sine on DAC0
and square wave on DAC1)?

Similar Messages

  • How can I use two analog output channels simultaneously?

    I am using PCI6110 DAQ card. I want to run two separate VIs on one computer. Each VI output a waveform to one analog output channel. How can I do this simultaneously without interfering each other?
    Thanks

    Hi Stephen,
    This can NOT be done with two seperate VI's.
    The issue is in the hardware/driver.
    Your hardware has a clock that controls how fast updates to the AO occur. That clock can only have one value at a time. I will let your contemplate the complications that come up with two different clock settings being active at the same time (see below).
    So how do you work around this complication?
    You will have to develop a single VI that OWNs both output channels. That VI will have to accept start,stop,configure, etc commands from the two clients (what you will have to convert your existing VI's into). If you decide to place a restriction on the services you provide to the clients along the line of "only one sample rate at a time" you will be making your li
    fe much easier.
    If I was contracted by a customer to do what you have asked, I would try to combine the two existing VI's into one or simply buy a second 6110 and avoid all of the hassles. Both of these approaches would end up saving the customer money in the long run while freeing them of any restrictions that where established in order to develop the "server".
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • I am using an NI PCI 6024 E board device for an analog output application. Can I generate two independent waveforms, one on each analog output channel?

    I am using an NI PCI 6024 E board device for an analog output application. Can I generate two independent waveforms, one on each analog output channel? In attach I send a example of my vi to control one chanel, but i need to control both but with diferent waveforms.
    Is the vi correctly programed to this propose?

    Yes you should be able to do that. look at the signal generation examples shipped with LabView
    You can create a 2 D array, with each row representing a wave form per channel. The number of points of the wave form (per row of the 2 D array) represent the number of points in the output buffer
    The wave forms can have different amplitudes/shapes, and therefore they are independent in this sense.
    However, you need to set the update rate,which is the same for both channels. The update rate together with number of points per buffer determines the frequency of the wave forms. This means the two wave forms will have the same frequency.
    To have different frequencies, you need to have say, on wave form with one cycle per buffer, and the other waveform have 2 cycles
    per buffer. in a case like that the frequency of the second channels is twice that of the first channel, and so on
    The two wave forms are then not truly independent, they may have different amplitudtes/shapes, but related in frequency.

  • 2 analog output channels with different frequencies

    Hi,
    hope that somebody can help me:
    I created two physical tasks, analog output channels.
    I should give signals (triangle signals) to a scanner. The problem ist that I need these triangle signals with two different frequencies.
    I can create the signal with each of the task, but not together. Can I solve this problem somehow?
    Ah, and of course the 2 tasks should start together...
    Thanks for your help!!
    Telly

    You didn't mention the type of device you're using, so I'll assume it's a standard MIO. A typical MIO only has one AO timing engine, so you'll have to create one task for both channels and use a single update rate for the task. You will have to make the output frequencies different by passing different data for both channels.
    For example, let's say your update rate is 1KHz. The data for channel 0 is 1000 data points of a single cycle of a triangle wave. The data for channel 1 is 1000 data point of two cycles of a triangle wave. When you run the task, you will get a 1Hz triangle wave on channel 0 and a 2Hz triangle wave on channel 1.
    Good luck,
    Joe

  • PC able to detect all except for the analog output channel of my SCB-68 device.

    I would like to use the analog output channel of my SCB-68 device. I tried to locate the analog o/p using the wizard but still unable to detect. Why is that so?
    Any possible steps/procedure that i have missed out?
    Thanks

    Rezn,
    Aha, therein lies the problem. This was what I suspected, and thus my question as to which data acquisition card you are using. The DAQCard-AI-16XE-50 has analog inputs, digital I/O, but no analog outputs at all. So your card is working as it should, but it has no analog outputs.
    If you have the 2002 National Instruments catalog, you can see this in a table on page 231 (your DAQ card is the one on the bottom), or check this pdf file:
    http://www.ni.com/pdf/products/us/2mhw254-255e.pdf
    Your card is also called the NI6012E. Check out the small table on the first page.
    Mark

  • How do I configure 128 channels of DIO and 128 channels of Analog output with the availabili​ty of 3 pci slots

    I have only 3 slots of PCI or 4 slots of ISA bus, I want to configure with the minimum possible modules to attain 128 channels of DIO and 128 channels of analog output. This is inturn fed to the PCM (Pulse code Modulator). The cards will be placed in industrial PC.

    Associate Engineer-Marketing,
    Using just those 3 PCI slots you're not going to be able to get the 128 analog output channels. You will probably want to go either the MXI-3 (PCI bus extender) to a PXI chassis or E Series DAQ card to a SCXI chassis for such a high channel count system. Which analog output cards and which digital I/O cards you will want depends on your application. You will have to decide whether you will need static or dynamic analog output as well as whether you need clocked digital I/O or not. I highly recommend contacting our internal sales department at 1-800-433-3488. They are great at helping specify systems.
    Ames
    Applications Engineering
    National Instruments

  • NI-DAQmx VisualStud​io C++ 6 Single point analog output

    Specs: NI-DAQmx 7, VisualStudio C++ 6.0,  PCI-6722,8channel AO
    We have a very simple application: set a voltage (actually 6 channels) and keep it until we want it changed again, perform the change very quickly in response to an image capturing algorithm. So I don't need any waveforms or buffering.
    In this forum post http://forums.ni.com/ni/board/message?board.id=231​&message.id=3283&query.id=18094 you talk about an AOOnePoint example, but I get an error that the NI-DAQ driver does not support my device.
    I may need to use NI-DAQmx, but how? I would like to use something like AO_VWrite(,,), maybe for 6 channels in one call. But I can't find it in NI-DAQmx. It seems I need to setup buffers and frequencies. I have a working sample, but it seems a slow and certainly overkill of this simple application:
    // Link with \DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib
    #include "NIDAQmx.h"
    double[2] data;
    int taskHandleAnalog;
    int written;
    void Init()
        DAQmxErrChk (DAQmxCreateTask("",&taskHandleAnalog));
        DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleAnalog,"Device and Channel Info","",0,10,DAQmx_Val_Volts,NULL));
        DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleAnalog,"",1000,DA​Qmx_Val_Rising,DAQmx_Val_ContSamps,NUMBER_OF_AO_SA​AMPLES));
        DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleAnalog,NUMBER_OF_AO​_SAAMPLES,0,1.0,DAQmx_Val_GroupByChannel,data,&wri​tten,NULL));
        DAQmxErrChk (DAQmxStartTask(taskHandleAnalog));
    void SetVoltage( double voltage )
        data[0] = voltage;
        data[1] = voltage;
        DAQmxStopTask(taskHandleAnalog);
        DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleAnalog,NUMBER_OF_AO​_SAAMPLES,true,10.0,DAQmx_Val_GroupByChannel,data,​&written,NULL));

    Hi,
    It looks like you simply wants to output voltages on the analog output channels, but only wants one update at a time with no waveforms or buffering in DAQmx.
    As I'm sure you know there are really just 3 types of measurements.  Single Point, Finite, and Continuous.  Since you want a single value at a time it's just a Single Point operation.
    You can find DAQmx examples for single point operations in this path:
    C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog Out\Generate Voltage\Volt Update
    Simply place the DAQmx Write Code within a loop and you will be updating one value at a time, but multiple times when "we want it changed again".
    Dennis Morini
    Field Sales Engineer
    National Instruments Denmark
    http://www.ni.com/ask

  • How do I get an analog output signal from my PCI-MIO-16E-4 card?

    I need an analog output from 0-10 V to control the mass range on a mass spectrometer. Do I use the DAC0out channel to do this? The manual only talks about analog out (ao) channels. Is this the same as DAC0out and DAC1out? How do I set up the DAQ assistant for this process? I do not need a waveform, only a constant signal.

    Yes indeeded. The DAC0out and DAC1out are the analog output channels (ao0 and ao1).
    Simply follow the examples that ship with LabVIEW. You can also easily create code with DAQ assistant.

  • Using analog output in the background

    Hi,
    I need to use the analog output channel on a NI PCIe-6351 to play an audio signal, and while the signal plays i need make some changes the UI dialog box, is it possible for me to move the playing of the audio to the background and proceed with program execution?
    Here is a simple piece of code that explains what I'm trying to do: 
    #include<stdio.h>
    #include<stdlib.h>
    #include<conio.h>
    #include<math.h>
    #include<string.h>
    #include<memory.h>
    #include<wchar.h>
    #include "sndfile.h" //include file for the sound library
    #include "NIDAQmx.h"
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    float *fWavSample;
    SNDFILE *SoundFile;
    SF_INFO SoundFileInfo;
    int iNoOfSamples=0;
    int32 error=0;
    TaskHandle AOtaskHandle = 0;
    float64* AIOSample;
    char errBuff[2048]={'\0'};
    int32 fnCreateTask(TaskHandle *AOTaskHandle)
    int32 error=0;
    DAQmxErrChk(DAQmxCreateTask("", AOTaskHandle));
    Error:
    return error;
    int ReadWavFile()
    //Open the wav file for reading
    SoundFile=sf_open("sin_10s.wav",SFM_READ,&SoundFileInfo);
    //Check if file is opened sucessfully
    if (SoundFile == NULL)
    puts("File not opened");
    return FALSE;
    //allocate memory for the buffer that is to hold the wav data&colon;
    fWavSample = new float[SoundFileInfo.channels * SoundFileInfo.frames];
    iNoOfSamples = SoundFileInfo.channels * SoundFileInfo.frames;
    //Read data into the float structure that has been copied in
    sf_readf_float(SoundFile, fWavSample, SoundFileInfo.frames);
    //Allocate memory for the structure that is to hold the sound samples
    AIOSample = new float64[iNoOfSamples+660];
    //Copy wavefile data into the new float64 array (needs to be typecasted to float64)
    int i=0;
    for(i=0;i<(SoundFileInfo.channels * SoundFileInfo.frames);i++)
    AIOSample[i] = (float64)fWavSample[i];
    //After the float64 array has been filled, release the memory used by fWavSample
    free(fWavSample);
    return 0;
    int main(int argc, char** argv)
    DAQmxErrChk(fnCreateTask(&AOtaskHandle));
    //Create an analog out channel
    DAQmxErrChk (DAQmxCreateAOVoltageChan(*(&AOtaskHandle),"Dev1/ao1","",-10.0000000,+10.00000,DAQmx_Val_Volts,NULL));
    //16 bit output resolution needed, sampling rate matched to the WAV file's
    DAQmxErrChk (DAQmxCfgSampClkTiming(AOtaskHandle,"",44100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
    //Set the output to trigger on a rising edge on PFI6
    //DAQmxErrChk (DAQmxCfgDigEdgeStartTrig (AOtaskHandle,"PFI6",DAQmx_Val_Rising));
    //Start the task in the background
    DAQmxStartTask(AOtaskHandle);
    ReadWavFile();
    DAQmxErrChk(DAQmxWriteAnalogF64(AOtaskHandle,(SoundFileInfo.channels * SoundFileInfo.frames),true,10.0, DAQmx_Val_GroupByChannel,AIOSample,NULL,NULL));
    printf("Playing audio\n");
    Error:
    if( DAQmxFailed(error) )
    DAQmxGetExtendedErrorInfo(errBuff,2048);
    //puts(errBuff);
    puts(errBuff);
    return TRUE;//DefWindowProc(hwndmon,message,wParam,lParam);
    getch();
    The program reads a 10 seconds long 1kHz sine wave signal from a WAV file and plays it over AO0.
    I want the program to  print "Playing Audio" on the console window while the audio is still playing, i.e when DAQmxWriteAnalogF64 is executing.
    I'm using Visual Studio 2005 on Windows XP and an NI PCIe6351.
    I'd really appreciate any help I can get.
    Thanks a lot!
    RaziM

    Hi RaziM, 
    It sounds like you will need to implement some sort of multithreading to accomplish playing audio in the background and also making changes in the UI dialog box in the foreground. Since DAQmx is thread safe this should definitely be possible, but it will probably take a little more work on your part.
    You may want to take a look at this page which gives a walkthrough to Multithreading with a Background component, http://msdn.microsoft.com/en-us/library/ywkkz4s1.aspx
    Here is another forum post about how DAQmx runs multiple threads, http://forums.ni.com/t5/Measurement-Studio-for-VC/DAQmx-how-does-it-multithread/td-p/221953
    I hope some of this helps!
    Rachel M.
    Applications Engineer
    National Instruments

  • Usb-6009 analog output voltage

    Hi,
    The usb-6009 has two 0-5 volts analog ouputs. Is it possible to connect
    them in series, in order to get a single 0-10 volts analog output
    channel ?
    Thanks,
    Nicolas

    Those are ground-referenced signals. To connect them in series, you would have to connect one of the outputs to ground. You would be shorting out (at least) one of your analog outputs, and probably damage the unit.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • Loop in combination with Analog output

    Hi
    I have modified the script thats translate a value in to a static analog output voltage. The value comes from another online running application. The analog output value must remain static until a new value arise. I'm using VB6 and DAQmx 8.5 on a XP computer. The DA converter is NI USB-6211. I have tried to play around with the Start/Stop and clear commands but my script still makes the program highly unstabile.
    So am I using the commands correctly?. And have I setup the write commands correctly too. Can anyone allso explain how to use the command Doevent correctly
      Dim taskHandle As Long
        Dim clockEdge As Long
        Dim sampsPerCycle As Double
        Dim desiredSampleClockRate As Double
        Dim resultingFrequency As Double
        Dim amplitude As Double
        Dim numSampsPerChannel As Long
        Dim numChannels As Long
        Dim errorCode As Long
        Dim errorString As String
        Dim sampsPerChanWritten As Long
        Dim XICVolt As Double
     '  Create the DAQmx task.
        Call DAQmxCreateTask("", taskHandle)
        '  Add an analog output channel to the task and check to see whether there is only ONE task.
        Call DAQmxCreateAOVoltageChan(taskHandle, "Dev2/ao0", "aoChannel", "-10", "10", DAQmx_Val_VoltageUnits2_Volts, "")
        Call DAQmxGetTaskNumChans(taskHandle, numChannels)
        If numChannels > 1 Then
            errorCode = -1
            errorString = "Please specify only one channel."
            Err.Raise errorCode, , errorString
        End If
    Data_is_recorded:
        If Actualcycles = expectedcycles Then
        GoTo end_script
        Else
        If Actualcycles > lastcycles Then
        DoEvents
         Call DataPoint.GetDataPoint(thenumberOfDataPoint, theXvalue, theYvalue)
            XICVolt = (theYvalue / 10000000#)
        '  Write to the desired channel(s).
        Call DAQmxWriteAnalogF64(taskHandle, 1, True, 10#, _
            DAQmx_Val_GroupByScanNumber, XICVolt, sampsPerChanWritten, ByVal 0&
        Else
         lastcycles = theWF.GetActualNumberOfCycles(sampleIndex, 0)
         End If
        GoTo Data_is_recorded
    end_script:
    End If
    call DAQmx.stopTask(Taskhandle)
    call DAQmx.clearTask(taskhandle)
    Best regards
    Peter

    David Weber wrote:
    thanks lot for all the great feedback. That's really helpful. I think I'll go for the NO_MERGE hint. A first test with this looks good.Keep in mind, only undocumented hint MATERIALIZE along with subquery factoring clause WITH (for which this hint was created) will work in real queries:
    SQL> select my_id as id
      2       , my_id as same_id
      3  from (select /*+ NO_MERGE */ xxx_test_pkg.get_id(1) as my_id from dual),emp where rownum < 6;
            ID    SAME_ID
            20         20
            21         21
            21         21
            21         21
            21         21
    SQL> select my_id as id
      2       , my_id as same_id
      3  from (select xxx_test_pkg.get_id(1) as my_id from dual where rownum=1),emp where rownum < 6;
            ID    SAME_ID
            22         22
            23         23
            23         23
            23         23
            23         23
    SQL> select my_id as id
      2       , my_id as same_id
      3  from (select /*+ MATERIALIZE */ xxx_test_pkg.get_id(1) as my_id from dual),emp where rownum < 6;
            ID    SAME_ID
            24         25
            26         27
            28         29
            30         31
            32         33
    SQL> with t as (select /*+ MATERIALIZE */ xxx_test_pkg.get_id(1) as my_id from dual)
      2  select my_id as id
      3       , my_id as same_id
      4  from t,emp where rownum < 6;
            ID    SAME_ID
            34         34
            34         34
            34         34
            34         34
            34         34
    SQL> SY.

  • How to send an analog output signal on same axis running a stepping motor umi 7764/ PCI7334

    I am running a single axis stepping motor (which is working fine) but
    for the application I need to be able to turn on and off a 5 volt
    laser.  It notes in the manual for the UMI 7764  that the the
    analog output can be used as a general-purpose voltage output.  I
    would like to use it as such, but can't figure out what VI's actually
    send messages to the board to output a 5 Volt signal.  
    Ideally I would use the analog output on the same axis that the
    stepping motor is on, but if need be I could use one of the other axis
    if this isn't possible (ie. it may not be possible to step and send
    analog voltage output on same axis at same time).  I have been
    looking at the configuring DAQ and ADC stuff, but can't seem to make
    sense if these actually control the analog output channel.  I
    think they just control the Analog input channels, but maybe I am
    wrong. 
    Any help would be greatly appreciated
    Andre

    Hi,
    It is possible to send analog output out of the same same DAC channel in which your stepper is connected, if you configure the stepper as open loop in MAX. I've tried it. This way you have the stepper output, analog output and encoder input acting independently. So you can use these seperately for different purposes, such as using the analog output for constant speed motors where speed or position control is not of much importance, encoder for positioning some other axes and stepper output for stepper control. With good programming skills, the NI motion controllers can thus be used for the most complex configurations. Great work NI !!! Nothing is impossible.
    Regards,
    Giridhar Rajan
    Automation Engineer, Design
    Cruiser Controls
    Mumbai, India

  • Synchronizing data acquisition&waveform generation

    I'm attempting to synchronize analog waveform generation and analog data acquisition using an AT-MIO-16E-1 board. I've followed the instructions in the manual on how to do this but with no luck (maybe the VI I wrote is incorrect).
    Any suggestions?

    Have you taken a look at the Simultaneous AI/AO examples that ship with NI-DAQ? They can be found in Examples>>I/O Interfaces>>Data Acquisition>>Simultaneous AI/AO. They will give you some examples of how to program your board.
    Regards,
    Erin

  • Controllin​g Analog Output in *.vi

    Hi Y'all,
    I have a PCI-6281 with an SCB-68 B.O.B. Anyways, I have been using the two analog output channels to drive some voltages across some instruments. Everytime I reboot the computer, I have to reset the voltages using the measurements and automization explorer. (I go to measurements and automization explorer > Devices and interfaces > NI PCI-6281 dev 1 > test pannels... > analog output). Is there a way to have the VI set this everytime I run it? THX
    Solved!
    Go to Solution.

    Look at the DAQmx Write.vi in the DAQmx pallet.  Also look up in the example finder (Help->Find Examples...) for DAQmx Analog Output.  There should be plenty of examples that you should be able to strip down to simply set the voltages.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Four analog outputs

    I want to find a DAQ device which has four analog
    outputs and at least four analog inputs.
    Could you recommend one to me?

    Jaejeen,
    There is no daqboard with the exact specifications you request. However, I can suggest you some alternatives:
    1.- You can get a Signal Source board with at least four analog output channels; i.e., the NI 6711, and you can get an E Series board for the analog input channels. Finally, you can synchronize both of them.
    2.- You can get a regular E Series Board, and you can use the two regular analog output channels, and the counters are other two analog output channels, but with the restriction to generate square waves only.
    Hope this info is helpful.
    L Aguila
    Applications Engineer
    National Instruments

Maybe you are looking for