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

Similar Messages

  • 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 .

  • Read duty cycle of a PWM with DAQ

    Hi,
    I am doing a test system and I have several signals that control motors. They use PWM with a max frequency of 5 kHz.
    I would like to know if with a USB DAQ or a PCI DAQ for example PCI-DIO96 could I meassure the duty cycle of these PWM signals. I mean I need to meassure with 10kHz at least.
    Which are the read frequency of these systems?
    Due to the high number of I/O to test I am also thinking of using Compact-RIO with different I/O modules. What do you think?
    Thanks in advance

    If your PWM frequency is 5 kHz and you want to measure duty cycle to 1%, then you need timing resolution of 2 microseconds or faster.
    The USB-6343 has hardware timed DIO at up to 1MHz, so it might be suitable.  There are other devices with hardware timed DIO at rates of 10 MHz or faster as well.
    Before you buy, determine how often you need to measure the duty cycle to make sure the data transfer can keep up.  USB can sometimes be a bottleneck.
    Lynn

  • How to make a synchronous acquisition of two analog signals with a one channel DAQ ?

    Hi !
    It is the first time I use Labview. I have just made some easy VIs, and now, I do not know how to deal with my problem...
    My problem : I have only one acquisition card (DAQ Ni 6034E) and I would like
    to acquire simultaneously two analog signals. It seems to be possible, in a quasi-synchronous acquisition if the card acquires one point of the first signal, then the first point of the second signal, then the second of the first signal, and so on ... I thougth that I could made two sequencies with a VI of data acquisition in each sequency, with the AI MULT PT. But with this, I think that I will lose the precision of the sampling frequency. And I have to know the sampling fre
    quency ...
    Thanks for your help !
    Carline

    Hi Carline,
    A PCI-6034E is a low-cost board, which only has one Analog to Digital Converter (ADC).
    With only one ADC you can't acquire different channels at the same time. That's why you find a multiplexer before the ADC in this type of board. This enables you to acquire multi-channels at the same rate quasi simultaneously. The samples of the different channels will be interleaved as it is explained in the following knowledge base :
    - http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9379ea091c264b7c86256bc90082ca5d?OpenDocument.
    With this method, the sampling frequency is the same for all channels. The sampling frequency of one channel is determined with the "scan rate" parameter. There is only a small delay between the samples
    of each channels. When you perform an interval scanning acquisition, this delay depends on the "sample rate" that you specify. To have more informations about this terminology, please refer to the following KBs :
    - http://digital.ni.com/public.nsf/websearch/4D1435DF82EF494186256D8A006DD6D4?OpenDocument.
    - http://digital.ni.com/public.nsf/websearch/4D1435DF82EF494186256D8A006DD6D4?OpenDocument.
    To easily perform such a multi-channels analog acquisition, you can use the VI named "AI Acquire Waveforms.vi". You also can use an example provided with LabVIEW. You just have to browse the NI Example Finder in "Harware Input & output >> Traditional NI-DAQ >> General".
    Best regards,
    Benjamin
    National Instruments France

  • The measurement of the phase between two sine signals with NI 6251

    Hi, I am working with NI 6251. I need to measure the phase between two sine signals. I used "Tone Measurements" on each signal and then substracted there phases, but the result was  incorrected. Please, help me to solve this problem.

    You should have a look at the Signal Processing VIs
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • IMac -- Compatible with UPS Square Wave Voltage

    I have been reading of the incompatibility of UPS square wave outputs of UPS devices and the new energy star 4 or 5 computers. The new iMac is energy star-5 compliant. The power supply output of a UPS will not work with new computers.
    Does anyone have any information on this issue?

    I’ve been trying to find the same answers for my 24”, intel,Core 2 Duo extrerme, 2.8GHXZ, iMac (mid 2007) that Apple Engineering says has Active Power Factor Correction power supply.
    All I want from an UPS is decent time to unmount my external H.D., save my working data, and shut down the iMac properly. After the better part of two weeks I believeI have found the answer for my situation. Disclimer: I am not a tech nor experienced in electrical matters but just a guy who hung in there trying to make sense out of many conflicting bits of information. This is not meant to tell you what you should or should not do. Just what I believe I’ve found and what I have done about it
    after talking to lots of tech people. Corrections/updates welcomed!
    1. Apparently, there are some recent models of computers that have an updated power supply commonly called Power Factor Correction power supply (PFC), more specifically called Active Power Factor Correction Power Supply. As I understand it they were previously found mostly in the higher end of computers and not commonly found in the type that the average guy would use. Now Apple Engineering has told me via Apple Care that my 2007 iMac has an Active Power Factor Correction power (akaPFC) supply and that all wide range voltage supplies are PFC. I take that to also mean late model iMacs and most likely Mac Pros have this type of power supply.
    Mine has it and it is a 2007 iMac, I’m not sure when they started using it in iMacs.
    2. So what ? Well, if you tell an UPS mfg. your computer has an Active Power Factor Correction power supply or even if you drop the word “Active” (and use PFC) they will commonly say you need an UPS battery that sends electricity via a Pure Sine Wave to the computer. They are very costly units, easily $500 and up.
    3. What is an Active Power Factor Correction power supply, aka Power Factor Correction supply (PFC)? Paraphrasing and editing a statement from a battery mfg support page: Although a computer power supply draws only a fraction of its full capacity during its steady state (normal) operation, Power Factor Correction (PFC) supplies have the potential to draw their full capacity ( which I assume is the stated watts on the computers data sheet), instantly when passing battery power to the computer’s Power Factor Correction power supply.
    So what? well, the UPS may experience up to 8ms transfer time during this period which is just long enough to remove power from the computer’s Power Factor Correction supply which subjects the UPS to the maximum power draw of computer’s Power Factor Correction supply (PFC). This could result in a potential UPS overload or dropped power load ( computer restart, shut down ) because the UPS does not have the ability to furnish the amount of demanded power (watts).
    4. I solved my problem of what kind and reasonable cost UPS would work with my Intel iMac after talking with APC , local Apple Authorized repair & CyperPower. First I determined the max watts draw of my iMac x 3 ( to allow sufficient excess watts when in an instant max watts demand from the Computer’s Active Power Factor Correction power supply ) and added the max watts draw of my external H.D. and FIOS Router to determine the total UPS watts that would be required to aid in the UPS selection process.
    I purchased a CyberPower UPS model CP1500AVRLCD 900W , which successfully sent Simulated Sine Wave power just fine to my computer’s Active Power Factor Correction power supply when testing it two times. No need for costly Pure Sine Wave UPS. Cyberpower says this unit will work with the iMac but not work with the Mac “Tower” / Mac Pro and I suspect it has to due to the huge difference between them in maximum watts that can be instantly drawn when the Active Power Factor Correction power supply instantly demands the full watts power from the UPS.
    APC UPS model BR 1200 (also a non pure Sine Wave UPS) is recommended by a local Apple Authorized Repair facility (vendor) to his customers as working with the current iMacs.
    I personally think the difference in working and not working is getting the right amount of excess watts in the UPS, can’t think of any other reason it works. I really don’t care as long as it works.

  • Two harmonic signals with time difference to one modulated signal

    Hi LabView experts,
    I'm not realy good in using lab view, but I need the visualisation for my diploma thesis.
    I know how to creat a sin wave and I know how to creat a modluated signal out of to different sin waves.
    but I want to creat a modulated signal where the HF signal is starting later.
    So first you have the low frequency sin wave and maybe after one sec. the high frequency signal will be modluated on top.
    It would be great if someone could tell me how to do that.
    unfortunately I'm using labview 7.1 so I will not be able to open newer files..
    thank you very much!!

    It's a bit long to explain what you did wrong.. 
    First thing.. STAY AWAY FROM STACKED SEQUENCES!!!    Sorry for shouting!  But I keep praying that NI will remove those horrible things!
    Stacked Sequences are annoying because they make you loose sight of the dataflow that goes on inside the code.  Forcing sequential actions is not a good thing in Labview.
    Have a look at the attached code.  It will do what you wanted.  It can still be improved, such as changing the For Loop to a While Loop and have the graph update as run run the VI, instead of a fixed number of iterations.
    Let me know how it goes..
    RayR
    Message Edited by JoeLabView on 06-13-2008 08:43 AM
    Attachments:
    modulation.vi ‏30 KB
    waveform.PNG ‏22 KB

  • How can be time implimenting in Square Wave Point By Point .vi

    i want to use "Square Wave Point By Point .vi" but i can not understand how to put time value.

    Hello,
    I understand you wanted to use the mentioned vi. So the thing is the inputs that you can see are not compulsory or required inputs. Those are recommended inputs which you can use if you have a requirement in your application. So in thise vi as you know the duty cycle will define the time a square wave remains high versus low over one period. Morever the output of the square wave will be as follows:
    square wave = amplitude × square (p)
    where
    square(p) = 1 if [ (360. frequency. time + phase)mod(360)] is < [360. duty cycle(100%) / 100]
     and -1 for other cases.
    So from this equation you can work on your application and decide if you need any time input at all or not.
    Hope this helps.
    Cheers..!! 

  • 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

  • Duty cycle on SCXI Modules

    Hi All!
    I was wondering if anyone could tell me if there is an SCXI Module available that allows me to adjust multiple duty cycles. I need to control the duty cycles of multiple signals simulataneously and was hoping to find a module to do this with. It should be a module that fits to an SCXI housing because this is the system that I am currently using for the measurements. A single module containing multiple counters and counter outputs would be ideal.
    I am sure I am not the first to need something like this, so could someone please help me out and tell me how I can solve this?
    Thanks to everyone for the help!
    Regards
    Charel Marais

    Hi Wolfgang,
    Yes I was thinking of PWM for the duty cycle control. I have done this before using counters on the NI cards, but as you mentioned it is only possible to control 2 signals. I now need to do at least four, possibly more. The system I am using now is a 6036 PCMCIA card as acquisition connected to an SCXI 1000 with an 1102, 1126, 1163R and 1124. I have considered using another DAQ card to provide more counters, but this is a very untidy solution when you have two PCMCIA DAQ cards in one notebook each with a cable going into it. The connectors push very hard against eachother and in long term use, this will destroy the connectors on the cables, the cards and the notebook.
    I gather that there is no SCXI module available that provides counters as a normal "slide-in" module (like an 1102 for instance)...? Is there then some other effective way to connect two PCMCIA cards to one notebook?
    Thanks for the advice on the counter cards.
    Regards
    Charel

  • How to calculate the phase difference between two square wave (acquired from two channel in one DAQ)

    Hello everyone ,
     I need a quickly help that as below :
    I am trying use PCI-6220 to acquired six signals from one rotation encoder (channel A, channel B,channel Z ,and their non-signals) .The encoder out signals will be square wave and 4000pulses per revolution. I set it rotation at 300rpm speed. I need show every square wave of six out channels in waveform and measure the A-B phase difference to check if the value is correct (designed value should be 90deg) .
    I have no idea how to measure or calculate the phase difference of two square wave base on synchronizate to acquire these two square wave from two channel on the PCI-6620....
    Anyone can give a idea how to calculate the phase difference with two square wave ?
    Thank a lot and Thanks again...
    Tim

    Tim,
    Here is a simple rising edge detector for one channel.
    Lynn
    Attachments:
    Rising edge.vi ‏15 KB

  • Duty Cycle

    how to generate a waveform with the duty cycle?
    Pls reply soon
    Thanks,
     Jinal

    Hi Jinal,
    Look in the examples folder, there is a function generator example with a square wave function that allows you to change the duty cycle.
    labview\examples\measure\maxmpl.llb - Function Waveform Generator.vi
    ssk

  • 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

  • Creating two sin signals using function generator.vi example

    hi all. i want to create two sin signals with different parameters using function generator.vi example. i tried to modify the example by copying the code and try to output two sin signals on different channels of the DAQ but error message saying that you are validating of the AO write buffer . attached is the file. how can i modify it to solve the problem?!
    Attachments:
    function_generator2.vi ‏123 KB

    Nidal,
    Below is an example that illustrates how to generate different sine waves on two separate analog output channels.
    Example

  • Calculate Duty Cycle

    Is there a function or add-on to Diadem to calculate duty cycle from a raw PWM voltage signal?  

    Hello RussellSenior,
    Unfortunately, there is no such function in Diadem. However, you can develop a script which counts the up time and the down time. Base on those information, you can get the duty cycle of your signal.
    Carmen C.

Maybe you are looking for