Analog signal duty cycle incorrect

I am using an NI PCIe 6535 board to send digital timing signals to a custom PCB.
The signals are digital square wave signals with various duty cycles and phase shifts.
I also need to send a 12 bit ramp signal to the board.
I am having issues with the frequency.
I need the timing signals to run at 833.33333 khz.
I need the lsb of the ramp to run at 416.666666khz.
To create the timing signals I am using "Create Analog signal", so that I can set up the square wave with the appropriate phase shift and duty cycle.
Then I conver from analog to digital.
I am using a DAQmx generate to output the signal to the PCB. I have noticed that the DAQmx gen frequency directly controls the ramps frequency.
However for the digital timing signals there is some scaling factor. The frequency of the digital timing signals can be set in the timing signals them selves. The sample rate in the analog signal also effects the frequency.
To get the frequencies that I need. I had to set the"create analog signal" sample rate at 2.778G S/s, the "create analog signal" frequency to 1.2889GHZ, and the DAQmx generate frequency to 1.66666 MHZ. At those numbers, I get the timing signals to output at 833.333KHZ and the second bit of the ramp at 416.6666HZ (for the ramp I upped it to 13 bit and I don't use bit 0, as it outputs at 833KHZ).
However at these settings all of my timing signals have the same phase, and the same duty cycle, even though I have them set differently.
Can someone please help? I think the issue is that I have the sample rate and frequency of the "create analog signal" block set too high, but if I set them lower my signals will not be at the right frequency.
Attachments:
timing signal 1.JPG ‏44 KB
timing signal 2.JPG ‏47 KB
daqmx gen.JPG ‏55 KB

Hi David,
We found that there seems to be a weird divider between the sampling rate of the analog signal module, the analog signal sample rate, and the f daqmx gen.
After various tests we made a chart of what we observed. Fsignal and sample rate are values set in the "create analog signal" module, Fdaqmxgen is set in the "DAQmx generate" module. We used a "create anaolg signal" module to create the square wave, then convert analog to digital convert the square wave to digital.
We have "repeated signal" and "N periods" checked.
Fsignal
Fdaqmxgen
Sample rate
Frequency   measured on the scope
1GHZ
10MHZ
100G s/s
100KHz
100MHZ
10MHZ
100G s/s
10KHZ
1GHZ
1MHZ
100G s/s
10KHZ
10GHZ
10MHZ
100G s/s
1MHZ
100GHZ
10MHZ
100G s/s
10MHZ
100GHZ
10MHZ
100G s/s
5MHZ
The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
To meaure the frequencies were using an HP 54600A oscilloscope, and probing standoff pins on our custom pcb.
We have several versions of the project, attached is the latest one.
Kyle,
How do I set the compression to false?
The picture below looks like labview? We are using signal express.
I can't change the frequency on the DAQ mx gen because I need the ramp to run at a set frequency.
There is a divider between the daqmx gen and the f signal. I have to set the Fsginal in the GHZ to get it to out at the right frequency. The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
Thanks,
Devin

Similar Messages

  • "create analog signal" programmatic control of parameter Duty Cycle

    I need to generate a square wave with a programmable duty cycle in LabView (not SignalExpress).  I can use "Create Analog Signal" for a fixed duty-cycle signal but I cannot figure out how to get at the Duty Cycle parameter to change it programmatically.  I was hoping for something like Property Node access but found that this only works for front panel objects.
    Is there a way to dynamically change the Duty Cycle parameter in the "Create Analog Signal"? 
    Solved!
    Go to Solution.

    The Square Waveform vi found in Signal Processing - Wfm Generation has an input at the top for offset.
    - tbob
    Inventor of the WORM Global

  • Measuring PWM duty cycle with Analog Input

    Hello folks,
    I have a NI 9205 module and was wondering if there was a way to measure the duty cycle of a PWM signal that I am generating with a separate microcontroller?  I have found a lot of examples with Digital inputs but not analog.. Is this possible?
    Thank you,
    Bob

    Hi Robert,
    I'm not sure what that error is, try searching for it.
    If you want to measure a PWM signal you would usually use a counter input.  A counter is a dedicated piece of hardware that is used to measure digital signals.  Since the NI 9205 is an analogue device and it doesn't have any counters onboard, you will not be able to select counter input.
    I would recommend you get the right tools for the job and buy a digital acquisition device with an onboard counter.  It will make reading PWM much easier for you.  The NI 6008 has a counter onboard and is only £99.  It will also offload processing from software to hardware since you don't have to calculate duty cycle.
    If you still want to use analogue post back and we can look into why its not working for you.  Tips to start you off: Voltage is the correct setting and  Look in the manual and make sure you have connected it like you have configured it (differential, RSE, NRSE page 14)
    Lewis Gear CLD
    Check out my LabVIEW UAV

  • Custom square wave duty cycle in signal express

    Hey everyone,
      I am using an USB X Series Multifunctional DAQ Model 6361, with labview signal express 11 on windows7 (version 9.3.5) and I am trying to figure out if i can change the duty cycle of a square wave.  I need to have one period be at 75% duty cycle and another 25% or something along these lines.
    thanks!
    Adam 

    Hi Adam,
    I believe another Applications Engineer has corresponded with you concerning this issue already. If you are looking to generate a truly custom square wave where the duty cycle changes from one period to the next then you will need LabVIEW as this functionality is not supported in SignalExpress. 
    Using the Analog Output along with the Create Analog Signals options will allow you to specify one fixed duty cycle for your square wave, but this will remain constant throughout the generation. 
    Regards,
    James D.
    Applications Engineer
    National Instruments

  • How can I measure a 0% or 100% duty cycle signal ?

    I want to measure the duty cycle of an input signal using a counter of a 6030-E board.
    I work with a PXI Rack under Labwindows/CVI.
    My program already works properly for duty cycle between 1% and 99%, but it is not able to detect 0% duty cycle (ie : signal to ground), nor 100% duty cycle (ie : signal to power supply).
    The problem is I don't understand how the counter works in such a situation (it cannot detect any edge, as long as the signal is continuous 0V or continuous 12V).
    Please have a look on the following code :
    1- First, the counter is configured
    // Reset Compteur
    i_Status = GPCTR_Control(iDevice, iCptID, ND_RESET);
    //Definition du type de mesure du compteur (mesure temps impulsion)
    i_Status = GPCTR_Set_Application (iDevice, iCptID, ND_SIMPLE_PULSE_WIDTH_MSR);
    //Definition de la vitesse d'echantillonage (20 Mhz)
    i_Status = GPCTR_Change_Parameter(iDevice, iCptID, ND_SOURCE, ND_INTERNAL_20_MHZ);
    //Definition du signal a mesurer (defaut)
    i_Status = GPCTR_Change_Parameter (iDevice, iCptID, ND_GATE, ND_DEFAULT_PFI_LINE);
    // initialisation du compteur
    i_Status = GPCTR_Change_Parameter(iDevice, iCptID, ND_INITIAL_COUNT, 0);
    // Preparation du compteur avant de l'armer
    i_Status = GPCTR_Control (iDevice, iCptID, ND_PREPARE);
    2- Then, every 10 ms, the value of the counter is read, so that I can calculate the duty cycle...
    i_Status = GPCTR_Watch(iDevice, iCptID, ND_COUNT, ul_val_cpt);
    3- ...and the counter is armed again for the next reading
    i_Status = GPCTR_Control(iDevice, iCptID, ND_ARM);
    When duty cycle changes from x% to 0% or 100%, the counter always keep the value corresponding to x%.
    Even if I reset the counter between each measurement, it keeps this value ! I don't understand how it is possible.
    How can I know that the counter didn't see any edge, and so that duty cycle is 0% or 100% ?
    Thank you in advance for your help !
    FraB

    Hi,
    Just have a look at this link, it can be interesting for you...
    http://forums.ni.com/ni/board/message?board.id=40&message.id=2161&requireLogin=False
    Regards
    DD

  • Duty cycle two AO signals with a square wave

    Hello,
    I am running two devices with sending two AO signals (sine wave) out simultanously in my code. I need to duty cycle my signals. in other words, I want to turn ON and OFF the devices continously.In order to do that, I am using a square wave generator with 50% duty cycle. The devices should be running when the square wave has positive values and should be OFF when it is negative. 
    The code almost does that, but it does not seem to be as fast as it is supposed to, based on the square wave's frequency. I was wondering if anyone can help me with this problem. In addition, I am not sure if this is the best method to do that, please let me know if there is a better way. I also attached the VI .
    Thanks,
    Pooya
    Solved!
    Go to Solution.
    Attachments:
    2AOsignal_dutycycle.vi ‏47 KB

    I am using NI-PCI 6071E with BNC 2120as an interface. I am not sure if the problem is the hardware limits. Attahced please find the subvis which I used in my main VI. 
    one of the which has a for loop (duty_cycle.vi) works just fine and the other one (duty_cycle(new).vi), which is the one I am using in my VI, does not. Any thoughts?
    Attachments:
    duty_cycle (New).vi ‏23 KB
    duty_cycle.vi ‏25 KB

  • Trying change duty cycle in "Simulate Signal"

    Hi, 
    Anyone knows why I can't change the duty cycle in Simulate Signal? This option appears unavailable for me. How I can access this option? I need generate a wave triangular assymmetric. 
    Thanks.
    Attachments:
    simulate signal.JPG ‏66 KB

    The dutiy cycle is only for square waves, i.e. a signal that only has two possible states (on or off). The duty cycle defines the percentage of the time the signal is on during each interval.
    In any of the other signal shapes, the amplitude is variable and the concept of a "duty cycle" makes no sense.. 
    LabVIEW Champion . Do more with less code and in less time .

  • Problem when combinning PWM signal and Analog signal TOGETHER!

    Hello everybody,
    first of all i have DAQmx 6212, and i need to run a small water pump (9V-16V) which needs to be driven by a PWM signal; also i have a motor (5V-13V) for a water valve that needs to be driven by a analog signal and it has a built in a force feedback potentiometer, i connected on the extremeties of this potentiometer +5V from the DAQmx and used the output voltage from the third extremety as a diagnose value for knowing the position of the motor.
    my VI shows:
    1. is a normal Counter output to create my PWMout signal.
    2. is an analog input i use it as a PWMin to the LabVIEW to diagnose what is happenning in my water pump through the duty cycle and the frequency.
    3. is an analog input from the third extremety of the potentiometer.
    4. is an analog output which i have used as a power supply for the motor valve and i have used an AC/DC amplifier to aplify the signal from the DAQmx and drive the motor, between (3. and 4.) i have made a feedback with some calculations i had a P-controller to know the actual position of the motor valve.
    My Problem:
    when putting 1. and 2. in the same VI alone, i am getting a clean PWM in/out with no problems mentioned;
    also when putting 3. and 4. in the same VI alone i can control the motor valve without any problems;
    but when i put all these 4 together as found in the attached VI, i have a problem that the motor valve is running continously without stopping even if i change the valve position between 0 and 100 %, i should mention that i am seeing a normal PWM out/in signal on my oscilloscope, one other thing that if i delete one of (1. or 2.)  and run the VI the motor valve is working fine without any problems.
    so this my problem, if you can think of any solution please let me know.
    thanks in advance for your help.
    Regards,
    Alosh
    Solved!
    Go to Solution.
    Attachments:
    pwm.out.in.analog.out.in.vi ‏45 KB

    Dear nathand thanks for your reply,
    i have ran the vi again and i am have error no 50103 from the (AI, number 3. )  but it is not displaying the error message, the VI keeps running without any error notification.
    adding to that,  i have tested the VI again today by placing (1. and 2.for the PWM inout) together in one VI and (3. and 4.for the motor valve) in another VI and ran them one after the other, i had another problem. if i turn the motor valve vi, the motor will run smoothly but in the pwm vi i will have a problem in which the AI did not read any value. also doing this vice versa by running the pwm vi first it will work perfect but the motor vi will have problem in reading the measured voltage in AI during this the motor will keep on running without stopping.
    so i think now the problem is in AI (2. and 3.) readings they are interfering on each other but i am not discovering where is my problem...
    Q: does the AI's seems well build or i can do it in an another way so to get over the interfering?
    Regards,
    Alosh

  • Solenoid Duty Cycle Time

    Hello. I can not reduce duty cycle on my Solenoid less than 0.1. Actually I use the NI USB6008 by Analog Putout. I gave the Square Wave to generate the Splendid. In my case, the frequency was 0.1 Hz. Actually I want the Solenoid can give impact as fast as possible and not more than 0.1 (s) for ON TIME equivalent to 0.01 Duty Cycle In my case. 
    Anyone can tell me how?

    I already chosen sampling Rate 150 (Hz) timing by driver.
    I use Display 10, NIDAQmx with Measurement & Automation Explorer version 4.50f0.
    I connect the NIUSB-6008 analog output to a relay circuit to generate the solenoid at 12 volt that is supplied by DC power.
    I defined output task as analog output with Generation Mode: 1 sample (on demand).
    Today, I just get that the NIUSB-6008 doesn't output any signal when I set dutycyle less than 0.01 0r in my case 0.1(s), but it works when if I output at less 1(s). I use an oscilloscope for this testing.
    I understand that if the NIUSB-6008 support 150 (hz) sampling rate that mean that I still get 1 sample every 0.0067 (s), it is more than enough for my requirement 0.1(s).
    do i still lack of something?

  • 在LabVIEW SignalExpress裡如何使用 Create Analog Signal 產生低頻方波與高頻方波調變的訊號

    各位先進大家好:
    之前想要利用 Create Analog Signal產生一個低頻的方波與40k Hz的方波調變的訊號,
    但不論如何調整 Create Analog Signal裡面block size或是sample rate的值,
    所得到的兩個pulse的間距都沒有改變,(例如固定block size的值,調整sample rate,兩個pulse的間距都沒變,反之亦然)
    參考下圖:
    目前已有成功地產生出上圖的訊號,但卻不知如何調整設定使pulse間距能夠縮短(意即如何改變低頻方波的duty cycle),
    而整體的設定如下圖:
    雖然之前已有先進解釋過block size與sample rate的意思,
    但在方波的調變上仍然有疑惑,
    不知是否還有其他的參數要調整呢?
    還請各位先進不吝指教,謝謝~

    基本上您在SignalExpress調duty cycle, block size等,調的都是綠色框所示的部分,也就是你產生方波的duty cycle與綠色區塊的block 要多大。
    你會看到紅色區域的間隔是由於訊號產生輸出後,軟體重新restart 下一次的任務的間隔,因此才會沒有波形輸出。你可以用post-execution delay來加大他的間隔,以ms來加大(因為PC的clock是1KHz),但是沒有辦法縮小得更小,因為最小就是0ms,也就是輸出訊號後DAQ close task馬上重新開始下一次task的最小迴圈間隔。
    建議您使用Analog Waveform Editor先將波形編輯後(包含無訊號的間隔與有方波的地方),最後以continuous output連續輸出來達到這樣的效果。
    或是單純用LabVIEW來做,也是可以先將欲輸出的訊號寫好進buffer,最後以硬體clock作連續輸出。

  • Frquency & Duty cycle Value changes- every time

    Hello all
     im using pcie 6320 to measure the frequency and the duty cycle of a signal.i have attached my vi & the data measured for reference.The values highlighted in red ,is my actual frequency and duty cycle but values changes for every 1 sec.Please correct me if i have any mistake.
    Solved!
    Go to Solution.
    Attachments:
    measure frquency-duty.vi ‏54 KB
    HZ-DUTY.JPG ‏37 KB

    You'll need to enable digital filtering--insert the following property node into your code (call the property node before starting the task):
    Try a "Min Pulse Width" of a few us and increase it if you still are picking up incorrect readings.
    The errant numbers are coming from false edges being picked up during transitions, enabling digital filtering will cause the DAQ device to ignore any transitions with a pulse width of less than the set value.  Your 475 Hz 72% duty cycle signal should have a high time of about 1.52 ms and a low time of about .59 ms):
    656 Hz = ~1/(high time)
    1718 Hz = ~1/(low time)
    MHz values = multiple edges picked up during a single transition.
    Best Regards,
    John Passiak

  • Dynamic Duty Cycle Change for PWM

    Hello savvy LabView people out there!
    I am trying to do PWM for servo control using LabView.
    I have been able to manually move my servo with this: http://www.ni.com/white-paper/2991/en
    My goal is to automate the servo position as a sinuisoidal movement, and to do so,
    I need to automate the duty cycle to oscillate in 5%~10% automatically over time.
    I have looked into some stuff as:
    http://forums.ni.com/t5/Counter-Timer/PCI-6602-PWM-GENERATION-Dynamic-sine-duty-cycle/td-p/1522442
    But it was not too helpful, as I was also getting Error -200301.
    I want to be able to move the servo position at ~10Hz, if that is important, and the square wave freq. for the
    servo signal (PWM) has to be 50Hz.
    Any help? Thank you!
    Attached is what I am trying to do. The sine motion of the servo is (supposed to be) actually paired up with
    an analog output from a BNC-2120 board. The servo control part is separated on the top portion.
    Solved!
    Go to Solution.
    Attachments:
    ServoTest3.vi ‏110 KB

    Is something like this for the PWM look like what you had in mind?
    (see attached)
    This works, but I need something that responds faster.
    For example, the PWM needs to be at 50Hz, which means the loop delay should be able to
    go as low as 20ms
    In the picture, it is currently 200ms, and this does not run. I found that with 50Hz, the minimum
    delay that the Error 200301 doesn't pop up is with 500ms delay, at which point the
    accuracy of PWM duty cycle in each period is compromised.
    Is there a way to have the loop delay be as low as ~20ms?
    Attachments:
    Servo.jpg ‏52 KB

  • Is there a way to reverse the active/inactive portions of the duty cycle?

    I'm trying to sync the start times for an AI operation and a buffered encoder read. These two operations happen at different sampling rates and different sampling intervals, so I can't just port the AI scanclock over to the gates of the encoder counters.
    My approach is to use three counters: one to generate a triggered pulse that has a width equal to the total sampling time (the trigger for this pulse comes from the AI start). The OUT from this counter then feeds the GATE for a counter that generates a pulse train while the GATE is high. Therefore, it generates a finite pulse train for the desired acquistion time. The out from this second counter goes to the GATEs of the encoder counters to
    generate the DMA transfers.
    The problem is that the pulse train always puts the active portion of the duty cycle at the end of the period, so the DMA transfer happens at a delay of T/2 relative to the start of the AI acquisition.
    Is there a way to put the active portion of the duty cycle at the start of the period? i.e., when the gate goes high, I want the pulse train to start high then go low at the end of the duty cycle.
    Thanks,
    rgames

    The simplest seeming answer would often be to use 'Set Attribute.vi' to change the counter's output polarity. Then the counter will be at a high state during the delay and low during the pulse. However, that would also put it in the high state while armed and waiting for the trigger, and again after the pulse completes. It doesn't seem like that would work for you.
    A near-miss idea would be to leave the polarity alone and simply specify the shortest possible delay. Use the internal max timebase as a source and set "Pulse Spec 1" == 2. On a 660x device, that'll only delay you by 25 nsec.
    In fact, you may be able to change that near-miss into a perfect hit. The short delay may or may not change the timing of the DMA transfers relative to the trigger, depending on exactly how the "generate pulse train while gate is high" function is implemented. Here are some ways I can imagine:
    A. The "pulse while gate is high" counter is always cycling internally. An output signal is always being generated on the TIO chip and is always being AND'ed with the state of the Gate signal coming in. The result of the AND is sent to the actual IO pin.
    B. Similar to (A), but the AND'ing is done only when there's a state transition and the result is latched until the next state transition.
    C. Internally, the pulse train counter always *wants* to run, but its Source is always being AND'ed with the Gate signal. Then, as far as the pulse train counter is concerned, time is frozen when the Gate is in the inactive state. This is how I *think* I remember it working.
    In cases (A) and (B), the timing of the DMA transfers wouldn't be affected except for the rare case where the trigger event occurred within 25 nsec of a "scheduled" transfer. In case (C), you can compensate by changing the duty cycle of the "pulse while Gate is high" counter. Simply subtract 2 from "Pulse Spec 1" and add 2 to "Pulse Spec 2". Then (assuming its polarity is low state delay, high state pulse) make sure the encoder counter Gate is set to do DMA transfers on the low-->high transition.
    Final note: if timing synchronization between analog and encoder is really important, there may be a better way. As I recall, the AI start signal does not have deterministic timing relative to the actual A/D conversions. You might instead have two counters of the 660x set to "pulse while Gate is high" and set up the other one to be the AI scan clock. Then you'd be more fully in control of their time==0 marks.

  • How can I vary a PWM´s duty cycle inside a while loop?

    Hi,
    I'm using the "Generate Pulse Train.vi" to generate pwm signals in counters 0 and 1 in order to drive a DC motor both ways.
    The problem is, I need to control the movement of the dc motor with my PI controller which is inside a while loop. I've tried letting the "generate pulse train.vi" outside the while loop, but the problem is, it only changes the value of the duty cycle when the loop is stopped. I also tried putting it inside the loop, but then it doesn't even work.
    So, how can I vary a PWM´s duty cycle inside a while loop?
    I'm attaching the VI with the PI controller.
    Thanks for your help!
    Guilherme
    Attachments:
    controleValvula.vi ‏332 KB

    Here's some code I threw together a while back to change a duty cycle on the fly. It generates a fixed 5KHz or 25KHz frequency depending on laser selection, then allows duty cycle to be changed continously. Maybe you can use the premise of it for your application.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    Attachments:
    Pulse_Width_Modulator.llb ‏197 KB

  • How to generate a pwm whose duty cycle has to be varied depending on the frequency of the input trigger??

    Sir/madam,
    I am quite new to the Labview FPGA module. 
    I am currently working on an application where i have to generate a pwm to control the ON time duration . The pwm ON time depends on the frequency of an input signal.I want to retrieve the ON time value from a lookup table which contain the duty cycle values for the pwm at different frequencies of the input.This input also has to work as a trigger. The input is pulsed and the trigger has to generate the pwm at every rising edge. I am using a PCI 7831R-  RIO series. I am urgently in need of some help and i have hardly a  couple of weeks before i meet the deadline.
    I am trying hard to learn the basics from the shipping examples but not able to quite make my vi work. 
    Kindly lend a helping hand and i would be very grateful to anybody who can help. Thanks a lot in advance.
    Do ask in case of any clarifications required. I  think i have explained my problem quite well. 

    Hello Manu,
    You can refer 
    Developing a PWM Interface using LabVIEW FPGA or PWM Output with LabVIEW FPGA
    How this helps.
    Best Regards, 
    Hardik Asawa
    AE
    National Instruments  
    Message Edited by Hardik Asawa on 05-05-2010 12:46 AM

Maybe you are looking for

  • Problem in Claim Advances in ESS

    Hi All, When we are raising a Claim Advance request in ESS It is giving the msg Sent for approval. But It is not coming to Approver's Inbox (UWL). What might be the reason . Please help. Thanks, Punam

  • Why won't my iMessage let my add my phone number?

    I am new to iPhone and can't get my IMessage to use my phone number as a receive at point. All the how to's I've read about it says you can. Someone please help.

  • Sold to party in QA32

    Dear Sir In T-code QA32 we want to sold to party to be displayed but no data is coming its blank only sales order comes please guide regards kunal

  • DMS business blueprint

    hi all, basically i am mm consultant ,now I am alloted a new project in DMS module.Please help me in getting the following.. 1. SAP DMS Business Blueprint 2. Question - Answer Database of Client. my mail [email protected] useful help awarded be sure.

  • Convert Varchar to Hour

    Hi, I have a field DATE. This item contain a Date. But I have other variable varchar that contain hour (hh:mi:ss). I have to convert this varchar to a hour ant concat with the Date Field. How can I do this? Thankss