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

Similar Messages

  • How can I output a square wave to control a stepper motor using 7332 controller?

    I have the following system configuration for testing a linear actuator (LA):
    LabView 7.1
    NI FlexMotion 7332 Motion Controller
    NI Flex DMM 4070
    The LA is a stepper motor with Step and Direction of Rotation inputs, as well as some discrete I/O for Power Enable and other functions.
    The LA specification only requires that I send a 50% Duty Cycle square wave signal with frequency less than 300 Hz to it in order to make it step.  The LA has it's own power source.  I only need the 7332 to generate the drive signal and the DOR signal to the LA.  Using some of the example VI's, I can get the LA to work, but I will need to incorporate the functions in to a custom application. 
    How can I weed through the numerous advanced functions the 7332 offers and only generate a DOR signal and a step command at a user-defined frequency.  How do I set up the controller for this?
    Thanks

    Hello,
    All the VIs that you can use to create a pulse train and digital I/O from your motion controller are found in the "Analog & Digital I/O VIs" sub-palette in the "Flex Motion" palette. Use "Load PWM Duty Cycle" and "Configure PWM Output" VIs to create the square wave. Use the "Set I/O Port Direction", "Set I/O Port MOMO", and "Set I/O Port Polarity" VIs to create digital output. I hope you find this information useful. You can learn about the specifics of these VIs and their inputs/outputs in the NI-Motion VI Help.
    Regards,
    Aaron B.
    National Instruments

  • How to generate a high freq square wave on NI-USB 62xx

    Hi,
    I am trying to generate a 50khz square wave with an AO channel on the NI-USB 6212 (rated at 250ks/s AO). I started with the Voltage - Continuous Output.vi example but when i go up toward 50khz square wave (100khz sample rate) the edges of the square wave become rounded. The slew rate for the card is 5V/us and my amplitude is just .5V so i feel like I'm doing something wrong with the task setup.
    I also tried setting continuous samples using the onboard clock for a source and then writing an array [1,-1] but that fails at anything higher than ~8khz. 
    What's the most efficienct/correct way to set up a task like this? Any help appreciated. Thanks.
    Matt

    Hello Matt,
    Right now, I think that shape of the signal that is being output is being controlled by the load on the AO. 
    If there is a very large impedance load attached between AO and ground, the RC time constant of the circuit is going to be very high.  This will result in a large amount of time required to charge and dissipate the voltage.  By increasing the frequency, the amount of time allotted for this is being reduced.  Potentially resulting in the waveform you are seeing.
    Can you please upload a picture of your waveform?
    Can you please try to reduce the load on the AO?  This can be done by disconnecting the current load and attaching a small resistor (50 Ohms should be good).  Does this result in the correct waveform?
    Regards,
    Thomas C.
    Applications Engineer
    National Instruments

  • How do you find the frequency of a small sample size and a square wave.

    I am collecting data from ten 12v pulses that are seperated pretty uniformly. The pulses make a square wave. I need to know how to input this small sample size and find it frequency. I need this frequency to be output in a readable file. Im not very knowledgeable in labview so if you try and help me please be very descriptive.
    I know i need some sort of trigger because of uknown wait times before the sensor will be triggored but other than that im pretty lost. Any help would be appreciated.

    What have you tried so far?  What parts are giving you trouble?  Please be as specific as possible. Post the code you have written.
    You ask about frequency measurement and then you are talking about triggering.
    If you always have 10 pulses, just measure the time from the beginning of the first pulse to the beginning of the last pulse.  The frequency is 10/time.
    Break down the problem to smaller parts.  Acquire the data.  Measure the frequency. Save the result to a file.  Get each part working separately, then put them together.
    Lynn 
    Sorry about duplicate post. My internet connection is very slow today.
    Message Edited by johnsold on 05-31-2010 12:05 PM

  • How to generate multiple digital outputs (square waves delayed) at 50 kHz?

    I would like to generate 3 digital outputs like the picture attached at 50 kHz. Using the "digital pattern generator (marching values).vi", I can generate 3 digital square wave but without the delay time. How can I do that?
    I'm using the card PCI 6034E.
    Thank you
    Attachments:
    digital outputs delayed.png ‏8 KB

    Hi,
    the digital pattern generator (marching values) only shifts the binary value of the first signal and sample to the next signal/sample.
    Have you tried generating your waveforms via build waveform and use t0 terminal to change the lead delay?
    In general, this DAQmx example could be helpful which you can modify to your needs.
    DAQmx Write Digital Channel- External Clock: https://decibel.ni.com/content/docs/DOC-11142
    Regards,
    Thomas

  • Converting square wave to double

    I am trying to pass to square wave signal into math script.  I am assumeing that i have to convert the signal into a double.  Is this possible?  If so how could I convert this signal so it can be passed into math script?
    Thanks,
    Leif

    Which data type does your square wave signal has? If it is a waveform you can get the value as an array of double with the Get Waveform Components primitve.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??

    Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??
    How Do I generate those signals?

    Hello;
    You certainly can do that. The way to go about that is to use one of the Analog Output channels your board have available.
    If you are using Labview to program the board, you can find good examples at Search Examples->I/O Interfaces->Data Acquisition->Analog Output->Multiple Point (buffered) Analog Output.
    If you are using other Software language to program the board, you can fing examples at C:\Program Files\National Instruments\NI-DAQ\example\VisualC\AO.
    Hope this helps.
    Filipe

  • Custom high and low times for square waves

    Hi, is there a way to create a square wave that has an incremental HIGH pulse width and a fixed LOW pulse width?
    Sorry I'm quite new with labview, any help is appreciated, thanks!
    Solved!
    Go to Solution.

    Hi GBPC,
    My name is Jack and I work at National Instruments UK.
    I understand you are trying to output a square wave signal with a fixed low time and variable high time in labVIEW.
    The reply above works great if you want to use the signal internally. Alternatively if you are trying to output the signal with a piece of internal or external Data Acquisition (DAQ) hardware you will want to use LabVIEWs DAQmx Tool palette.
    I have created a quick example below for you to look at that should help you come to a solution. It uses the DAQmx VIs to create and initialize a channel and then runs it in a loop with controls to change the high and low times using a property node.
    Hope this helps
    Jack. W
    Applications Engineer
    National Instruments
    Attachments:
    Variable High Time Pulse Generator.png ‏37 KB

  • 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

  • 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

  • How to alternate data storage into 2 arrays with an analog square wave input? (seems that the retriggera​ble function is not supported by my PXI card)

    Hi!  
    I'm trying to have an analog square wave input determine where data gathered from a second analog input channel is stored.  I want data to be stored to one array during the high signal period of the square wave and data to be store to another array during the low signal period of the square wave.  The square wave I'm using is of constant frequency (8.3 Hz).  I believe I need to use an analog input wave as opposed to a onboard clock or other timing mechanism because my square wave is also being used to modify the input going into my experimental setup.  Thus the data storage needs to be correlated to the timing of the data modification in the experiment.  I tried to use the retriggerable property node function, but receive error 200452, which I think means that my PXI card (6115) can't support this retriggerable function.  So I'm looking for other ways to accomplish alternating data storage in response to an incoming analog square wave.  Any help would be GREATLY appreciated... Thanks!  (I'm also quite new with LabView so toddler-type explanations would probably be most useful  )
    -Shari
    (LabView version 8.6)
    Attachments:
    Pulsed_Acq_Switch_Simplified.vi ‏47 KB

    Hello Shari,
          I am looking at your situation and it seems very intriguing.  after downloading your file I have a couple questions to ask if you don't mind answering.
          Currently in your program you are only taking one sample of data at a time,  this could lead to uneven sampling.  Would you like to sample at a consistent rate  (say 10 Kilosamples of data a second?)  if so what type of card are you using?
          Also,  Do you want your data to be in a 2-D array of data?
    Best Wishes,
    Daniel

  • How to send a SQUARE WAVE to PXI-6259 over the LAN

    howcan I  send a SQUARE WAVE  to PXI-6259 over the LAN, is
    there any example or link any one can send me , thanx in advance.

    Dear HaI L,
    I managed to send a test signal (sine wave) to the device by choosing
    the test panel option and choosing Analog output. In the analog output
    I could many channels to choose from. ai0, ai1.ai2 and ai3.
     I did this by right clicking NI PXI-6259, in the NI DAQmx devices
    located in the Devices and Interfaces and choosing test and saw it on
    an Oscilloscope without using the NI DAQ OPC capabilities, and I cannot
    understand this thing.
    1)How can it be possible without  making a NI DAQmx  channel and Variable?
    2) I cannot create any channels in the devices and interfaces located
    in My system but I can create NI DAQmx Global Virtual channels easily
    in Data neighbourhood in the remote system, Plz tell me why?
    3) I  want to create a program and choose a channel to send the
    signal,  can I choose the channel that i create in the remote
    system device ? and if yes how can I choose this ?
    Thanx in advance.
    Sincerely,
    Munir Afzal Bhatti.
    Attachments:
    max.jpg ‏2305 KB

  • Convert square wave to saw tooth wave

    Hi all
    i need your help. I have a square wave data in for of an array. Can any one of you suggest me a method to convert this data into saw tooth data. What i mean is that i want to convert a square wave to a saw tooth wave with minimum value 0. Your help is really appriciated. Thanks in advance.
    Chauhan.

    Chauhan,
    Let's continue discussion on your other post here.
    David L.
    Systems Engineering
    National Instruments

  • Convert square wave to sinc wave

    Can anyone please show me how to convert square wave to sinc wave?
    Solved!
    Go to Solution.

    Use the wave generator funtions found in palette Signal Processing - Waveform Generation.  There are sine and triangle waveform generating functions there.  You can set the number of samples and sample rate such that it would generate a partial waveform.  Then you use Get Waveform Components to get the Y values, concat the values, then use Build Waveform to build it back to a waveform.  You will get a back to back output.  In the following example, I used a sine and square wave because a sine and triangle were too close in appearance and you could not readily see the effect.
    As Smercurio says, I don't think this is a very good representation of an EKG signal.  That signal has P, QRS, and T waves.  There is no sine wave.  The waves are like triangle waves, so just put DC waveforms (0 amplitude square wave) ahead of and in between triangle waves for P, QRS, and T, followed by DC.
    - tbob
    Inventor of the WORM Global

  • How to apply single sine or square wave

    Now I used NI-FGEN and NI-Scope for bender element test, I want to now how to generate single sine or square wave (normally in NI-FGEN, I saw only continuous wave generation type).thanks you so much

    If I understand your question correctly, it sounds like you would like to output one period of a sine wave or square wave and then just 0V DC. To do this you can use the niFgen_Basic_Arb_Sequence_Example. You will want your first sequence to be a sine (or square) wave and then the second sequence to be DC with an amplitude of 0V. You could replace the while loop in that example with a sequence structure with a wait in the structure to last just a bit longer than your sine wave. This will ensure that your sequence doesn't repeat.
    I hope this helps answer your question.
    Regards,
    Doug K.
    Application Engineering
    National Instruments

