Synchronize buffered pwm outputs on Daqmx

I'm using Daqmx to produce two synchronized pwm outputs.
The pwm outputs: 
            a) have variable controllable frequecy, and therefore use buffered data as input to daqmx write vi. and also use 'implicit' as input to clock type in timing vi
            b) have their beginning edges synchronized
The design I use uses two separate tasks to create the signals. The only way I could think of of synchronizing the pulses was by putting the 'start vi' and 'write vi' in two different sequential frames. The idea doesn't seem to work, the two pulses somehow drift apart on the oscilloscope. Even the start part does not work; there seems to be a delay.
Since I'm not using any clock to generate the signals (implicit), how can the two pulses be synchronized?

Hello lvuser111
You may take a look to this community example, it could give you a good idea how it may be implemented:
Synchronize Two Counter Output Tasks Using a Dummy AI Task
Regards
Mart G

Similar Messages

  • How can I output several simultaneo​us buffered waveforms with NI-DAQmx

    I am using a PCI 6229 card and NI-DAQmq in LabWindows CVI 7.1. I can not figure out how
    to implement waveform generation in four channels simultaneously. This has to be buffered wavefrom
    generation with internal clock timing.
    Are there any simple examples done without using the daq assistant that I can see to learn how to use the
    NI-DAQmx functions?.
    I need to write a number of periods on four waveforms, while I count digital pulses.
    Many thanks,
    Fundadero.

    Alan,
    Thank you for your help. I did look at that example and played with the number of analog outputs.
    But It was not clear how to modify this example in order to perform buffered analog output
    with updates corresponding to one of the internal clocks. I will output two sinchronous analog waveforms
    and use the other two analog outputs to update their voltage on demand to control y and z positions.
    The two synchronous waveforms, are AO_0 : a voltage staircase, 256 steps increasing from V1 to V2, 2ms duration steps , followed by 256 steps decreasing back from V2 to V1 (controls the x axis position). The second waveform, is a sequence of 256/n smaller staircases, with step durations of n*2ms, spanning a voltage range from 0.0 to 1.0 volts.
    It turns out that I could do this in the traditional NIDAQ but I am struggling to migrate it to the NI-DAQmx platform, and I could not resolve this with the example that you suggested.
    Do you have any more suggestions after I described what I am trying to do?
    I will very much appreciate it.
    Many thanks
    Fundadero

  • Hardware buffered analog output single shot

    Using DAQmx and M-Series hardware i'm trying to fire a single shot analog output buffered waveform.   I need the output hardware timed.  I'm able to output a hardware buffered waveform but can't figure on how to configure it for or stop it after prescribed number of cycle runs.
    Thanks in advance.
    Solved!
    Go to Solution.

    Hi,
    You have a couple of options. You can set your timing to N
    samples and you acquisition will stop when N samples have passed. Or you can
    use a counter to control the clock of the analog output and then the counter
    can be paused whenever you can.  Before
    we go and dig into the specific details of the scheme let me suggest a couple
    excellent reading materials and let me know if they help. M Series Synchronization
    with LabVIEW and NI-DAQmx, Continuous Analog Output
    with Pause Trigger and Programmatic Grounding of Output in DAQmx, NI-DAQmx: Retriggerable
    Analog Output -- LabVIEW and M Series: Analog Trigger
    Source.
    Also don’t forget to take a look at simpler examples like: Cont
    Gen Voltage Wfm-Int Clk-Pause Trigger.vi
    I hope it helps
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters

  • Buffered analog output puts out additional sample on aborting or stopping task

    I'm using DAQmx and LV 8.2
    I'm doing a buffered analog output operation where the sample clock is driven by pulses from ctr0 on the same device (PXI-6070E).  When I end the analog output task, either with the DAQmx stop task or DAQmx control task (abort option selected), the AO puts out one additional point from the buffer.  (I have checked by setting breakpoints and stepping through the code that the additional point is definitely generated when the analog ouput task is aborted)
    I need the output to remain where it was before the stop task command is issued.  How do I fix this?
    Thanks,
    Marc

    I'm watching to see if there hasn't been a sample output in a certain length of time, then terminating the task if there hasn't been.  Specifically, I have ctr0 outputting pulses to drive the task based on input from the AnalogComparisonEvent terminal.  I'm using a counter on a different PXI device to count the number of pulses and monitoring this count to determine if another sample has been output.  I'm outputting the ctr0 pulse to PFI3 as well, and I'm monitoring both the ctr0 output (which drives the ao clock) and the analog output itself on an oscilloscope.
    Basically I'm sitting in a while loop waiting for the monitoring counter to fail to increment.  Then I terminate the while loop and stop the analog output task.  I can watch the analog output on the oscilloscope while I step through the program.  Immediately before the daqmx control task - abort (or daqmx stop if I don't abort first, or daqmx clear, if I don't abort or stop) vi runs, the analog output remains outputting the last sample.  Immediately after the abort, stop, or clear, the analog output advances one sample in the buffer. 
    During this time, ctr0 does not output another pulse, so the scan clock should not advance.
    Thanks,
    Marc

  • Buffered counter output in C

    Hi everyone,
    I am looking for a possibility to generate a finite buffered counter output with varying pulse widths, using the X-Series. I am working in C / Python.
    I want to output two pulses triggered to an external signal. The first pulse should be short, the second pulse long. 
    The following code outputs only two identical pulses. How can I modify it to output two different pulses?
    CreateCOPulseChanTicks(channel,"","100MhzTimebase",DAQmx_Val_Low,0,300,300)
    CfgImplicitTiming(DAQmx_Val_FiniteSamps,2) #output two pulses
    CfgDigEdgeStartTrig(src,DAQmx_Val_Falling) #external signal
    SetStartTrigRetriggerable(True) #retrigger
    Best Regards,
    Stefan

    It's good you found a workaround but the behavior doesn't seem right to me...
    The default behavior in DAQmx (the C / LabVIEW / .NET APIs) is to regenerate data from the buffer.  Perhaps the python wrapper you are using is disallowing regeneration somewhere?  I tried this with regeneration disabled and it gives the same behavior you reported (though with regeneration enabled it does not).
    You can use DAQmxGetWriteRegenMode to verify this theory and DAQmxSetWriteRegenMode to enable regeneration in case it is disabled.
    Best Regards,
    John Passiak

  • Multiple inputs and outputs using DAQmx VIs

    Hello,
    I am fairly new with the LabView programming language.  I have a few training books that I have been reading, and I have been following online tutorials and reading the forums.  However, I have come to a problem where I don’t see a clear solution.  I am using LabView 2009 (9.0f3) and DAQmx VIs.
    I am using a NI 9172 chassis PLC, with two 9201 AI cards, 9217 AI RTD card, 9472 DO card, 9263 AO card, and two 9237 AI Bridge cards.
    I am reading eight analog inputs with the 9201 cards, two analog RTD inputs with the 9217 card, three digital outputs with the 9472 card, three analog outputs with the 9263, and eight analog inputs with the 9237 cards.
    I wrote a simple program to test one digital output task, two of the analog output tasks, and a single analog input task.  I put all of them in the same while loop, and it worked perfectly.  However, when I add analog input tasks to the same loop, I get an error 200022.    So I tested each sensor individually by changing the channel before each run.  I searched error 200022 and found that this is because I cannot start another analog input task until the previous one ends.  With this said, I don’t know how to acquire an analog voltage in the same task as an analog RTD voltage.  Both inputs take different constants in the start task DAQmx icon.
    Attached is my test program.  It is titled “Test All”. This is the program I used to test the various sensors.  I tested the input sensors one at a time, and it worked fine.  A few tasks are written just to test functionality, and will be added to later.  The data is only displayed on the screen.  I will add triggers and data write to disk functions later.  This program works now, but if I add more analog inputs, it will generate the 200022 error.
    Can someone show me how to correctly write the code for multiple inputs and outputs using DAQmx?  All training materials and tutorials I can find all show a single input or single output, not multiples of each.  Thanks for looking.
    -Randy
    Attachments:
    TestAll-NI.vi ‏32 KB

    Hi RandyC,
    The Knowledge Base article Using Different Types of DAQmx Global Channels in the Same Task goes into a little more depth of what Bryan is talking about, and it also includes some example code to help show what to do.
    Hope that helps,

  • If I configure a buffered pattern input and a buffered pattern output on the 6534 to both operate from the internal clock, will data be transferred out on the same rising edge as data is transfered in or are there two separate oscillators?

    Basically, I want to perform a buffered pattern output synchronously with a buffered pattern input. If I configure the two groups to be internally timed from the same frequency, will the data in be transferred on the same edge as the data out or will the two groups use different oscillators?

    Hi Joseph,
    There are two clocking structures on the 653x boards, one for each group. This means, even if you specify the exact same frequency for both there is no guarantees that they will be synchronized exactly.
    The workaround for synchronizing both groups is to have 1 group clocked internally and 1 group to be clocked externally. Then route the Req line from the internally clocked group to the Req line of the externally clocked group.
    Hope that helps.
    Ron

  • Buffered input/output stream

    How the buffereing is done in buffered input/output streams?
    From the API doc I got to know that they use internal buffer to store bytes before they can be read or written. But i found that File input/output stream also have methods like read(byte[]) or write(byte[]). So what is extra in buffered input/ouput streams? Does the phrase "buffered" suggests that bytes can be read from an array or be written to an array? Am i thinking the right way?

    How the buffereing is done in buffered input/output
    streams?
    From the API doc I got to know that they use internal
    buffer to store bytes before they can be read or
    written. But i found that File input/output stream
    also have methods like read(byte[]) or write(byte[]).Thouse are your buffer, not the streams'.
    So what is extra in buffered input/ouput streams?
    Does the phrase "buffered" suggests that bytes can be
    read from an array or be written to an array? Am i
    thinking the right way?No. It means that the stream either prefetches some data even if it's not requested yet, or that it withholds data that it's supposed to write until it's flushed or gets a larger chunk.

  • PWM output and DIO output on same pin(MultiTasking)

    Hi guys, ive encounter some problem in myrio 1900, which is using PIN31 for digital output and PWM output. while the testing , i cant sending PWM, i only can passing the read value from other Digital input and transfer towards PIN 31. ive tried to change in low level logic but myrio disconnect after 3-5 seconds. By the way ive attached few picture to clarify my current situation, hope can clarify my problem clearly.
    thank you.
    regards
    vincent 
    Attachments:
    1.png ‏51 KB
    2.png ‏49 KB
    3.png ‏49 KB

    http://forums.ni.com/t5/Academic-Hardware-Products-ELVIS/bd-p/10

  • Looking for sample code of pwm output with Labview 7

    we are looking for sample code in LabView 7 for producing a pwm output. We are current using a 3rd party digital I/O board and just want to generate a pwm output on several of the bits.

    Hi Ray,
    There are several ways to do this, and in the example I created, I actually did not end up using shift registers. I've attached some example code that basically multiplies the period by the duty cycle percentage to achieve the number of milliseconds to be high and low.
    You would just need to insert your DIO code in each frame of the sequence structure.
    Hope that helps. Kind regards,
    -Sam F, DAQ Marketing Manager
    Learn about measuring temperature
    Learn how to take voltage measurements
    Learn how to measure current
    Attachments:
    70_PWM_Example.vi ‏23 KB

  • Motion Assistant and PXI-7354 PWM output

    Hello,
    I have a PXI-7354 Motion Controller in a PXI-1033 rack and I'm trying to prototype a product which has a digital motor controller IC, A3906 by Allegro. The IC is controlled with PWM signals by varying the duty cycle. Now, in the NI 7350 User Manual on page 5-17, it says that "These signals (PWM) are configured in software and are in no way associated with the PID servo control loop." My question is, can I programmatically associate the output of the control loop with a PWM output duty cycle?
    I'm new to Motion Assistant and PXI motion controllers and I appreciate any input.
    Regards,
    Miika Lönnqvist
    Electronics designer, CLAD
    Biohit Oyj R&D

    Miika,
    thank you for the information, but there is no way for the 7354 to drive control signals directly in this fashion. So here are some alternative approaches that could help:
    The 7354 outputs a +/- 10 V control signal. You could build your own circuitry to adapt this signal to the control input requirements of your drive (two voltage to PWM converters; one driven by positive voltage values, the other one driven by negative voltage values).
    Replace the 7354 with an R-Series board. The FPGA on these devices can be programmed graphically with LabVIEW FPGA and it provides both, real-time control and complete flexibility in terms of I/O mapping and control algorithms. Motion control with special requirements is a typcial usecase for these devices.
    You can select from a variety of R-Series boards with different FPGA sizes and I/O setups. If you don't need any analog inputs or outputs, the reasonable lowest cost entry point for your application is probably a PXI-7811R
    Both approaches add some complexity to your current setup. While the first approach is hardware centric, the second approach adds some complexity on the software side. My personal preference is option two, as this provides the highest level of flexibility, which is typically very desirable for a prototyping system.
    In any case I recommend to contact your local NI contact for a more detailed consulting.
    Kind regards,
    Jochen

  • DC motor control via ctr1/ctr0 pwm output stops outputting after one loop through.

    Working on this project to control an H-bridge controlled
    motor using pwm output from ctr0/ctr1 for ccw and cw on the motor. A sensor detects where it is at and each cycle goes from black to white. For some reason, the motor only turns on once and then nothing comes out of the ctr outputs after that. Anytime the program is stopped and restarted it works for one cycle. Or if just the program is run at the skipcolor sub-vi. this can be run multiple time to control it properly. During the actual run it doesn't work. Any implementation device would be great. I am using the PCI-MIO-16E controller.
    Programs attached for reference.
    Attachments:
    SkipColor1.vi ‏111 KB
    MotorControl2.vi ‏99 KB
    PROJECT 2a2.vi ‏18 KB

    Hey suspencefull,
    You are probably going to have to think about re-designing your code. Your pulse train is not continually generating because you do not have it in a loop. When you use the DAQ Assistant to create a continuous pulse train, LabVIEW will prompt you if you want it to automatically add the loop. You must have deleted it or chosen not to add the loop.
    There will, however, be problems though when you add the loop back in. The SkipColor sub VI will not finishing executing until the loop is finished and therefore you will never move out of the first frame of your sequence. I would suggest redesigning your code so that these thing can occur in parallel.
    Please let me know if you have further questions.
    Regards,
    Chris Delvizis
    National Instruments

  • How to programatically very the PWM output frequency in 7344, to the desired value

    Hi
    I can use the PWM output only for the frequencies that is specified like 40Khz or 20KHz. I require to set the PWM frequency programatically to the desired value at a aduty cycle of 50%. How to implement this.

    What exactly do you need the PWM oututs for? Are you using a motion drive that requires a PWM command? The controller itself does not allow you to use the PWM ouputs to change the frequency on the fly. You might want to go to a DAQ board of Fielpoint moduel for this functionality.l

  • How can i generate variable pulse waveform using PWM outputs of 7344.

    Hi
    I want to generate a pulse waveform using the pwm outputs of 7344. How can i very the frequency of the PWM programatically.

    If you are programming in LabVIEW, you can use the Configure PWM Output VI to set up the frequency of the pulse train. If you are in any other language, you can use the NI-Motion API and call the flex_configure_pwm_output function to achieve the same result. Please refer to the NI-Motion C reference help that gets installed with the NI-Motion 6.0 driver or follow this link:
    http://digital.ni.com/manuals.nsf/websearch/92003B​670CC3CB3F862567C800755B95?OpenDocument&node=13209​0_US
    for more information on this function.

  • More myRIO PWM outputs via FPGA

    I'm working on a project with the myRIO that requires 9 servo PWM signals. I know that the PWM Express VI operates on 8 different pins among the 3 connector ports on the myRIO. After spending a few hours researching FPGA, I was getting no where since a lot of it is beyond my skill level/understanding. 
    So my question is: what is the simplest way to create more PWM signals with controllable duty cycles on the myRIO FPGA? I wanted to have all the servos attached to pins on one connector for simplicity (e.g., all on MXP-A).
    My initial thought was to create more instances of the DIO/PWM mappings under MXP-A in the shipping personality. But then I had a vague feeling that this segment of the VI makes these pins compatible with the PWM Express VI and doesn't actually produce PWM signals. Is that what this does? Or is it possible to make copies of this and rename the registers PWM.A_3..., PWM.A_4...., PWM.A_5..., etc.?
    I looked at PWM Output With LabVIEW FPGA, but that didn't make any sense to me considering it has no documentation. I also found Developing a PWM Interface using LabVIEW FPGA, but I couldn't see a simple way to adapt it to my needs, while keeping the standard functions of the pins on the other connectors.
    Thanks.
    Bob

    Sorry for the delay Sam. I figured out how to add the PWM outputs via FPGA and it works. Then I tried to accomplish this while still retaining the functions of the other connectors. My method was to go into the FPGA personality and replace all of DIO-A's FPGA with my PWM code while keeping all of the FPGA code for the other connectors intact. The files are attached.
    My issue is: in RT Main, I also tried to run something from the MXP-B connector (PWM Express for example) in a parallel while loop while still running my custom PWM on MXP-A. This produced nothing. I read the PWM Express signal on B/AI0 and it was a flatline at zero. However, when I created a new VI that just uses PWM Express on MXP-B, it works fine.
    Is there a reason why the express VIs aren't working on the other connectors simultaneously?
    Thanks,
    Bob
    Attachments:
    myRIO-1900 Customized FPGA.vi ‏388 KB
    RT Main.vi ‏506 KB

Maybe you are looking for

  • Why cant i switch my file to a PDF file on INDESIGN?

    Im in a Computer Design class where we had to create a story board and the professor asked us to change our file into the smallest file size and make them into spreads. I have 109 pages and i did what i usually did by going into Adobe Presets and swi

  • What is it with PC Suit?

    I've been using this with my 8800 for half an hour now, it is syncing with the phone (when I'm not clicking anything) about every 10 seconds. The Contact Browser thinks it knows better than me how I like the names in my phone book displayed so now th

  • Looking for updateTask, delegateTask samples

    Hi all, I'm looking for some complete and good samples of how to use updateTask, deletegateTask, ... in workflow context (BPEL manager or java API). The scenario is quite simple: - a user U1 has to complete a task - after a while, if U1 does not comp

  • Publishing in Flash CS3

    I am having a bit of trouble using Flash CS3. I have created my flash file, and published it to my hard drive. There are two files, one is the flash.swf file, and the other is index.html. With Flash MX I used to put these two files on my server and e

  • HT201304 Can I remove apps from my purchase list

    Can I remove apps from my purchase list..?