Synchronization of the inputs and outputs with different sampling frequencies

I'm relatively new to LabView. I have a NOR-myDAQ, and I am trying to accomplish the following:

Square wave output 10 kHz, duty cycle 50%.

Input sampling frequency of 200 kHz, synchronized with the output that I get 20 analog input samples by square wave, and I know what samples align with the high and low output of my square wave.

So far, I used a counter to create the square wave of 10 kHz, display on a digital output line. I tried to pull the document according to (http://www.ni.com/white-paper/4322/en), but I'm not sure how sample at a different rate than my clock pulse. It seems that this example is intended rather to taste one entry by analog clock pulse. There may be a way to create a faster clock (200 kHz) in the software and use that to synchronize the analog input collection as well as a slower 10 kHz output generation square wave?

I eventually have to use the analog inputs to obtain data and an analog output to write the data channel, so I need the impetus of the square wave at the exit on a digital PIN.

How could anyone do this in LabView?

Hi Eric,.

All subsystems (, AO, CTR) derive from the STC3 clocks so they don't drift, but in order to align your sample clock HAVE with pulse train that you generate on the counter, you'll want to trigger a task out of the other. I would like to start by a few examples taken from the example Finder > Input and Output material > DAQmx. You can trigger GOT off the train of impulses, start by Gen digital Pulse Train-keep -you probably already use a VI like this to generate 10 k pulse train. AI, start with an example like Acq Cont & chart voltage-Ext Clk - Dig Start.vi-you'll want to use the internal clock so just remove the control of the "Source of the clock" and it uses the internal clock. From there, simply set the "Source of the command" either be the PFI line generates the meter, or ' //Ctr0InternalOutput '-assuming that you are using the counter 0. You'll want to make sure that the start of the task HAVE faced the task of counter I is ready to trigger off the first impulse. They should be aligned at this point.

For debugging, you can use DAQmx export Signal to export the sample clock - you can then brought the train line and the PFI pulse to make sure that they are aligned.

Hope this helps,

Andrew S

Tags: NI Hardware

Similar Questions

  • Make sure that wire you all the inputs and outputs of your node library function call?

    This document says "make sure that wire you all the inputs and outputs of your node library function call.

    http://digital.NI.com/public.nsf/WebSearch/7253D2F0D91F68058625752F005AB672?OpenDocument&submitted&&...

    But all the terminals on the right side of the call library node considered "outputs" referred to in the foregoing statement?

    This same document continues to show the right way to allocate memory with this illustration and in the illustration, the right "outputs" are left without junctions.

    Am I right in assuming that the only terminals that count as outputs, those who use the code of the DLL (modify) as output?  If it is true, then all other terminals output associated with the values entered alone so don't really account as outputs, correct?

    In the parameter call-library configuration screen there is a "Constant" check box and the help that he wrote "indicates whether the parameter is a constant."  What is this box? for me in the setup of the DLL call

    Finally, assuming that a call from the DLL that is supposed to write in these five outputs, is it legitimate to use constants like this to book a space of memory for the output values?

    How about if local variables associated with the output terminals are used instead?

    Despite the linked document, it is necessary to connect the corresponding entry for simple scalar output parameters (for example a digital). LabVIEW automatically allocate memory for them. If you do not want the entries for all the output wire anyway, there should not be no difference between a constant and a local variable; I would use a constant to avoid useless local variables.

    For settings that are only entries, there is not need to connect the outlet side. It's a bit simplistic since all parameters are entered only and get one result (other than the return value), you pass a memory address and modify the content to this address, but LabVIEW manages this dereferencing pointer for you. If you want to really get into the details, learn more about pointers in C.

    The "Constant" check box acts as the qualifier "const" on a c function parameter. It tells the compiler that the function you are calling will not change this setting. If you call a function prototype includes a const parameter, then you must mark this as a constant parameter when you configure the call library function node. Otherwise, I wouldn't worry on this subject.

  • synchronize the inputs and outputs on the USB-4431

    Hello

    I have an application that needs to send a signal on the USB-4431 and then capture it with an entry on the same device.

    Aware that I use two tasks to do this, one for input and one for output. I discovered that a trigger (on the RTSI bus) can cycles of sending/capture sychronisé departure operations so that it can be a constant offset between the captured signal and the output signal.

    Unfortunately, the code I found is for Matlab. I can't find an equivalent for it in the C API of NIdaq. The method is described here; http://www.mathworks.in/help/daq/synchronize-analog-input-and-output-using-rtsi.html.

    What I can't understand is how to implement this on the analog input:

    ai.ExternalTriggerDriveLine = 'RTSI0';
    

    Can someone shed light on how to do it?

    The rest of the things described here, seems to be feasible with a normal trigger:

    ao.TriggerType = 'HwDigital';
    ao.HwDigitalTriggerSource = 'RTSI0';
    ao.TriggerCondition = 'PositiveEdge';
    

    Thank you

    Nirvtek

    You can synchronize the HAVE and AO by sharing the start of relaxation between your two tasks.

    Choose one of your tasks as the "master" and the other to be the "slave" (any).

    Set up a trigger to start of digital dashboard on the task of the slave, and set the source of the trigger to be the trigger of the master's departure.

    Assume the following:

    The name of your device is 'Dev1 '.

    I is the main task

    AO is the task of the slave

    Here's what you would do to sync the two:

    (1) create the tasks I and AO in order that you want to

    (2) set up "timing" on the tasks of HAVE it and AO (you choose the sampling rates must be the same or power-of-2 many of the other (for example 100 K, 50 K, 25 K, 12.5 K, etc...))

    (3) configure your slave (the task of AO) task to have a numerical advantage start trigger and make the source is the trigger for the start of the task of the master (the task to HAVE it). In our case, "Dev1, AI, StartTrigger.

    (4) write data (a sine wave, presumably) to your task AO

    (5) start the task from the slave (the task of AO).  The task of the AO is now in the 'Started' State, but given that you've set up a digital trigger early, it won't actually generate data until he sees a numerical advantage of 'Dev1, AI, StartTrigger.

    (6) to start the main task (task to HAVE it).  The task of the AI does not have a trigger digital early, so the software will immediately generate a start trigger, which also causes a numerical advantage on "StartTrigger/AI/Dev1", which causes the task AO start at the same time.

    7) read your job to HAVE.

    You will notice a few 0 at the beginning of your data to HAVE. It's a result of something called "Filter Delay" and it is an inherent characteristic of all DSA devices - see the manual to use DSA and this article for more information on what is and how to cope.

    I hope this helps.

    EDIT: I just noticed that you pointed out an existing C example. It's exactly what you want. I don't know why you have a resource error booked - I tried it myself and (after changing the AO will of +/-10V to +/-3 .5V), it works beautifully.  Try to reset your device to the MAX (or DAQmxResetDevice() of your program)

  • I have mac pro 3.1 and it is insufficient for what is his is. I need an internal card with more flexibility to the inputs and outputs as used in windows systems.

    A sound card internal Mac pro 3.1 what they do?

    And if yes where can buy one?

    I need more input and output it attach to my PA and recording, hardware as I do with a windows PC.

    The mac comes with a microphone and a single output with terrible impact when it is connected to my sound stuff.

    A few people responded to your post above. Might be better to explain what your needs are, rather than starting a new discussion here.

    http://www.Sweetwater.com/C703--PCI_Audio_Interfaces

  • Individual access to the inputs and outputs on a single port (PXI-6509

    Hello

    I use PXI-6509 and this sentence taken from the Manual:

    "You can use each of the DIO lines as the input to a digital static (DI) or digital output (DO) line"

    leads me to believe that each individual DIO can be defined as input or output (even within ports), but picture:

    shows that these ports can be defined as inputs and outputs in the same port.

    On another card 6284 with DIO, I can put them individually.

    Can someone confirm that the 6509 is correctly?

    Best regards

    Adrian


  • The input and output encodings are not same

    Hello

    I'm trying to quantify a value by using the function 'Encrypt' and the same thing I'm trying to decipher in the next page before you update the database.

    I am using the same key algorithm and the encoding process to decrypt.

    But he is back this error "input and output encodings are not same.

    Can someone help me on this?


    form.txtPassword is plain text.  You can't decrypt() plain text.

    --

    Adam

  • synchronize the inputs and outputs of the module C digital 9403

    I want to program EEprom with 9403 module, but I got an error:

    Possible reasons:

    Specified route can not be satisfied, because it requires resources that are currently in use by another route.

    Source device: cDAQ2
    Point source: di/SampleClock
    Target unit: cDAQ2
    Destination terminal: Slot1/ConvertPulse

    Resources in use by
    Task name: _unnamedTask
    Source device: cDAQ2
    Terminal: / SampleClock
    Target unit: cDAQ2
    Destination terminal: Slot1/ConvertPulse

    Task name: _unnamedTask

    code:

    Okay, there are two levels of problems:

    the 9403 cannot use a timed with an easy task, and it cannot link di trigger with trigger, uff do!

    I solved with this: (the trigger is AI/StartTrigger)

  • Connection of the inputs and outputs of a VI

    Hello

    I'm relatively new to TestStand but I'm tying a VI with output entry. So I did a sample project and do the following:

    First VI:

    Takes two numbers and adds them, and returns the result in an indicator

    Second VI:

    Takes a number and square and the fate

    They look like this

    I can do that quite easily in Labview, I would just link out of the first VI at the entrance to the second VI. I can do this in TestStand?

    I only get that much until I got stuck, as shown in the image below:

    What I have to hit f (x) then bind it somehow the first VI in my main installation? (which looks like this :)

    Apologize in advance if it's really simple and miss me something obvious!

    Any help is greatly appreciated.

    See you soon!

    You can use a variable to pass data around TestStand:

    1. Right lick under local sections in the Variables pane

    2. Insert local' number' (give your variable name)

    3. Write the output of your VI to this variable (using the f (x) or typing on):

    4. Pass your variable in the next VI.

    You will probably find the get started with TestStand useful guide, chapters 5 and 11 variables and cover VI.

    I hope this helps!

    Trent

  • How configure you synchronous AI AO with different sampling frequencies?

    Synchronous input analog and analog out, changed for example, NOR results in noisy input if the sampling rates are not the same for AO and AI. What alternative will prevent the noise to be added to the AI? I use LV 8.5, PCI6251.

    The sample program is attached and representative screen captures showing the increase in noise when the sampling rates are different.

    Thank you

    Hi stephanie,.

    Unfortunately, because we did a "stutter" generation, seeds will be present as a clock signal is sent to the DAC each sample, despite the fact that it does not change the value it updates. Is it possible to decrease your rate of update to be as slow as the pulse width (or whatever your shorter time should be high or low) to minimize glitches how occur?

    In addition, as I said in my post above, according to what are the rates, there is a property node synchronization you change (THE Convert.Delay of sample clock) to delay exactly when taste you from the edge of clock sample. I placed the program in a loop, loop through different values for delay and sometimes manages to find points where delay has moved the sample I update AO far enough so that the glitch was sampled not, or at least has been reduced to the minimum. Hope this helps,

  • Precise triggering voltage input and output generation in the DAQ Assistant

    Hello

    I wonder if anyone has come across a simular problem with the synchronization of input and output voltage. I use a box 11 LabView and NI USB-6259. I have been using the DAQ Assistant to configure the input and output channel. In particular, my task is to generate a single rectangular "pulse" as the output voltage to drive a coil and once the pulse went to get a signal from a sensor of magnetic field and get a power spectrum. This means that the order and the time during which the DAQ Assistant is used is extremely important. For example, the output voltage channel must be opened first for 2 seconds. Subsequently, the channel of input voltage must be open for 1 second, in which the sensor signal is obtained and post-processed. Only after these tasks are performed in this order he can can be repeated in a loop until the experiment is over. I don't know how to trigger data acquisition assistants (one for entry) and the other for the voltage output correctly. Y at - it a trick?

    See you soon

    Michael

    Hi Dave,.

    Thank you that I wired the error strings but the timing issue was unrelated to it. In the DAQ assistant, I simply had to choose the continuous aquistion of the 'samples' methods 'N-switch' for input and output voltage and all works fine now.

    Thanks again

    Michael

  • analog input and output synchronization

    Hello everyone, I seem to have a problem of synchronization of the analog input and output on my M-series USB-6211. My request is quite simple. I want to the production and to acquire a sinusoid at the same time. Theoretically, I should have the same 4000 data points through the input and output channels. The reality, however, captured on an oscilloscope, shows that the analog output is off more than 4000 data points. The entry (acquisition) shows 4000 samples. Please see below an excerpt from the creation of task, timing and execution. I'm afraid that the analog input and output are not attached correctly. Do you see something suspicious? Thank you very much! The task was created: DAQmxCreateTask("",&inTaskHandle); DAQmxCreateTask("",&outTaskHandle); Analog output channel Configuration, with 20Ksamples/s: DAQmxCreateAOVoltageChan (outTaskHandle, physChanOut, ' ',-10, 10, DAQmx_Val_Volts, NULL); DAQmxCfgSampClkTiming (outTaskHandle, "OnboardClock", 20000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 4000); Configuration of the analog input strings: DAQmxCreateAIVoltageChan (inTaskHandle, physChanIn, "", DAQmx_Val_RSE,-10, 10, DAQmx_Val_Volts, ""); DAQmxCfgSampClkTiming (inTaskHandle, "OnboardClock", 20000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 4000); Set up the trigger: sprintf ("/%s/ai/StartTrigger", local_port, deviceName); DAQmxCfgDigEdgeStartTrig (outTaskHandle, local_port, DAQmx_Val_Rising); Output: DAQmxWriteAnalogF64 (outTaskHandle, (numberOfSamples * oversample), 1, 40, DAQmx_Val_GroupByChannel, input, & sampsPerChanWritten, NULL); Acquire: DAQmxReadAnalogF64 (inTaskHandle, 4000, 40, DAQmx_Val_GroupByChannel, readArray, 8000, & sampsPerChanRead, NULL); The tasks stop: DAQmxStopTask (outTaskHandle); DAQmxStopTask (inTaskHandle);

    Hello

    Change the finished continuous sampling method seems to solve the problem:

    DAQmxCfgSampClkTiming (inTaskHandle, "OnboardClock", 20000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 4000);

    Also, I wanted to say earlier to write 4000 samples:

    Output:

    DAQmxWriteAnalogF64 (outTaskHandle, 4000,1, 40, DAQmx_Val_GroupByChannel, input, & sampsPerChanWritten, NULL);

    Thank you

  • Why not USB-6509 allow setting input and output on individual ports?

    I have one of the new USB-6509 (96 digital i/o channels) commissions.  It has 12 ports for every 8 bits.  The manual says that you can define the inputs and outputs on a per port basis.  When I read an 8-bit port that I find it clears different ports that I put in place to be digital output.  They seem to be grouped into 3 groups of 4.  0-3, 4-7 and 8-11.  When I read from any single port within this group it erases the other ports in this group that I try to use as exits.  The result is that I can put only input and outputs in groups of 4 ports.  Unfortunately, we have built custom hardware based on the assumption that we could control the inputs and outputs on a basis of port by port.  I see this problem as well with my LabVIEW 7.1 program (see table), as well as the measurement and Automation Explorer.  Is anyone out there seen this problem with the USB-6509?  Anyone using it with success?  I also notice strange problems with power on, but I have yet to understand the model.  IM wondering if I have a defective material or maybe this new material still has problems.  I tried NIDAQ 8.7.1 and 8.8.  Same problem with both. Thank you.

    Thanks for the replies.  It was determined that the USB-6509 we have has a hardware malfunction that is causing the ports to interfere between them.  We are return to OR for repair or replacement.  For now, we used a PCI-DIO-96, which works correctly. Thank you, Andy

  • USB & Firewire audio interface ports still work as input and output?

    I guess everyone has to start somewhere, even if it is borne by almost everyone I would like to know the answer to my questions, perhaps with good reason, what I don't know is so if the USB ports unique connection and firewire on an audio interface function ALWAYS both as input AND output.  In other words, whenever I read the information about the product on audio interfaces, no matter where I go, it is generally accepted that most people buy their audio interface for RECORDING.  And so when most people talk about connecting their Apple computer, iMac or MacBook Pro, it is generally accepted, they turn to the USB as INPUT.  That's all very well and good.  But in my case, I want to use the USB port as output (not the taken mini) and go into an audio interface that gives me as a symmetric output signal that I can plug my amplified studio monitor (which has only a balanced XLR input). All of the examples I see with audio interfaces address registration and involve the use of the USB on the audio input interface.

    So my question is: can one USB port I see on any number of audio interfaces always function both of the inputs and outputs? It takes, but if so, why does any site mention this fact and whey didn't they show in all the diagrams of the audio interface manual hook to studio monitors?  I know what may be obvious to some, but as a user with the intention not to use a piano for a scene while but rather a keyboard/MIDI controller that is attached to the iMac to be able to use the virtual instrument software, I need to go to the controller to the iMac, then the iMac in symmetrical powered monitors. Do the balanced inputs of speakers requires more than a simple adapter to give the President a balanced input.  But nobody talks about audio interfaces usually unless they talk about as a way into the computer to record.  As for my situation? Why don't they include this example?  And why should they assume that novice will automatically KNOW that the usb port, an audio interface will work as an output as if they never EVER mention this example or Setup?  I guess it is to operate in both directions!  But really, I'm crazy to wonder when no one never speaks or shows this configuration? He suggested I buy something similar to a UR22MkII of Steinberg, who has a USB port. Even the Steinberg site speaks only records and so using the USB key as input for use with the recording software. There is no mention of its use out the mac in balanced speaker entries, even in the manual. In fact, it is question is always true for every audio interface manual that I watched, even by other manufacturers! Why they all assume a novice like me (whose money is just as good as money from the experienced user) KNOW that? It's frustrating!

    I know that this is not strictly a matter of logic, but I guess, in my view correctly, that a logic user community could be more appropriate to address my question for others communities. If I'm wrong, please help to re-send-the matter.  Thank you.

    Sound the interface itself that determines it can send and receive Audio or Midi... not the USB or FW port which both are devices of e/s...

    All USB and Midi peripheral FW are inputs and outputs

    All the USB and Audio FW are inputs and outputs...

    All devices USB or external hardware with a USB port... can handle Midi and Audio...  Some do... Most manipulate just Midi... or just Audio

    The Steinberg UR22MkII manages Audio and Midi...

    However, I do not recommend USB 2.0 audio devices... There are simply too many cases, problems and questions after the major updates for OS X with such devices especially when they are class compliant (IE without driver), even if the UR22MkII Steinberg is supposed to be compatible 10.11...

    View the other may vary... because it's just a personal opinion based on my past experiences both in my studio... and based on the many issues presented here and elsewhere.

    I'm sticking with Motu equipment for all my Audio devices... and I use iConnect devices for my Midi needs...

  • Synchronized analog input and output on myRIO

    Hello!

    A brilliant new myRIO just landed on my desk and I'm looking forward to learn how to use it.

    I have a question about the ability of the default FPGA personality.

    Is really similar synchronous HW in and output possible? Can configure you the necessary trigger and clock routing from within VI RT? To say ~100kS/s?

    I need to delve into a FPGA design to achieve this?

    Thank you!

    You will not be able to get your RT loop to run reliably at rates greater than 5 kHz, and we generally do not recommend trying to control I/O faster than 500 to 1000 Hz. This isn't a limitation of the default personality himself, it's just that some tasks are better suited for the OTR and some are better for the FPGA (it is important to understand when developing an application on the myRIO). Synchronization and the output of ~100KS/s signals are something that you have to do on the FPGA.

    http://www.NI.com/Tutorial/14532/en/

    There are some good tutorials in the link above. They use the cRIO instead of the myRIO but the functionality is basically the same. The biggest difference is that you won't have to add modules to your project, because all the inputs and outputs of the myRIO are fixed and must fill out automatically when you add a FPGA target to your project.

  • Configure 9401 to buffering of input and output

    I have a compact DAQ (9174) and the module 9401.  I found the example to configure the inputs and outputs separately.  But when I try to apply that to my application, I get the error:

    Device cannot be configured for input or output because the lines and/or the terminals on this device are in use by another job or road. This operation requires temporarily reserving all lines and terminals for communication, which interferes with the other task or the road.

    If possible, use the control task DAQmx to book tasks that use this device before committing to tasks that use this device. Otherwise, uncommit or cancel the other task or disconnect the other lane before attempting to configure the input or output device.

    Feature: 9401-0
    Digital port: 0
    Lines: 0, 1, 2, 3

    Task name: _unnamedTask

    I tried using the example that works and adding just the bits and I think it has something to do with the fact that I use stored sample, but not sure clock output buffer.  I found the sample output correlated and fundamentally changed than to generate a waveform, that I need.  That part worked fine.  But when I then tried to use the entry, which has not worked very well.  The related example, I tried with line0:3 as output and input on the 9401 line7 and using the meter chassis as source is attached.

    Is there something with exits/entries in the buffer that will not allow using both at the same time?  or what am I missing?

    Found my problem.  The RESERVE has to happen just before the start of the task.  If try to change the sample clock or anything after reserve, leads to problems.

Maybe you are looking for

  • Bluetooth issues with car matching Subaru

    I upgraded my iPhone to iOS 10 6 and my bluetooth stopped working in my Subaru Outback 2015. It worked perfectly before the upgrade. Unmatched two car and phone nothing worked - can someone help me with this

  • After updating Firefox, the font on my screen size has been reduced for all applications. How can I increase the size of the font on my screen?

    After the update, the next screen shows all the letters in smaller characters, with fewer pixels. All screens are like that now, and I found nothing in Firefox Help content. It is a problem because I have vision problems. So, how can I increase the f

  • IX2 - usb storage device?

    I have a storcenter ix2 and wonder if it can be used as USB storage connected in local device or is it strictly a SIN? Thank you

  • ea3500 connect to a 4 case drive

    can I connect the ea3500 to 4 Bay enclosure: http://ain.mediasonic.ca/store/product_info.php?products_id=234 It is connected via usb only 1 wedge inside, I have 4 2 TB western digital drives I'll be able to see the 4 drives on my network?

  • File Push

    Hello I'm looking pressing a file to a select list of devices (they are on BES), and I need to automate this procedure. I'm on BES documentation, but it does not seem possible. A second possibility, I'm looking for in the API to push to deliver a fil