Maybe you are looking for

  • I tried updating my iPhone 4S to IOS 6.0.1 and it is now stuck in recovery mode.

    I updated my iTunes to IOS 6.0.1 tonight and then connected my iPhone to the computer and began to back up and update it. It froze and now I am getting the "connect device to iTunes" image on my phone. When I connect it I get a notification on my com

  • Podcast feed not updating after 72 hours

    Usually it takes my podcast about 24 hours to update the episodes within iTunes. I submitted episode 83 on Sunday and have yet to see it appear in the store. Subscribers are able to download the episode, so I am not really sure what the issue is. I b

  • One Event two actions

    Hi, I would like to know which JavaScript-Code has to be placed where in my document to achieve the following: When the visitor moves his mouse over (event onmouseover) one of six possible buttons 2 actions should be execited:(defined in container na

  • How do safari bookmarks sync with lion

    My iPhone and MacBookPro Lion sync my Safari bookmarks perfectly.  I just don't know how it does it?  Cannot find anything online that discusses it.  I know iCloud doe smy contacts, calenar, etc but doe snot appear to do Safara bookmarks.

  • Free Report Writer for Oracle Database except Crystal Report and Data Vison

    Dear All, I want Free Report Writer for Oracle Database except Crystal Report and Data Vision software. Wr are working on Linux and windows both platform. Any one have direct link or website address for it ? Regards, Vipul Patel Ahmedabad