Capture single channel in c++

Hi,
I'm trying to write a simple C++ routing (Visual C++) using the NIDSA functions that generates a sine wave and captures the response data.
I can generate a sine wave using NIDSA_configure_source(), but I can't figure out how to get the response data.
I tried calling NIDSA_configure_capture_buffer() and then NIDSA_read_capture_single_chan() but then I get an "Unknown Error" from NIDSA_read_capture_single_chan(). (Error code = 0xffffd5d0)
Sample Code:
rc = NI4551_ConfigureSource(1,0);
// configure capture buffer
rc = NI4551_ConfigureCaptureBuffer(numMeasurements);
// read single channel
rc = NI4551_ReadSingleChannel("0", numMeasurements, pResult);
rc = NI4551_ConfigureSource(0,0);
I don't know if I've got the correct functions to generate the sine wave and capture data or if I'm even calling them in the correct order.
Is there any sample code out there??
Thanks!

Hello,
You have specified a resource descriptor for the source task but when you are calling the capture commands you have not set up an initialize function that tells the program what board to use. For instance try using the NIDSA_init and then use that session to pass to the other function calls such as NIDSA_configure_capture_buffer() etc. I have attached some example code that reads from the board and demonstrates the analog triggering capabilities of the board. I hope this helps. Please let me know if you have any questions after exploring these resources.
Regards,
Shea C
Applications
NI
Attachments:
455x Analog Trigger.zip ‏6 KB

