TWO independent square wave generators on sbrio9632 fpga

I am using sbrio9632, I need to generate 2 different PWM signals for driving 2 different motors in the same time. I`ve put 2 square wave generators but when I change the parameters (frequency, duty cycle) of the first generator, the parameters of the second generator are automatically changed. So i supose that there is only one square wave generator that can be used. Any solution ? Is it possible to use 2 different square generators on the same board ?
Thank you !

The Square Wave Generator is a little quirky when operating outside of a Single-Cycle Timed Loop, because it needs to ensure that it is called at a rate that will produce the edges of the square wave with precise timing. So it operates similar to a loop timer, in that it blocks execution until it is ready to output a high-low or low-high transition. See the example at examples\R Series\FPGA Fundamentals\Analysis and Control\Square Wave Generator\Square Wave Generator (FPGA).vi for more information.

Similar Messages

  • I need help adding two signal waveforms from a square wave generator using an or gate

    Hey Im working on a square wave pulse signal that can be displayed using an FPGA board. I have two different pulses (signal 1 and 2)  generated from square wave generators on LabVIEW each with equal duty ratios but different phase offsets. I need to add the two pulse signals together to get another signal (signal 3) showing two pulses (from signal 1 and 2). I have tried using an Or gate but that wouldnt work as expected. Please I need some guidance on how to implement this boolean logic, P.S. Im open to any other solutions. Thanks.
    For clarity: Imagine signal 1 = 00001000
                                       signal 2 = 00100000
    I need signal 3 to be             =  00101000, I hope this emphasizes my point.

    The problem is with the third function from the left.  Oops, I forgot, I'm not clairvoyant.  Maybe if you posted your code, we could really tell you if the problem is the third function from the left ...
    Bob Schor

  • 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

  • I have generated two square wave forms using NI-9221. These two Square waveforms are suppose to be 90 degrees electrical from one another.

     I have two square wave forms from an encoder wheel. I can not seem to generate or calculate the phase of the waveforms. I have tried to extract the data but it is not accurate? I can not use a true false statement with the extracted data either. I have to have the one waveform 90 degrees electrical from the other waveform. Any Suggestions?

    Fist thank you both for responding so quickly. I am using a half encoder wheel and the waveforms are certainly show the phases correctly.  The operator of this program will not have access to the graph only the data and measurements collected. The reason I am trying to get the phase is because that is going to be a major factor in if the board passes or fails. I extracted the phases from the waveforms but it’s not accurate at all. I think I may try to trigger when to measure the wave and when to stop measuring. Is that Possible?
    J. Powell

  • 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

  • How do I Fix DDS Generated Sine Wave That Produces a Periodic Square Wave?

    Hello,
    I'm an undergraduate researcher with almost no experience dealing with FPGA semantics and other National Instruments hardware in general.  Part of my project revolves around creating a sine wave signal via the FPGA on an sbRIO-9632 that is output via the board's analog I/O pins, and I found it convenient to adapt the code provided by the National Instruments tutorials (http://zone.ni.com/devzone/cda/epd/p/id/6066) to have it run on an sbRIO FPGA.  The problem I'm encountering right now is that the actual output I'm seeing is a square wave as opposed to the smooth sine wave that was expected, and I've exhausted all my ideas on possible ways to debug this issue.  Can anyone please give me feedback if they've seen this problem before or offer other suggestions on fixing this?
    I'm currently running LabVIEW 2009 with the appropriate real-time and FPGA modules on a 64-bit Windows 7 machine.  Again, the hardware is an sbRIO-9632 complete with analog I/O.  I appreciate it everyone!

    I am also having this issue and have not been able to find a solution in the forums. I am somewhat of a rookie so pardon me if I seem ignorant in any way. I am working on a graduate project where I need to produce some sine waves and I am getting more of a square wave when I output it and measure on the scope. The program I am running is quite simple at the moment to attempt to discover any errors by process of elimination. I have the sine wave generator in a while loop outputting to an AO port. I am using the cRIO 9022 with the 9269 AO module. I will attach screen shots of my code and my oscope image
    Attachments:
    sine wave.jpg ‏76 KB
    code for project.PNG ‏169 KB

  • I am using an NI PCI 6024 E board device for an analog output application. Can I generate two independent waveforms, one on each analog output channel?

    I am using an NI PCI 6024 E board device for an analog output application. Can I generate two independent waveforms, one on each analog output channel? In attach I send a example of my vi to control one chanel, but i need to control both but with diferent waveforms.
    Is the vi correctly programed to this propose?

    Yes you should be able to do that. look at the signal generation examples shipped with LabView
    You can create a 2 D array, with each row representing a wave form per channel. The number of points of the wave form (per row of the 2 D array) represent the number of points in the output buffer
    The wave forms can have different amplitudes/shapes, and therefore they are independent in this sense.
    However, you need to set the update rate,which is the same for both channels. The update rate together with number of points per buffer determines the frequency of the wave forms. This means the two wave forms will have the same frequency.
    To have different frequencies, you need to have say, on wave form with one cycle per buffer, and the other waveform have 2 cycles
    per buffer. in a case like that the frequency of the second channels is twice that of the first channel, and so on
    The two wave forms are then not truly independent, they may have different amplitudtes/shapes, but related in frequency.

  • Phase shift of a sine wave and a square wave

    Hi,
    I would like to simply compute the phase shift between a sinusoidal waveform and a square one. Between two sin-s I can compute, but I have no idea how to do that with a square waveform.
    Thanks,
    Ussr123

    Hi there,
    the easiest way is to use the ExpressVIs.
    But you are only allowed to use the ExpressVI "Tone Measurements" if you have enough periods of the square wave, because it computes the phase with FFT.
    An other possibility is to use the spectrum analyser VI as used in the attached exsample.
    Greetz
    Branni
    Attachments:
    Phaseshift_Sqr_Sin.vi ‏89 KB

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

  • I can not read Analog input (a square wave)

    I am programming with Labview 7.1 on FPGA. The hardware is PCI7831. With CB-68LP connector, I connect analog input (a square wave generator) to AI0+(68) and AIGND0(67). I try to read it with waveform chart. But I can't get a square wave on the screen. I did check the square wave generator's output. It is correct. The connector CB-68LP connected with PCI7831 on analog port.
    I am runing the program on emulation, not on real FPGA.
    Thanks

    Signal generator I used is 3010 function generator for BK precision. It is an old instrument. I probed output signal from this generator on oscilloscope with signal generator output conected to oscilloscope probe (+) and signal generator ground to probe (groud). It is a square wave.
    I suspect the teminal I used for I/O port to PCI7831. Because my coworkers installed the hardware for me, he is absent recently. The terminal is CB-68LP  from NI with numbers ( 1 to 68) to specify each connector on it. And I got a SCB-68 Quick Reference Label sheet on my desk to specify numbers correspanding I/O port (for example, 68 -- AI0+). I suspect if this SCB-68 Quick Reference Label sheet matches the terminal CB-68LP?
    I will talk to my coworkers next week.
    jason

  • Calculate Square wave Duty Cycle

    Hello everyone,
    I'm acquiring (with USB-6212) a square wave, "100Hz" with variable duty cycle - which can be 20%, 50% or 80% - for matters of decodification; the acquisition frequency is set to 4k. Actually, I said the frequency is 100Hz, because I get a rising edge every 10ms, but the length of the high level is defined by the communication protocol and that is what I called duty cycle (even though this does not match the exact definition of this property)
    Since I need to decode the information contained by the wave, it's necessary for me to be able to tell what the duty cycle is. I've acomplished this so far by taking the derivative of the signal, then calculating peaks and valleys index in the waveform and finally subtracting them, as shown below.
    It works ok almost the whole opeartion, however, the acquisition is not 100% exact. Sometimes I get the signal in the picture A, that is ideal for what I intended.
    Other times, the signal is like B and the derivative amplitude does not cross my threshold, even though there is a rising edge there. I could lower my threshold to 2, for instance, but then I'd get vulnerable to the signal in picture C, which would accuse 2 peaks, instead of just one.
    Anyone have an idea on how to work around this or any other method more reliable than taking the derivative of the signal?
    Solved!
    Go to Solution.

    Well, we can only answer question based on the information supplied!  The LabVIEW Mind Reading Toolkit is still in development.
    Your application is one where parallel loops may be valuable.  In the acquisition loop you read data from the data acquistion device at a rate which optimizes the DAQ perfomance (the >= 2k points you mentioned).  The data is transferred to an analysis loop via a queue. In the anaylsis loop you can put the data into a shift register.  When more data is available from the Acquisition loop, dequeue it and append it to the data in the shift register.  The Duty Cycle section will find two consecutive rising edges and the falling edge between them ( the 10 ms segment).  It calculates the duty cycle for that segment. Then it uses the second of the rising edges as the first rising edge for the next segment.  Repeat until duty cycles have been determined for all segments.
    There are a lot of details which can be imprortant in a process like this. Many of them are dependent on other things you have not specified.  What will be done with the duty cycle values? Is the raw data to be displayed? Saved to file? Discarded after the duty cycle is measured?  How long will the process continue?  How much data can accumulate?
    Lynn

  • Creating a square wave

    using mathematical formula without using square wave function. Is it possible?

    Who said anything about manual operation?  Setup a loop.  Every so many iterations, you toggle the boolean.  If you toggle every iteration, it looks like a triangle wave.  But it should be a good start for you.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    triangle wave.png ‏22 KB

  • Multiplexed Square Wave

    Hy to all
    I'm working on a project where I have to build a sensor. I'm using 8 analogue outputs and 8 analogue inputs. On every output I have to send one square wave impulse positive and negative with various amplitudes. But they have to be multiplexed, that means first the impulse has to be on output 1 and all imputes have to read the data, then the first has to be 0 again and the next output 2 gets started.
    I've written a program and it logically works fine, but as soon as I run it on the FPGA noting happens. It takes 45 min to compile and I don't know what the problem is. I wanted to measure simply the output with an oscilloscope and the is no signal. 
    If you have time can you look at the program and give me some ideas what the problem could be.
    Thanks
    Attachments:
    Vire Mesh 3 (FPGA).vi ‏779 KB

    hello,
    it looks like a timing problem. Here are a few tips:
    1. the output is in the same loop as the input, but the inputs have their own loop afterwards. This means that the output is written a little too infrequently and is therefore not updated. You should probably separate input and output. Also check the calculations at the top to make sure they don't generate values that are out of the ordinary
    2. you can create the square wave in a separate loop and pass its value with a local variable to other places in your code. This is also good to test the output without interference from the inputs.
    3. you really don't need to connect the same wire in parallel to your sequence structure. Just pass it in once and reuse the same wire in every frame. It will make it easier to read.
    Regards,
    Joseph

  • Using pulse width modulated signal (square wave) to control when a signal is turned on or off

    Using pulse width modulated signal (square wave) to control when a signal is turned on or off
    Greetings All
    I'm trying to use a labview created pulse width modulated signal (square wave) to control when a signal is turned on or off.
    Here's my logic and graphic example:
    1) The source wave signal is continuous
    2) Use a PWM (square wave) created in labview to control when the signal is turned on or off
    3) If PWM signal (amplitude) is greater than 0 play signal if PWM is not greater than 0 don't play signal.
    I'm actually using this to step sequence / pulse several separate magnetic coils using my audio card (which has several audio output channels), I have a signal in labview played constantly.  Than compare it to the PWM (square wave) which controls if the signal gets played on each separate channel or not.  That way I can control which coil is on and off and in what sequence they are activated. 
    I couldn't find an edge detection for a square wave created in labview so I tried Limits but that doesn't seem to work unless I change the phase manually and that only goes from 1 to -1.  I'm just trying to compare the PWM (square wave edges) already created by labview / play a signal if the pulse is greater than 0 and it turns off the signal if it's less than 0.
    Should I be doing this another way
    Tia
    Message Edited by sal22 on 08-16-2009 06:09 PM
    Message Edited by sal22 on 08-16-2009 06:10 PM
    Solved!
    Go to Solution.
    Attachments:
    PWM control signal block.png ‏23 KB
    PWM control signal front.png ‏48 KB
    pwm test.vi ‏36 KB

    Greetings,
    I tried it two ways using amplitude and levels and fft spectrum.  The values don't seem to update the way I need them to (basiclly showing a 0 or a 1).   I compare the Y values like you recommended but they don't ever seem to update.
    tia
    Message Edited by sal22 on 08-19-2009 10:05 AM
    Attachments:
    pwm magnitude not updating.png ‏29 KB
    pwm test.vi ‏41 KB

  • Generate Square Waves to SCXI 1161 Module

    Hello,
    I am a new user to Signal Express and I wanted to use signal express to generate two Square waves which I will ouput to my SCXI 1161 Relays
    Any quick ideas would be appriciated.
    Tim

    Hey there smoothdurban,
    Typically when you want to generate an output signal in SignalExpress you have to first create the analog/digital signal and then generate it. How this is done in SignalExpress is by first adding a step for "Create Analog/Digital Signal" and then adding a step for "Generate Signals". 
    I attached some pictures to help simulate this. The first picture "creategenerateunbound" shows how an unconfigured generate step does not link with the create signal. The second image "creategeneratebound" shows that after you specify the channel for the generate task, the create and generate will wrap up together and the square wave will match with the channel.
    Also, here is some additional information on why you have to first create and then generate and the SignalExpress Help file about creating signals,
    http://digital.ni.com/public.nsf/allkb/94AC3A0662C8388586256F4700721739
    http://zone.ni.com/reference/en-XX/help/371268J-01/expresswb/create_signal/
    Hope this helps!
    Tim A.
    National Instruments
    Attachments:
    creategenerateunbound.PNG ‏8 KB
    creategeneratebind.PNG ‏7 KB

Maybe you are looking for

  • JSP -- how to pass a variable

    Hi, I am relatively new to JSP/Java and am currently trying to figure out how to pass a value gotten from running a query into another query. My code is below .. I am trying to pass 'tsid'. For simplicity I have hard-coded some values. I have tried 2

  • CS3 JS Add group into frame

    Hi In InDesign UI you can copy a group of frames and paste it into another frame. I'm trying to replicate the results via JS I tried this: x = app.activeDocument.rectangles.add(); y = app.activeDocument.ovals.add(); z = app.activeDocument.ovals.add()

  • Can't Star iChat Service after update to Snow Leopard Server

    We had installed Mac OS X Server on a Mac Pro, and we had the iChat Service working in the organization; but when we update to the Snow Leopard Server we can't start the iChat service again. In the Server Admin app, on the iChat node in the Overview

  • Altec Lansing sound not working dv6 3133tx

    I'm not sure if its not working or not, but my right internal speaker stopped working but my left internal speaker is still working ( Dolby Advanced audio) so now i can only hear from that speaker. Is there any way to get the speaker to start working

  • SLD registration for TREX not working...

    SDN Members, I am unable to register TREX in SLD. I have put in an OSS message; however, I have yet to receive a response back from SAP... So any help would be much appreciated. Thanks, -Patrick Steps for the Reconstruction  1. Generate SLD Configura