Periodic interrups disrupting waveform

 Im having a little bit of a problem with an interrupt in the waveform im reading as an input.This doesn’t appear to be a typical windows based interrupt but I’m guess it caused by a mistake I made.The interrupt occurs every 7 seconds without fail, and lasts about a half second.I can post a screen capture movie if anyone wants to see it and will attach a copy of the code.
This labview program runs a loading machine (motor which runs off controlled force, not the  more common position control).There is an analog output of a DAQ card (pci 6014) which determines the force driven by the motor controller.So by inputting a sinusoid into the DAQ, I can then read back a force mirroring the analog input via load cell.  So after about 7 reps at 1htz, I get an interrupt in the force being read back from the load cell.It always occurs in the exact same spot of the waveform when it occurs (every 7 reps).The position of the interrupt within the waveform can however, change places in the waveform if i stop and restart the program. Changing the loading frequency will show the interrupt will just occur after twice as many reps.
There is no disruption of the plot of the signal which is controlling the waveform (sent to the D to A of pci 6014).
This is labview:  2009 32bit, patched v3
Message Edited by jimmyinct3 on 03-24-2010 06:44 PM
Solved!
Go to Solution.
Attachments:
v19.vi ‏144 KB

  ok, i was able to figure this one out on my own.only took a few days.it was a simple programming mistake on my part, I didnt have a value initializing properly.   so what was happening was that the sampling rate of the ADC for each single data point was different from the sampling rate of the sine generator (also generating single points)2000htz vs. 3000htz. so the time domain was misrepresented during sampling and eventually it had to cause the type of periodic disruption would occur.