Similar Messages

  • Problem with Set/Get volume of input device with single channel

    from Symadept <[email protected]>
    to Cocoa Developers <[email protected]>,
    coreaudio-api <[email protected]>
    date Thu, Dec 10, 2009 at 2:45 PM
    subject Problem with Set/Get volume of input device with single channel
    mailed-by gmail.com
    hide details 2:45 PM (2 hours ago)
    Hi,
    I am trying to Set/Get Volume level of Input device which has only single channel but no master channel, then it fails to retrieve the kAudioDevicePropertyPreferredChannelsForStereo and intermittently kAudioDevicePropertyVolumeScalar for each channel. But this works well for Output device.
    So is there any difference in setting/getting the volume of input channels?
    I am pasting the downloadable link to sample.
    http://www.4shared.com/file/169494513/f53ed27/VolumeManagerTest.html
    Thanks in advance.
    Regards
    Mustafa
    Tags: MacOSX, CoreAudio, Objective C.

    That works but the the game will not be in full screen, it will have an empty strip at the bottom.
    I actually found out what's the problem. I traced the stageWidth and stageHeight during resizing event. I found out that when it first resized, the stage width and height were the size with the notification bar. So when I pass the stage into startling, myStarling = new Starling(Game,stage), the stage is in the wrong size. For some reason, I can only get the correct stage width and height after the third resizing event.
    So now I need to restart Starling everytime a resizing event happened. It gives me the right result but I am not sure it is a good idea to do that.
    And thanks a lot for your time kglad~I really appriciate your help.

  • How to do a single channel DAQ using NI-DAQ driver software with a PCI-MIO-16XE-10 card

    Hi,
    I would like to find out how I could do a simple one channel Data Acquisition from a signal generator using the NI-DAQ driver software with a PCI-MIO-16XE-10 card.
    I have written some test problem but even when the signal generator is turned on/off I get back some weird values.
    Here is my code.
    CString sFunctionName("");
    double volt[OUTPUT_POINTS*2];
    double out[OUTPUT_POINTS*2];
    short timebase, ready, code, stopped;
    unsigned short sampleInterval;
    int i, status, count=0;
    unsigned long update, points;
    short* ai_buffer;
    short output_ch_vector[16];
    int local_ITERATIONS = 2;
    SAFEARRAYBOUND bound[1];
    double dataItem = 9.9;
    long j;
    long k;
    double* pTheValues;
    LPTSTR lpsz_ErrMsg;
    // Initialise device
    status = Init_DA_Brds (deviceNumber, deviceNumberCode)
    Initializes the hardware and software states of a National Instruments
    DAQ device to its default state and returns a numeric device code that
    corresponds to the type of device initialized
    Init_DA_Brds(DEVICE, &code);
    // Check return code from Init_DA_Brds
    Code return should be 204: PCI-MIO-16XE-10.
    if (code < 0)
    CString sError;
    sError.Format("Code error: %d", code);
    if (code == -1)
    sError = sError + ": No device found";
    LPTSTR lpsz = new TCHAR[sError.GetLength()+1];
    _tcscpy(lpsz, sError);
    AfxMessageBox(lpsz);
    delete lpsz;
    return S_FALSE;
    // Allocate memory for analog output and input arrays
    //ao_buffer = new short[OUTPUT_POINTS*2];
    ai_buffer = new short[OUTPUT_POINTS];
    // Set double-buffering
    status = DAQ_DB_Config (deviceNumber, DBmode)
    Enables or disables double-buffered DAQ operations.
    status = DAQ_DB_Config(DEVICE, 1);
    if (status < 0 )
    sFunctionName = "DAQ_DB_Config";
    goto TidyUp;
    // Get the rate parameters
    status = DAQ_Rate (rate, units, timebase, sampleInterval)
    Converts a DAQ rate into the timebase and sample-interval
    values needed to produce the rate you want.
    status = DAQ_Rate(RATE, 0, &timebase, &sampleInterval);
    if (status < 0 )
    sFunctionName = "DAQ_Rate";
    goto TidyUp;
    // Setup scan
    status = SCAN_Setup (deviceNumber, numChans, chanVector, gainVector)
    Initializes circuitry for a scanned data acquisition operation.
    Initialization includes storing a table of the channel sequence
    and gain setting for each channel to be digitized
    status = SCAN_Setup(DEVICE, 1, ai_channels, gain);
    if (status < 0 )
    sFunctionName = "SCAN_Setup";
    goto TidyUp;
    status = SCAN_Start (deviceNumber, buffer, count, sampTimebase,
    sampInterval, scanTimebase, scanInterval)
    Initiates a multiple-channel scanned data acquisition operation,
    with or without interval scanning, and stores its input in an array
    status = SCAN_Start(DEVICE, ai_buffer, OUTPUT_POINTS, timebase, sampleInterval, timebase, 1000);
    if (status < 0 )
    sFunctionName = "SCAN_Start";
    goto TidyUp;
    while(count < local_ITERATIONS)
    // Check whether we are ready to input another half-buffer
    status = DAQ_DB_HalfReady(DEVICE, &ready, &stopped);
    if (status < 0 )
    sFunctionName = "DAQ_DB_HalfReady";
    goto TidyUp;
    if (ready == 1)
    status = DAQ_DB_Transfer(DEVICE, ai_buffer, &points, &stopped);
    if (status < 0 )
    sFunctionName = "DAQ_DB_Transfer";
    goto TidyUp;
    count++;
    // Clear the analog input
    status = DAQ_Clear (deviceNumber)
    Cancels the current DAQ operation
    (both single-channel and multiple-channel scanned) and reinitializes the DAQ circuitry.
    status = DAQ_Clear(DEVICE);
    if (status < 0 )
    sFunctionName = "DAQ_Clear";
    goto TidyUp;
    status = SCAN_Demux (buffer, count, numChans, numMuxBrds)
    Rearranges, or demultiplexes, data acquired by a SCAN operation
    into row-major order, that is, each row of the array holding the
    data corresponds to a scanned channel
    status = SCAN_Demux(ai_buffer, OUTPUT_POINTS * 2, 2, 0);
    if (status < 0 )
    sFunctionName = "SCAN_Demux";
    goto TidyUp;
    //Convert binary values to voltages (Doesn't actually take a reading from board)
    status = DAQ_VScale (deviceNumber, chan, gain, gainAdjust, offset, count, binArray, voltArray)
    Converts the values of an array of acquired binary data and the gain setting for that data
    to actual input voltages measured.
    status = DAQ_VScale (1, 0, 1, 1.0, 0.0, OUTPUT_POINTS , ai_buffer, volt);
    if (status < 0 )
    sFunctionName = "DAQ_VScale";
    goto TidyUp;

    Hello,
    Please take a look at lots of examples available at :
    1. www.ni.com >> NI Developer Zone >> Development Library >> Measurement Hardware
    2. C:\program files\national instruments\ni-daq\examples\visualc
    Sincerely,
    Sastry V.
    Applications Engineer
    National Instruments

  • Currently Unavailable Message for a Single Channel

    Has anyone had this issue with a single channel?  The new FSC HD (584) that just came out last week worked for 1/2 a day then it started showing Currently Unavailable.  I had a technician out a few days later and he checked signal strength, changed all the connections at the splitter on every line and the channel started to show up again.  Two days later it went back to Currently Unavailable.   After 2 hours on the phone, an hour tech visit, an hour on online chat, researching all I could, etc. they have no clue what to do and now I have to wait for a technician to come out again in 7 days!!!!!   Gotta love Verizon!  
    I can't believe that there is no record of another customer having this issue in their tech support databases and someone can tell me something other than unplug the connection and plug it back in.  
    Solved!
    Go to Solution.

    The technician changed out all of the connections into and out of the splitter. We also reconnected everything along with way (at the router, to the TVs and from the wall plates, etc.).   It worked fine for a day or two then went out again on all of the TVs.  Then this morning the channel is appearing again (without doing anything), but it's just a matter of time until it goes out again.   My question is I could understand a connection issue if it were all of the HD channels, but why on just this one (the newest one released about a week ago, doesn't happen on the previously released HD channel BET). 

  • Adding a single channel to my service?

    I am hoping to get an answer from someone in Verizon.  Can I add a single channel to my current lineup.  I just switched from Comcast and realize now that I don't get the NHL network.  I don't really want the entire sports package for $15.  Can you add single channels? Thanks

    chrisaster wrote:
    I am hoping to get an answer from someone in Verizon.  Can I add a single channel to my current lineup.  I just switched from Comcast and realize now that I don't get the NHL network.  I don't really want the entire sports package for $15.  Can you add single channels? Thanks
    Answer is no, you have to either upgrade to a higher tier or subscribe to the sports package. You're basically asking for ala carte channels (as walt said), while that is most of us would want, it just is not available.

  • Similar channel into single channel

    Dear All,
    Is there any way to merge the multiple similar channel to single channel without flattening layers.
    If pantone reflex blue 3 times is there means i need to merge it into single reflex blue channel.
    Pls help..
    Thank you,
    Joe

    Yes spot channel only and in Same document itself.
    And the above script need to run in Extend tool script?. Coz by this script there is no changes happening.
    By using Apply image can merge only two channels at a time. And after merged into a single channel source channel also remains.
    For ex,  Pantone Reflex Blue 1
          Pantone Reflex Blue 2
    Now i need to merge into 1. so after Merging by using Apply image
    Pantone Reflex Blue 1 2
    Pantone Reflex Blue 2 (But this is to be automatically deleted after merging, which is not possible by using Apply image)
    By using the script this needs to be recover
    1) In channel options
    Color indicates - Spot Color
    Color - Reflex Blue
    Solidity - 0%
    In same way i have taken the separation in different area of my image with same spot color.
    2) If process color are taken as spot channel that also need to merge with process channel (CMYK)
    Color indicates - Spot color
    Color - C100%
    Solidity - 0%
    If this is option selected in this channel to be merge with Cyan process color channel.
    By using Apply image option i used to give Multiply only and Opacity to 100%. Same need to apply this script. Pls help..
    Thank you,
    Joe

  • Multiple Endpoints Single Channel

    I am working on a project, that requires instancing of our
    flex application. One idea that I came up with was to allow for
    multiple urls to access the same data based on several variables.
    One key components for this idea to work is being able to use
    multiple endpoints with in the same channel in my
    services-config.xml file.
    Right now this is what my channel setup looks like.
    <channels>
    <channel-definition id="cfamf"
    class="mx.messaging.channels.AMFChannel">
    <endpoint uri="
    http://admin.mydomain.com/flex2gateway/"
    class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
    <polling-enabled>false</polling-enabled>
    <serialization>
    <instantiate-types>false</instantiate-types>
    </serialization>
    </properties>
    </channel-definition>
    <channel-definition id="cfamf"
    class="mx.messaging.channels.AMFChannel">
    <endpoint uri="
    http://user.mydomain.com/flex2gateway/"
    class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
    <polling-enabled>false</polling-enabled>
    <serialization>
    <instantiate-types>false</instantiate-types>
    </serialization>
    </properties>
    </channel-definition>
    </channels>
    Ideally I would prefer it to act like this.
    <channel-definition id="cfamf"
    class="mx.messaging.channels.AMFChannel">
    <endpoint uri="
    http://admin.mydomain.com/flex2gateway/"
    class="flex.messaging.endpoints.AMFEndpoint"/>
    <endpoint uri="
    http://user.mydomain.com/flex2gateway/"
    class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
    <polling-enabled>false</polling-enabled>
    <serialization>
    <instantiate-types>false</instantiate-types>
    </serialization>
    </properties>
    </channel-definition>
    </channels>

    one AP will only serve a single channel per spectrum. If you have multiple SSID they can be on the same channel with no issue, so long as you're not running more than 4-5. After that you start to cause issues inside your own network.
    If you absolutely had to run them on different channels, you would need multiple AP to accomplish that.
    But as I said, you shouldn't need to.
    Steve
    Sent from Cisco Technical Support iPhone App

  • Why do I get this error when running the PID Control-Single Channel.vi: "Requested value is not a supported value for this property."

    Error -200077 occurred at Property Node DAQmx Timing (arg 3) in DAQmx Timing (Sample Clock).vi:1->PID Control-Single Channel.vi
    Requested value is not a supported value for this property.
    Property: SampQuant.SampMode
    You Have Requested: Hardware Timed Single Point
    You Can Select: Finite Samples, Continuous Samples
    Author: Pcorcs
    Attachments:
    PID Control-Single Channel.vi ‏53 KB

    Actually I have already tried a few things you suggested and got as far as the DAQmx Write vi. The error at the DAQmx was a buffer error indicating i needed to set it to 2 instead of the default of 1. Tried using the DAQmx Input and Output Buffer vi to change buffer, with no luck.
    Attachments:
    PID Control-Single Channel.vi ‏53 KB

  • How to access single channels of multichannel acquisition?

    I want to access single channels of a multichannel acquisition in the Getting Started Analog Input.vi
    The purpose of this is to analyse i.e. do Min-Max or FFT on the individual channels. Can somebody help me to unbundle the data? Why does AI Read give Scaled Data while in other vi Waveform data?

    Hi,
    Getting Started Analog Input.vi uses AIRead.vi to read data from your hardware.
    1. This is from the help about AIRead.vi:
    "scaled data is a 2D array that contains analog input data in scaled data units. The data appears in columns, where each column contains the data for a single channel."
    So to access the single channel you must use "Functions->Array->Index Array.vi" to get data from your 2D array. All you need is to wire your 2D array to this VI and the specified number to the "column" input node.
    2. To change the Data type of array you receive from hardware you have to right-click on the AIRead.vi and choose any of 4 options (Binary Array, Scaled and Binary Arrays, Scaled Array, Waveform) from "Select Type" sub-menu.
    Good luck.
    Oleg Chutko.

  • Dual and Single Channel Mode

    Talking about dual channel and single channel. Is it a theory or is it really a big significant difference in performance between the two? Just curious

    Hi Richard,
    Thanks for the speedy reply. I'll go tinker around a little more and see what I can do with this board
    Benedict.

  • Is it possible to execute Single Channel read of AI channel too quickly?

    When executing single channel read of volts on 16XE50 in VB6 it seems to return an errornous result if too fast. Increase the time between reads and the result is correct. I need to scan single channel quickly for short period to check a trip point and stop some motion. Any clues?

    Check the Zout of your signal source. Any stored charge on the amp inputs needs to be bled off trough your source. If it is higher thatn 1kohm, the settling time of the amp is higher than that guaranteed for maximum accuracy.
    NI recommends 10kohm or less, with 1kohm for guaranteed accuracy. You may have to buffer the output of your signal.

  • Trouble with Mobo running on single channel

    I bought a pair of identical 1GB DDR2 PC2-5300 (667mhz) chips for my P4M890/900M2 motherboard and Windows 7 and my bios are only registering 1gb. CPU-Z is showing that I'm running on a single channel only, from what I've looked into, this problem seems to occur only if the chips aren't identical, but mine are; what gives? Anyone have an idea as to whats wrong?

    There is no mention of dual channel for this Via chipset:
    http://global.msi.eu/index.php?func=proddesc&maincat_no=1&prod_no=1082
    http://www.via.com.tw/en/products/chipsets/p4-series/p4m890/

  • FCP only capturing one channel. what's up with that!?

    in FCP 7 while i am logging and capturing HDV footage off of my canon XLH1, only one channel of audio is captured. originally the audio was shot using 2 separate channels, in fact, i can hear both channels playing back (each on their own sound level/they are not mixed) while the capture is happening.. but when i'm done, FCP has only captured one of the channels.
    how can i resolve this problem?

    in my capture bin, after i've captured the clip, it shows that only one audio clip was captured. when i drag it into the timeline, only one audio channel is present.
    my lost channel was on a wireless mic, as was the saved channel.
    fcp is only capturing one channel even when i log other tapes that did not have separated audio channels.
    i'm guessing there is some setting that is now off while i capture, because it used to capture audio just fine last week.

  • Only two "Capturable" audio channels?

    I cannot seem to figure out how to import or capture more than two audio channels from within FCP. After opening the "Log and Capture" window and then tabbing to "Clip Settings," the option to have more audio channels is greyed out. Any suggestions?
    I am using a Sony DSR-45 DVCAM deck and a Quad PowerMac G5. The tapes I am trying to import are miniDV and StudioDV tapes.
    Thank you,
    Rybo
    Quad 2.5GHz PowerMac G5   Mac OS X (10.4.7)   4.5 GB DDR2 SDRAM

    the limitation is in the hardware you are using. DV as a format is used widely in many spectrums of todays broadcast world, but your basic DV hardware is very much consumer equipment with consumer limitations ... upgrade your hardware and the problem will go away.
    for example, use a DV deck like the DSR-1500 together with a capture card, like the Decklink or Kona or Pipe cards. then using the SDI output from the deck you can happily capture 4 channels. likewise for your live input.
    hope it helps
    Andy

  • Softing profibus OPC PROFIusb, PROFIBUS USB Interface, single channel

    Hi,
    Is there anyone who has experience with this Profibus interface?
    Softing profibus OPC PROFIusb, PROFIBUS USB Interface, single channel or, the PROFIboard PCI Master/Slave
    Would it work with NI OPC server or we have to use the Softing OPC server?
    Thank for any feedback,
    Andras

    Hello kaush,
    you also should be able to talk to these devices from LabVIEW  through direct DLL calls (call library node). Preconditions for this are well documented driver DLLs and some spare time for understanding and implementing the DLL calls. I'm not aware of a direct LabVIEW interface for Profibus boards from Softing and Siemens, but it might be worth contacting these vendors. At least Softing might have something available.
    If you need to focus on development time, you also may consider using a Profibus DP board from NI in combination with a PA bus coupler (e. g. from Pepperl&Fuchs). The NI board is developed and manufactured by Comsoft, who is well known in the Profibus market, and it comes with an easy to use LabVIEW API.
    Compared to OPC a direct communication with the Profibus board provides much better performance and it's much less error prone, so I can understand your preference here...
    Kind regards,
    Jochen Klier
    National Instruments

Maybe you are looking for