Similar Messages

  • Generate waveforms for a set time lapse

    Hello everybody,
    I am not an expert in labview, so I am sorry if my question could sound stupid. I am generating 6 different waveform for my NIDAQ, all of them have different frequencies. I would like to be able to select for how long I want to generate them (so, for example, use the frequency of one waveform as a master and generate 10 periods of this waveform). 
    I really thank you all if you could help.
    Best, 
    Giulia

    You don't say how you are generating the waveforms.  If you are using a timed loop (running at, say, 1 KHz) and in each loop iteration generating the "next point" of your six waveforms, simply run the loop for as many iterations as you need.  For example, if you want 10 seconds of data, run the loop for 10 * 1000 steps to generate 10 seconds of waveform data.
    [This answer sounds like the "answer to the wrong question" -- feel free to clarify your question, perhaps with some example code].
    BS

  • Processing Scope Waveforms

    Hi,
    I want to process waveform coming from Scope.
    I have to calculte positive peaks and get average value for values below 0.
    Right Now I have done this
    1- Replaced all values above 0 with 0.
    2- Calculated there average values through basic DC RMS calculation VI.
    3- Initialized an array with this average value.
    4- Searched for maximum value between two consecutive 0 values and placed this value in already initialized array.
    this whole processing is taking a lot of time.
    Could you please provide a better way of doing this.
    I tried to use Waveform Peak Detection VI but it is calculationg peaks through maxima and minima and giving me a lot of peak points although I reqiure only 1 in a period.
    Please see attached I/p and Required O/P waveforms
    Labview user
    Attachments:
    Ip Waveform.JPG ‏25 KB
    required op.JPG ‏32 KB

    Aojha wrote:
    Hi,
    I want to process waveform coming from Scope.
    I have to calculte positive peaks and get average value for values below 0.
    Right Now I have done this
    1- Replaced all values above 0 with 0.
    2- Calculated there average values through basic DC RMS calculation VI.
    3- Initialized an array with this average value.
    4- Searched for maximum value between two consecutive 0 values and placed this value in already initialized array.
    this whole processing is taking a lot of time.
    Could you please provide a better way of doing this.
    I tried to use Waveform Peak Detection VI but it is calculationg peaks through maxima and minima and giving me a lot of peak points although I reqiure only 1 in a period.
    Please see attached I/p and Required O/P waveforms
    What you have described doesn't make sense given your waveform. You said "get positive peaks and get average value for values below 0". There are no positive peaks with amplitudes below 0 in your waveform. There are VALLEYS however.
    But then your output waveform shows that you have marked 8 positive peaks of amplitude 2.5 (which are ABOVE 0) and zeroed all other values, including the first two periods of the waveform. Please explain.
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx

  • Waveform cursors and "data gates"

    I have a waveform graph and want to capture certain periods of the waveform. I want a cursor to appear as a line that is adjustable in length, position and level, much like data gates used in ultrasonic A-Scan applications. I have been doing this in the past by superimposing a picture drawing lines over the graph, but I think data gates using cursors would be easier to manage and simplify things. Does anyone know how to make a cursor appear as a line that can be adjusted for length and position on the graph? And it would be even better if it were adjustable with a touch screen or with the mouse.
    Paul
    7.1/XP
    PaulG.
    "I enjoy talking to you. Your mind appeals to me. It resembles my own mind except that you happen to be insane." -- George Orwell

    Paul,
    There is no one, built-in function in LabVIEW that allows you to do this behavior, but you can easily code it yourself. What you have to do is detect when one of the two cursors is moved and then move the other cursor with it. If you want to also graph a line between the two cursors, you can do that, too, just by plotting it like any other plot.
    Coding this behavior is a breeze in LabVIEW 8 because there is now an acutal "Cursor Move" event; I have attached a LabVIEW 8 VI that demonstrates how to implement what you are talking about. In LabVIEW 7.1 and older, this is a little more difficult because there is no "Cursor Move" event, but there is an old post that discusses possible workarounds.
    Kind Regards,
    E. Sulzer
    Applications Engineer
    National Instruments
    Attachments:
    CursorWindow.vi ‏22 KB

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

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

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

  • Measuring the changing duty cycle of PWM waveform

    I need to measure the changing duty cycle of PWM waveform.
    conditions:
    1. the period is fixed.
    2. but the duty cycle is changing.
    goal:
    measure the every duty cycle of a period in the waveform.
    Can you please give me a help?
    Thank you in advance.
    the waveform image is attached.

    You need to provide more specific information.
    What is the period? What is the minimum, maximum, and resolution of the PWM signal? What is the time scale in your image?
    How are you measuring or generating the signal you show in the image?
    What should the output look like? An array of duty cycles expressed as percentage? Some kind of plot on a graph?
    How long will this measurement last?
    Lynn

  • FMIS vs LCDS for Real Time Messaging In Flex

    A team that I am working with is launching development for a new Flex app. The app will have multiple text chat rooms and video chat too.
    Since for video the architecture must include Flash Media Interactive Server (FMIS), the client assumes we will use FMIS for the text messaging.
    My question is, for text chat what advantages does LiveCycle Data Services (LCDS) have over FMIS?
    Does anyone here have experience with both that they can comment on? Can anyone provide links that might compare the pros and cons of LCDS vs FMIS? Or, dream come true, links providing comparisons of LCDS vs FMIS vs BlazeDS?
    Any thoughts or assistance will be appreciated.
    Thanks,
    g
    Flash Media Server FMS

    > from mili to micro seconds. When I right click on the graph, in the
    > xscale formating when i change the dX, it does not really alter the
    > scale, meaning the waveform does not expand.Sure, the scale changes,
    > but now the time period of the waveform is 1micro second instead of 1
    > milli second.
    It sounds like you are changing the multiplier sometimes called the dX
    on the graph scale. This changes how the graph is labeled, which is
    sort of a unit or timescale change, but it doesn't affect the numeric
    formatting of the scale. On the same dialog, as well as on the popup
    are items for choosing scientific display or choosing digits after the
    decimal to display, if that is what you are interested in seeing.
    When you say you want to expand the waveform,
    you might also want to
    type into the min and max of the scale to view less data in the graph,
    thus leaving more detail on what is viewed. This is effectively
    zooming. If I still haven't guessed what it is you are trying to
    change, please explain your problem again in more detail or post a VI.
    As for choosing between a chart and a graph. The major difference is
    that a chart shows the new data attached to older historical data. If
    you are looking at individually sampled blocks of data, the graph is
    what you want. If you want to look at a window on all of the data you
    have gathered, a chart may work better. Also keep in mind that graphs
    have cursors, charts do not. If your chart's data isn't a waveform,
    then the X axis is simply samples and it tells the chart nothing about
    phase.
    Greg McKaskle

  • How can I change  oval shape applet to (plot)

    Hi this is not my code so, the orignal code is freeware to www.neuralsemantics.com and is Copyright 1989 by Rich Gopstein and Harris Corporation.
    The site allows permission to play with the code or ammend it.
    how could I modify the applet to display (plot) several cycles of the audio signal instead of the elliptical shape. The amplitude and period of the waveform should change in accordance with the moving sliders
    Here is the code from www.neuralsemantics.com /applets/jazz.html
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class JazzMachine extends Applet
                 implements Runnable, AdjustmentListener, MouseListener {
      // program name
      final static String TITLE = "The jazz machine";
      // Line separator char
      final static String LSEP = System.getProperty("line.separator");
      // Value range
      final static int MIN_FREQ = 1;   // min value for barFreq
      final static int MAX_FREQ = 200; // max value for barFreq
      final static int MIN_AMPL = 0;   // min value for barVolume
      final static int MAX_AMPL = 100; // max value for barVolume
      // Sun's mu-law audio rate = 8KHz
      private double rate = 8000d;      
      private boolean audioOn = false;     // state of audio switch (on/off)
      private boolean changed = true;      // change flag
      private int freqValue = 1;           // def value of frequency scrollbar
      private int amplValue = 70;          // def value of volume scrollbar
      private int amplMultiplier = 100;    // volume multiplier coeff
      private int frequency, amplitude;    // the requested values
      private int soundFrequency;          // the actual output frequency
      // the mu-law encoded sound samples
      private byte[] mu;
      // the audio stream
      private java.io.InputStream soundStream;
      // graphic components
      private Scrollbar barVolume, barFreq;
      private Label labelValueFreq;
      private Canvas canvas;   
      // flag for frequency value display
      private boolean showFreq = true;
      // width and height of canvas area
      private int cw, ch;
      // offscreen Image and Graphics objects
      private Image img;
      private Graphics graph;
      // dimensions of the graphic ball
      private int ovalX, ovalY, ovalW, ovalH;
      // color of the graphic ball
      private Color ovalColor;
      // default font size
      private int fontSize = 12;
      // hyperlink objects
      private Panel linkPanel;
      private Label labelNS;
      private Color inactiveLinkColor = Color.yellow;
      private Color activeLinkColor = Color.white;
      private Font inactiveLinkFont = new Font("Dialog", Font.PLAIN, fontSize);
      private Font activeLinkFont = new Font("Dialog", Font.ITALIC, fontSize);
      // standard font for the labels
      private Font ctrlFont;
      // standard foreground color for the labels
      private Color fgColor = Color.white;
      // standard background color for the control area
      private Color ctrlColor = Color.darkGray;
      // standard background color for the graphic ball area
      private Color bgColor = Color.black;
      // start value for the time counter
      private long startTime;
      // maximum life time for an unchanged sound (10 seconds)
      private long fixedTime = 10000;
      // animation thread
      Thread runner;
    //                             Constructors
      public JazzMachine() {
    //                                Methods
      public void init() {
        // read applet <PARAM> tags
        setAppletParams();
        // font for the labels
        ctrlFont = new Font("Dialog", Font.PLAIN, fontSize);
        // convert scrollbar values to real values (see below for details)
        amplitude = (MAX_AMPL - amplValue) * amplMultiplier;
        frequency = (int)Math.pow(1.2d, (double)(freqValue + 250) / 10.0);
        setLayout(new BorderLayout());
        setBackground(ctrlColor);
        setForeground(fgColor);
        Label labelVolume = new Label(" Volume ");
        labelVolume.setForeground(fgColor);
        labelVolume.setAlignment(Label.CENTER);
        labelVolume.setFont(ctrlFont);
        barVolume = new Scrollbar(Scrollbar.VERTICAL, amplValue, 1,
                         MIN_AMPL, MAX_AMPL + 1);
        barVolume.addAdjustmentListener(this);
        // assign fixed size to the scrollbar
        Panel pVolume = new Panel();
        pVolume.setLayout(null);
        pVolume.add(barVolume);
        barVolume.setSize(16, 90);
        pVolume.setSize(16, 90);
        Label labelFreq = new Label("Frequency");
        labelFreq.setForeground(fgColor);
        labelFreq.setAlignment(Label.RIGHT);
        labelFreq.setFont(ctrlFont);
        barFreq = new Scrollbar(Scrollbar.HORIZONTAL, freqValue, 1,
                      MIN_FREQ, MAX_FREQ);
        barFreq.addAdjustmentListener(this);
        // assign fixed size to the scrollbar
        Panel pFreq = new Panel();
        pFreq.setLayout(null);
        pFreq.add(barFreq);
        barFreq.setSize(140, 18);
        pFreq.setSize(140, 18);
        // show initial frequency value
        labelValueFreq = new Label();
        if (showFreq) {
          labelValueFreq.setText("0000000 Hz");
          labelValueFreq.setForeground(fgColor);
          labelValueFreq.setAlignment(Label.LEFT);
          labelValueFreq.setFont(ctrlFont);
        Panel east = new Panel();
        east.setLayout(new BorderLayout(10, 10));
        east.add("North", labelVolume);
        Panel pEast = new Panel();
        pEast.add(pVolume);
        east.add("Center", pEast);
        Panel south = new Panel();
        Panel pSouth = new Panel();
        pSouth.setLayout(new FlowLayout(FlowLayout.CENTER));
        pSouth.add(labelFreq);
        pSouth.add(pFreq);
        pSouth.add(labelValueFreq);
        south.add("South", pSouth);
        linkPanel = new Panel();
        this.composeLink();
        Panel west = new Panel();
        // dummy label to enlarge the panel
        west.add(new Label("      "));
        add("North", linkPanel);
        add("South", south);
        add("East", east);
        add("West", west);
        add("Center", canvas = new Canvas());
      private void composeLink() {
        linkPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
        linkPanel.setFont(inactiveLinkFont);
        linkPanel.setForeground(Color.yellow);
        Label labelName = new Label(TITLE + " \u00a9");
          labelName.setForeground(inactiveLinkColor);
          labelName.setAlignment(Label.RIGHT);
        labelNS = new Label(" Neural Semantics   ");
          labelNS.setForeground(inactiveLinkColor);
          labelNS.setFont(inactiveLinkFont);
          labelNS.setAlignment(Label.LEFT);
        linkPanel.add(labelName);
        linkPanel.add(labelNS);
        // link to Neural Semantics website
        String h = getDocumentBase().getHost();
        if ((h.length() > 4) && (h.substring(0, 4).equals("www.")))
          h = h.substring(4);
        if ((h != null) && (! h.startsWith("neuralsemantics.com"))) {
          // create a hand cursor for the hyperlink area
          Cursor linkCursor = new Cursor(Cursor.HAND_CURSOR);
          linkPanel.setCursor(linkCursor);
          labelName.addMouseListener(this);
          labelNS.addMouseListener(this);
      private void switchAudio(boolean b) {
        // switch audio to ON if b=true and audio is OFF
        if ((b) && (! audioOn)) {
          try {
            sun.audio.AudioPlayer.player.start(soundStream);
          catch(Exception e) { }
          audioOn = true;
        // switch audio to OFF if b=false and audio is ON
        if ((! b) && (audioOn)) {
          try {
            sun.audio.AudioPlayer.player.stop(soundStream);
          catch(Exception e) { }
          audioOn = false;
      private void getChanges() {
        // create new sound wave
        mu = getWave(frequency, amplitude);
        // show new frequency value
        if (showFreq)
          labelValueFreq.setText((new Integer(soundFrequency)).toString() + " Hz");
        // shut up !
        switchAudio(false);
        // switch audio stream to new sound sample
        try {
          soundStream = new sun.audio.ContinuousAudioDataStream(new
                            sun.audio.AudioData(mu));
        catch(Exception e) { }
        // listen
        switchAudio(true);
        // Adapt animation settings
        double prop = (double)freqValue / (double)MAX_FREQ;
        ovalW = (int)(prop * cw);
        ovalH = (int)(prop * ch);
        ovalX = (int)((cw - ovalW) / 2);
        ovalY = (int)((ch - ovalH) / 2);
        int r = (int)(255 * prop);
        int b = (int)(255 * (1.0 - prop));
        int g = (int)(511 * (.5d - Math.abs(.5d - prop)));
        ovalColor = new Color(r, g, b);
        // start the timer
        startTime = System.currentTimeMillis();
        // things are fixed
        changed = false;
    //                               Thread
      public void start() {
        // create thread
        if (runner == null) {
          runner = new Thread(this);
          runner.start();
      public void run() {
        // infinite loop
        while (true) {
          // Volume or Frequency has changed ?
          if (changed)
            this.getChanges();
          // a touch of hallucination
          repaint();
          // let the children sleep. Shut up if inactive during more
          // than the fixed time.
          if (System.currentTimeMillis() - startTime > fixedTime)
            switchAudio(false);
          // let the computer breath
          try { Thread.sleep(100); }
          catch (InterruptedException e) { }
      public void stop() {
        this.cleanup();
      public void destroy() {
        this.cleanup();
      private synchronized void cleanup() {
        // shut up !
        switchAudio(false);
        // kill the runner thread
        if (runner != null) {
          try {
            runner.stop();
            runner.join();
            runner = null;
          catch(Exception e) { }
    //                     AdjustmentListener Interface
      public void adjustmentValueChanged(AdjustmentEvent e) {
        Object source = e.getSource();
        // Volume range : 0 - 10000
        // ! Scrollbar value range is inverted.
        // ! 100 = multiplier coefficient.
        if (source == barVolume) {
          amplitude = (MAX_AMPL - barVolume.getValue()) * amplMultiplier;
          changed = true;
        // Frequency range : 97 - 3591 Hz
        // ! Scrollbar value range represents a logarithmic function.
        //   The purpose is to assign more room for low frequency values.
        else if (source == barFreq) {
          freqValue = barFreq.getValue();
          frequency = (int)Math.pow(1.2d, (double)(freqValue + 250) / 10.0);
          changed = true;
    //                     MouseListener Interface
      public void mouseClicked(MouseEvent e) {
      public void mouseEntered(MouseEvent e) {
        // text color rollover
        labelNS.setForeground(activeLinkColor);
        labelNS.setFont(activeLinkFont);
        showStatus("Visit Neural Semantics");
      public void mouseExited(MouseEvent e) {
        // text color rollover
        labelNS.setForeground(inactiveLinkColor);
        labelNS.setFont(inactiveLinkFont);
        showStatus("");
      public void mousePressed(MouseEvent e) {
        try {
          java.net.URL url = new java.net.URL("http://www.neuralsemantics.com/");
          AppletContext ac = getAppletContext();
          if (ac != null)
            ac.showDocument(url);
        catch(Exception ex){ }
      public void mouseReleased(MouseEvent e) {
    //                              Painting
      public void update(Graphics g) {
        Graphics canvasGraph = canvas.getGraphics();
        if (img == null) {
          // get canvas dimensions
          cw = canvas.getSize().width;
          ch = canvas.getSize().height;
          // initialize offscreen image
          img = createImage(cw, ch);
          graph = img.getGraphics();
        // offscreen painting
        graph.setColor(bgColor);
        graph.fillRect(0, 0, cw, ch);
        graph.setColor(ovalColor);
        graph.fillOval(ovalX, ovalY, ovalW, ovalH);
        // canvas painting
        if (canvasGraph != null) {
          canvasGraph.drawImage(img, 0, 0, canvas);
          canvasGraph.dispose();
    //                          Sound processing
      // Creates a sound wave from scratch, using predefined frequency
      // and amplitude.
      private byte[] getWave(int freq, int ampl) {
        int lin;
        // calculate the number of samples in one sinewave period
        // !! change this to multiple periods if you need more precision !!
        int nSample = (int)(rate / freq);
        // calculate output wave frequency
        soundFrequency = (int)(rate / nSample);
        // create array of samples
        byte[] wave = new byte[nSample];
        // pre-calculate time interval & constant stuff
        double timebase = 2.0 * Math.PI * freq / rate;
        // Calculate samples for a single period of the sinewave.
        // Using a single period is no big precision, but enough
        // for this applet anyway !
        for (int i=0; i<nSample; i++) {
          // calculate PCM sample value
          lin = (int)(Math.sin(timebase * i) * ampl);
          // convert it to mu-law
          wave[i] = linToMu(lin);
        return wave;
      private static byte linToMu(int lin) {
        int mask;
        if (lin < 0) {
          lin = -lin;
          mask = 0x7F;
        else  {
          mask = 0xFF;
        if (lin < 32)
          lin = 0xF0 | 15 - (lin / 2);
        else if (lin < 96)
          lin = 0xE0 | 15 - (lin-32) / 4;
        else if (lin < 224)
          lin = 0xD0 | 15 - (lin-96) / 8;
        else if (lin < 480)
          lin = 0xC0 | 15 - (lin-224) / 16;
        else if (lin < 992)
          lin = 0xB0 | 15 - (lin-480) / 32;
        else if (lin < 2016)
          lin = 0xA0 | 15 - (lin-992) / 64;
        else if (lin < 4064)
          lin = 0x90 | 15 - (lin-2016) / 128;
        else if (lin < 8160)
          lin = 0x80 | 15 - (lin-4064) / 256;
        else
          lin = 0x80;
        return (byte)(mask & lin);
    //                             Applet info
      public String getAppletInfo() {
        String s = "The jazz machine" + LSEP + LSEP +
                   "A music synthetizer applet" + LSEP +
                   "Copyright (c) Neural Semantics, 2000-2002" + LSEP + LSEP +
                   "Home page : http://www.neuralsemantics.com/";
        return s;
      private void setAppletParams() {
        // read the HTML showfreq parameter
        String param = getParameter("showfreq");
        if (param != null)
          if (param.toUpperCase().equals("OFF"))
            showFreq = false;
        // read the HTML backcolor parameter
        bgColor = changeColor(bgColor, getParameter("backcolor"));
        // read the HTML controlcolor parameter
        ctrlColor = changeColor(ctrlColor, getParameter("controlcolor"));
        // read the HTML textcolor parameter
        fgColor = changeColor(fgColor, getParameter("textcolor"));
        // read the HTML fontsize parameter
        param = getParameter("fontsize");
        if (param != null) {
          try {
            fontSize = Integer.valueOf(param).intValue();
          catch (NumberFormatException e) { }
      private Color changeColor(Color c, String s) {
        if (s != null) {
          try {
            if (s.charAt(0) == '#')
              c = new Color(Integer.valueOf(s.substring(1), 16).intValue());
            else
              c = new Color(Integer.valueOf(s).intValue());
          catch (NumberFormatException e) { e.printStackTrace(); }
        return c;
    }thanks LIZ
    PS If you can help how do I Give the Duke dollers to you

    http://www.google.ca/search?q=java+oval+shape+to+plot&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
    Ask the guy who made it for more help

  • Calculating Time from Given input.

    Hi everyone,
    I'm stuck at trying to calculate the time of a given waveform.
    Given a scenario, i have a circuit that is fed to a DAQ card for processing in LabVIEW. The input data generates a squarewave form in LabVIEW. I'm using a general waveform function to view the squarewave. The input is generated from a sensor.It will continously give a pulse when it detect something. But when it a doesnt anything, there'll be no output. so, no waveform is reflected at the waveform function in LabVIEW.
    When that happens, I want to find the time when there's no output reflected at the waveform.
    regards, aisyah.

    If you know the period of your waveform, you could write code that detects when the input is 0 for a period of time that is slightly longer than the period of your waveform.
    1.  Note time that waveform goes to zero.
    2.  If waveform goes to 1 reset your timer.
    3.  Loop and watch your timer, if the time minus noted time is greater than the waveform period, then write out the noted time.

  • Zero crossing, "Triggering" and XY-Graphs

    I'm trying to measure the electrical hysteresis of a sample.  The way in which I do this is by measuring two voltages within a circuit, sending them to my DAQ, and then plotting them in an XY-Graph to view the shape of the curve.  I can somewhat see the hysteresis, but II need to measure the "zero-crossings"; that is to say, the value of one function, when the other is 0, and vice versa.  So when V1 = 0, I want to know what V2 is, and when V2 = 0, I want to know what V1 is.  Seems simple enough, and I have included my VI.
    First I tried the ZeroCrossingPtbyPt, along witha Relay, which never seemed to trigger properly.
    Second, I tried using Trigger and Gate, but that seems to give inflated values.
    This VI can be tested by removing the DAQ assitant and replacing it with two "Generate Signal"(s),  with the same frequency, different amplitudes, and a small phase difference, and this will produce a similar effect without the real signals.
    Next, I am sending the raw voltage signals into a Waveform Graph.  However, it is impossible to get the traces to stay "still" on the graph.  In other words, if this were a real oscilloscope, there would be a "triggering" problem, and if the trigger were set to the proper value, the oscilloscope would be able to track the waveform without it jittering left to right in time.  Any ideas on this?  I've tried to change just about everything in the Waveform Graph with no difference.  Do I need to send in some other signal to get the graph to follow the waveform properly?  This is really important because it will tell me if my sample rate is good enough to capture the signal (a sine wave at 1 kHz).
     Finally, the hysteresis curve on the XY Graph seems to cover many cycles (periods) of the waveform, but I want it to cover only 1 cycle at a time, so it isn't so sketchy-looking.  It's very boxy as well.  So in short, the number of points it is plotting is fine, but it is not plotting them quickly enough, since I'd like all of the points it plots to be over a single period of the waveform.
    Please help!  Thanks in advance.
    Attachments:
    hysteresis.vi ‏176 KB

    As it turns out, the issue was that I was not collecting enough samples at a high enough sample rate from the DAQ.  This is why it worked with "Generate Signals" and did not work with the DAQ Assistant.  Because there were not enough samples, the apparent zero crossing was occuring either too early or too late, leading to an incorrect value.  Therefore, the best solution when it comes to finding zero crossings is make sure your # of samples, and sample rate are high enough to get an accurate measurement.
    As a result, this is why my XY Graph was showing blocky hysteresis loops, rather than nice smooth curve hysteresis loops.  The data being sent to it was not quick enough, and therefore the XY- Graph connected the dots between the points that it was sent, yielding a truncated loop, which appeared blocky or sketchy.
    On the issue of triggering, this can apparently be set within the DAQ Assistant in the "Triggering" tab; the key is chosing the correct channel to trigger from, and a reasonable trigger level.  This was my problem, and this is why my Graph appeared to jitter.  It was not the graph itself, but the DAQ Assistant that did not tell it the proper triggering timing.
    So, in short, I solved my own problems, but I leave this as a record for those who encounter similar problems in the future.
    Thanks.

  • My phione number has been allocated to someone els...

    Well - yesterday I got a call from my sister in law saying she had phoned my home number and had been connected to a lady who said this was now her number.
    I spoke to the lady in question and she stated that she had converetd from Talk Talk to BT yesterday for broadband and telephone.
    I have had MY line for 10 years so can't understand why it has been 'given away' by BT.
    Note that my broadband is still intact as is my broadband talk number.
    Anyway I rang the helpdesk and exlplained the situation. The call centre agent is convinced that this is a 'crossed line' and has allocated the job to openreach for 8/10/10 !!!  I am pretty sure that this is simply a case of mis-allocation in the exchange and am worried that the openreach engineer is a line engineer who is going to start looking for bad joints/misconnections and then when he  realises there isnt one will pass nit back as not faulty and we will have to start the whole process again and I will be off the air for weeks! (months).
    I have contacted them again but they insist I will need to wait for the Openreach engineer.
    Anyone got any ideas how I might be able to get someone at BT to listen to my pleas .
    Banz
    Solved!
    Go to Solution.

    You are probably in for a long fight.  I took out a contract with BT and a phone line was promised for the 9th August.  No line materialised and every complaint to BT went nowhere.  Eventually on 6th Sept, having received a bill for call on "my" number" I phoned that number and found it had been connected to another flat in the building.  To cut a very long story short, it still took until 21st Sept to get the line connected and I have only just finished arguing about call charges and compensation (one BT person phoned me and told me that since they had generously waived all call charges, why did I think I was entitled to a further refund of line rental?).  The flat my line was wrongly connected to (who have a contract with Sky) are still waiting reconnection because BT are blocking their line and refusing to allow Sky to reconnect (and there is more saga to that story too.....)
    My advice -
    1. Keep a record of name and time you speak to anyone and all other correspondence
    2.  Chase everything - don't assume that someone promising to help on this forum will do so. 
    3 Copy all emails to [email protected], [email protected], and [email protected]
    4. Be very clear with BT that you intend taking this matter to mediation (the mediator for BT is OTELO) if it is not resolved to your satisfaction.  You can do this if the matter is not resolved within 8 weeks
    5. When the matter is resolved insist on refunds of all charges during the period and reasonable compensation.  I set this at line rental + all package costs x period of disruption.  Be clear that rebates and refunds  are not the same as compensation.  It took some arguing but in the end BT offered me around £65.  A pittance compared to my actual costs in sorting this matter, but asking for all costs would have prolonged the issue and you run the risk that if you do have to take the matter to mediation OTELO may think you were unreasonable.
    6. Mark correspondence "without prejudice" when you negotiate for compensation - that way you can use it to show OTELO you were being reasonable but BT cant limit your claim at a later stage to that amount.
    Good luck.

  • Usage of generated clocks

    I am very new to FPGAs , sorry, if there is a place that explains this from the beginning (book or user guide).  I'll appreciate any pointers. I am trying to create a simple flip-flop, and I am using a 100MHZ clock:
    My constraint file looks like this for that part:
    set_property -dict { PACKAGE_PIN E3    IOSTANDARD LVCMOS33 } [get_ports { CLK100MHZ }];
    create_clock -name sys_clk_pin -period 10.00 -waveform {0 5} [get_ports { CLK100MHZ }];
    I want to use a clock that is divided by 2 (50MHZ) , so I looked around and there is a way to generate a clock derived from the primary one above, so I added the third line you see below to the above two lines:
    set_property -dict { PACKAGE_PIN E3    IOSTANDARD LVCMOS33 } [get_ports { CLK100MHZ }];
    create_clock -name sys_clk_pin -period 10.00 -waveform {0 5} [get_ports { CLK100MHZ }];
    create_generated_clock -name clkdiv2 -source [get_ports CLK100MHZ] -divide_by 2 [get_pins REGA/Q];
    How can I now use this clkdiv2 clock in my Verilog Design?. I am assuming I have to create an instance of REGA?
    Something like this?:
    module D_ff_behavior
            input D,
            input CLK100MHZ,
            output reg Q
        input wire clk_div_2; ???
        REGA REGA_FF(.D(??), .Q(clk_div_2),.C(CLK100MHZ))
        //assign LED1=CLK100MHZ;
        always @ (posedge clk_div_2)
            Q <= D;
    endmodule

    I was able to run a derived clock using the MMCM. I took the primary 100MHZ and obatined a 50MHZ (also re-did it for 5MHZ) and it worked. I used the Clock Wizard, which generates an MMCM with my desired characteristics, obviously I have to learn much more on the different choices, but made it to work, I downlod it (no warnings and no errors) and measured it with the oscilloscope and the clock signal measured what I set it to.
    If there is something suspicious or a bad practice in this code, please let me know,
    Below is the Constraint XDC File followed by the Verilog code, for the 5MHZ case (divided by 20):
    # Swithch used for D
    ## Clock signal
    set_property -dict { PACKAGE_PIN E3    IOSTANDARD LVCMOS33 } [get_ports { CLK100MHZ }];
    create_clock -name sys_clk_pin -period 10.00 -waveform {0 5} [get_ports { CLK100MHZ }];
    create_generated_clock -source [get_ports CLK100MHZ] -divide_by 20 [get_pins MMCM0_instance/clk_out1];
    #Switche to set D of the simple D-FF
    set_property -dict {PACKAGE_PIN J15 IOSTANDARD LVCMOS33} [get_ports { D }];
    #LED0 to see the output of the simple D FF
    set_property -dict {PACKAGE_PIN H17 IOSTANDARD LVCMOS33} [get_ports { Q }];
    # LED1 used to see the output of the divided clock
    set_property -dict {PACKAGE_PIN K15 IOSTANDARD LVCMOS33} [get_ports { LED1 }];
    Verilog Code:
    `timescale 1ps / 1ps
    // Module Name: D Flip Flop    
    module D_ff_behavior
            input D,
            input CLK100MHZ,
            output reg Q,
            output LED1
        wire clk_div_2;
        assign LED1=clk_div_2;
        MMCM0 MMCM0_instance(.clk_in1(CLK100MHZ),.clk_out1(clk_div_2));
        always @ (posedge clk_div_2)
            Q <= D;
    endmodule
    I guss I still don;nt understand how are the commands in the XDC used. I mean didn't I configured the MMCM with clock Wizard?, why do I have to put the create_generated_clock _ command in the XDC file, I know there is a reason, I am just missing something, so far seems redundant info...
     

  • Is it possible to detect low frequency signals with a high sampling rate?

    Hello everyone,
    I'm having an issue detecting low frequency signals with a high sampling rate.  Shouldn't I be able to detect the frequencies as long as the sampling rate is at least 2 times the highest frequency I will measure?  The frequency range I am measuring is 5-25 Hz, and I use Extract Single Tone.vi to measure the frequency.  The sampling setting I am using is 2 samples at 10 kHz.  Is there a method I can use to make this work?
    Attached is the vi.
    Attachments:
    frequencytest.vi ‏21 KB

    You are sampling at 10Ks/S, but only taking two samples. What do you expect to see? If your signals are binary (On or Off) you would only see either an on or an off, or if the rise/fall time was fast and you were Extremely lucky, one of each. If you want to see a waveform you have to sample for at least the period of a waveform. So you should take samples for at least 0.2 seconds to capture an entire waveform at 5Hz, ideally longer.   Think of looking at a tide change at a dock. If you want to see the entire tide change you will probably have to measure repeatedly over 24 hours, not just run out on the dock, measure the height twice and leave. That wouldn't tell you anything other than at that precise moment the tide height was X, but not that it was at high tide, low tide, in between, etc.
    I type too slowly, I see that a more technical answer has been given, so mine will be the philosophical one!
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Mathscript square wave

    Hello,
    I am trying to figure out a problem in which I am supposed to use a MathScript Node to evaluate the given expression in the range t>=0, t<=3.
    The book I'm using says to input: y(t)=(4/pi)*(sin(2*pi*t)+(sin(6*pi*t)/3)+(sin(10*pi*t)/5)+(sin(14*pi*t)/7)), and that this formula should create a square wave.
    I have put in the following code:
    delta_t=1/f_s
    start=0
    step=delta_t
    stop=(N-1)*delta_t
    t=start:step:stop
    t>=0
    t<=3
    y=4*(sin(2*pi*t)+(sin(6*pi*t)/3)+(sin(10*pi*t)/5)+(sin(14*pi*t)/7))/pi
    However, the result I am getting is not a square wave at all.  I have attached the VI (I am using N=500 and f_s=10000).
    Any ideas?
    -Jill
    Attachments:
    Square Wave.vi ‏48 KB

    Hello Jill,
    Thanks for providing the code you're using- the signal you are currently seeing is because you are sampling the waveform quite fast compared to the signal frequency and you don't have a full period of the waveform to display; increasing the number of samples generated gives a waveform something like this:
    Which appears to be a square wave built with a sin function as you have described. With the values you specified (N=500), you're only seeing part of that initial curve (T=0 to T=0.05, or about 1/20th of the waveform's apparent fundamental period.)
    Regards,
    Tom L.

  • Display Data on waveform chart or XY graph over a long period of time

    Display Data on waveform chart or XY graph over a long period of time
    Can anyone help?
    I am acquiring data from an Ni DAQ card with the following parameters - sample rate = 12800, number of samples = 4096. I want to extract order information so as to track changes in the amplitudes of certain frequency harmonics. So I use the sound and vibration toolkit to extract this information as shown in the attached Vi.  I will like to plot the resulting amplitudes against real-time starting at the time the Vi was run.  I really want the display to show these changes over long periods (eg. days, months and even years).
    Problem.
    I have tried to plot the Y component of the resulting magnitude for a given order on a waveform chart. My choice of the waveform chart is because I also want to display  alarm limits (using the mask and limit vi) (I can't have these lines displayed on an XY graph plot).  I tried adjusting the scale offset using the property node and setting the offset to current time. However, the display on the X-axis can only show a span of  2 minutes as will be seen when you run the attached vi. I want the time display on the x-axis to be over a period of  days, months  and even years.  Is there a way to set the maximum scale on the x-axis to be say a year or so in future.
    I really want the display to be like the one in in the second attachment.
    Attached is a sample VI created using an Ni USB 9234 DAQ card. Any card will do but I am only getting the signal from one channel for this example
    I will appreciate any help that can be given to me.
    Thanks
    Attachments:
    Real-Time Graph Display.vi ‏170 KB
    Sampe screen1.doc ‏37 KB

    Long term testing can be tricky- and we'l get into that later.  Lets start with the basics that you have wrong.
    The vi as you have constructed it has only one memory element, the chart history length (default is 1024.)
    You can change the number of points the Chart will remember by Right-clicking the chart an select Chart History Length from the menu.
    But for a long term test - and one where you want to REMEMBER the first value you need a memeory element that is independant of the application.  Your PC WILL loose power or need to be rebooted eventually.  Heck it might even need to be replaced! you really need to store your data in a file. Preferablly in a file that is backed-up on a regular basis so you don't lose every point of data if the PC dies.  It realy hurts when you have to restart a 2yr test because you've lost the 18months of data you collected.
    For an application like this I would seperate my "collection" and "Evaluation" operations. 
    Have one vi that takes the reading and writes it to a file at a configurable rate  You may want 1reading  per minute for seveal days then 1 per hour for a few weeks- then maybe only once or twice a week for the next couple of years since you are looking for LONG TERM stability.  having too much data to evaluate can take a lot of digging to find the few things that interest you (but always take more that you think you need)
    Have another utility that COPIES the files, reads them and displays the data you are interested in that day.  The data you want to look at won't change over time HOWEVER, you WILL want to analize it in different ways depending on what the data trends look like.  Having seperate routines for collection and display allows you to update the display style and analisys without even stopping the collection vi (much less editing the vi)
    Jeff

Maybe you are looking for

  • Laserjet 1000 - windows 7 driver solution

    All I have just succesfully found a solution to making the laser jet 1000 work under windows 7 64bit The trick  is  that you need a GDI driver  and  finding a supplier ( other than HP ) who has built one. Go to the following link and download the win

  • ITunes constantly asking "Enter Account Name and Password"

    iMac OS X 10.6.8 This is what I've done so far. I've tried Authorizing and Deauthoring under the "Advanced" tab. I've gone to my iTunes Store account setting and "Reset all warnings before buying and downloading". I've tried a few other "solutions" I

  • Scrap against production order

    Hi, My scenario is : I have a production order of 100 pieces out of which 80 are ok and 20 are scrap. I do a Goods Receipt of 100 and then scrap 20 pieces from stock. What steps should I follow after I scarp 20 pieces from stock from Materials Manage

  • E-72 upgrade to firmware 71.004 causes no detectio...

    After I upgraded my E-72 to the latest firmware 71.004, my phone is refusing to support any headphones via the top jack connector. Bluetooth headset works fine, but not any other headphones, and I've tried 3. Anytime I plugin one, message is displaye

  • [KDEmod 4.2] Desktop not showing, only cursor...

    Hi, I tried to install kdemod 4.2 by enabling [kdemod-testing] on my repos... Now after finishing installing it, after logging in it only shows me a cursor and a background with no desktop at all!!!:( How can I fix this? Thanks in advance