XY vs Waveform & X-scaling

Hi there,
I have a problem with graphs and their X-scaling.
In general, I always try to use XY-graphs, because of their exact control
over scalings, and so also in this program.
But, at the end of my progran, I must do a number of plots and I don't know
how many. I did not find a way to get a XY-graph to plot an unknown number
of plots (is there a way to do it, please tell me!), so I chosed for this
purpose the Waveform Graph into which -via bundle -I put my unknown number
of plots as a 2-dim array. Convenient.
But, I can't get the X-scaling in this Waveform graph to equal the former
(XY) graphs in my program.
To 2 other inputs in the bundle I wire the start of X, and the scale spacing
(delta X).
I have tried to solve this b
y making 2 attribute nodes of the XY graph; one
with Delta X and one with X0, and wire them into the bundle
before my Waveform graph. And, this works sometimes, and sometimes not. In
some cases the X-scaling is very strange.
Anyone know anything?
Thanx in advance / Per

> In general, I always try to use XY-graphs, because of their exact control
> over scalings, and so also in this program.
>
> But, at the end of my progran, I must do a number of plots and I don't know
> how many. I did not find a way to get a XY-graph to plot an unknown number
> of plots (is there a way to do it, please tell me!), so I chosed for this
> purpose the Waveform Graph into which -via bundle -I put my unknown number
> of plots as a 2-dim array. Convenient.
>
> But, I can't get the X-scaling in this Waveform graph to equal the former
> (XY) graphs in my program.
>
> To 2 other inputs in the bundle I wire the start of X, and the scale spacing
> (delta X).
>
> I have tried to solve this by making 2 attribute nodes of the XY graph; one
> with Delta X and one
with X0, and wire them into the bundle
> before my Waveform graph. And, this works sometimes, and sometimes not. In
> some cases the X-scaling is very strange.
>
> Anyone know anything?
I know a few things -- about graphs. There are lots of datatypes for
graphs and
they are listed in the examples. XY graphs that support multiple plots
can either
be an array of cluster of two arrays (X array and Y array), or it can
accept an
array of cluster of array of cluster of two numbers (X and Y value).
Using the
notation [] for arrays and {} for clusters, it accepts [{[X],[Y]}], and [{[{X,Y}]}].
The waveform graph with multiple plots accepts [{[Y]}] or [[Y]] where
[[]] is a 2D
array. It also allows X0 and dX for different amounts of generality.
{X0, dX, [[Y]]},
allows one X specification for all of the Y rows or columns. {X0, dX,
[{[Y]}]} allows
for a single X spec with different sizes of plot Y values. [{X0, dX,
[Y]}] allows for
different X specs per plot and different plot lengths per
plot and is
the most general.
As I said, all of these are demonstrated in the examples/general/graphs.llb.
Greg McKaskle

Similar Messages

  • "AI Waveform Scan" family of VI's is in what LLB?

    MY LV 7.0 VI is requesting some VI's not installed in LV8. They are:
    "AI Waveform Scan",
    "AI Waveform Scan (waveform)"
    "AI Waveform Scan (scaled array)"
    In what LLB are they located, or where do i get them???
    Thank You.

    They are part of the traditional NI-DAQ libraries as answered in your other post. Install traditional DAQ from your Drivers CD or download the latest.

  • Decimating a Signal While Keeping The Same Signal Length?

    Hi, 
    I would like to know if it is actually possible to do the above. 
    I'm currently working on wavelet based multiresolution analysis using LabVIEW Student Edition, which unfortunately doesn't have all the toolkits and Express VIs available for me to use. Attached is a VI I have created (Daub4.vi), and screencaps showing the results of the decimation. 
    What I'm trying to do is to decompose the signal by 8 levels, each time dividing the sampling rate by 2, done using decimate 1d array. However, in terms of keeping the signal length the same, I'm not too sure if I should actually manipulate the dt value or simply just use the waveform graph scaling factor to do the job. Some advice would be welcome. 
    Also, another problem I have is pretty weird:
    I'm trying to extract a part of a very large ECG signal (1 second = 64 samples, sampling rate = 2048Hz, I have about 10 minutes of data), selecting from 40960 samples to 65536 samples. However, upon output, the waveform graph only shows up to 65535 samples instead of 65536. Is this supposed to be normal?
    Thanks,
    Derren
    Attachments:
    l1l2.png ‏53 KB
    l3l4.png ‏48 KB
    Daub4.vi ‏24 KB

    Derren,
    Exactly what do you mean by dividing the sample rate while keeping the signal length the same? Do you want the number of samples to be the same or the time duration of the total signal to be the same? Since you did not post the top level VI, I cannot tell what you are doing with the data.
    Also your last comment does not make sense.  "1 second = 64 samples, sampling rate = 2048Hz".  If you have 64 samples in one second, that is a sampling rate of 64 Hz, not 2048 Hz.  Neither rate produces 65536 samples in ten minutes. 60 s * 10 min * 64 Hz = 38400 samples. At 2048 Hz you get 1228800 samples. By today's standards those are not particularly large datasets.
    In LabVIEW arrays are indexed from zero so the last element in a 65536 element array has index 65535.
    Lynn

  • How do you transform a 2d scaled data type to a waveform data type?

    I'm using a daqcard 6024e with labview 6.1 pds. I'm modifying an example VI called Cont Acq to Spreadsheet File.vi. I wanted to run an fft on the data coming from the AI Read VI but that data is a 2d scaled array. The Array to Spreadsheet String VI which I need requires the output from the AI Read VI to be a 2d scaled array.

    Make a FOR loop with a Get Waveform Components function in there, the "Y" component will be a 1D array. Wire the Waveform array through the FOR loop to the left side of the Get Waveform Components, let it index (it will by default). Wire the 1D array from the Y component out of the FOR loop and let it index also. The result is your 2D array of DBL.
    - Dan

  • Scaling multiple waveforms on one chart

    I would like to put waveforms with different timebases (different x-scaling) on one waveform chart. Is there some kind of algorithm I can write so it takes the bigger x-scaling, or some way to do it so everything comes out nice?

    The trick to do this is to put two waveforms on top of each other. The top one will have to be made mostly transparent and the placement will have to be very percise but when you are done you can plot on what appears to be one chart plots of different timebases.

  • Why is it that an amplitude-scaled sound does not play louder than the original sound using Play Waveform?

    I don't know if I have posted this on a correct location (kinda new here).
    I am trying to demonstrate the effect of multiplying a constant to a waveform. I have a sound file read by Sound File Read Simple.vi. Then I am trying to scale the amplitude of the signal by a constant number. I've tried three methods for this: the Numeric Multiplication, the express VI Scaling and Mapping, and the scaling and conversion VI of Signal Express. The waveform shows that the amplitude of the scaled signal is indeed scaled, but when played thru the play waveform VI, the sound level is still the same, no matter how much I am scaling the input. Does anyone why is this so? Also, I really wanted to show that scaling an audio waveform results in a louder waveform. How do I do this? As much as possible, I've wanted to use simple VIs as the class is an introduction to signal processing and the students (and so am I) are still finding our way into LabVIEW (we used to use MATLAB in the course).
    Attachments:
    scaling.vi ‏69 KB

    JaymeW wrote:
    Hi kirkbardini,
    According to this article about Low Volume From Sound VI, you can use a scalar multiple to increase the volume of a sound saved to a .wav file, so you should be able to do this before playing it.  Does that not work for you?
    That information is for Labview 7.x and hence outdated. As mentioned before. Labview do a normalization before sending data to the sound card. As you know sound cards are most often 16 or 24 bits. And in most cases data input to a sound card is in DBL type. After normalization the data is converted so the floating point value 1 represent full scale output on data sent to the the sound card DA. To get any further I suggest kirkbardini take the time needed to send us his/hers current code. Then we may solve things from there
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Waveform accidental​ly scaled before PSD, how to undo?

    Before passing the waveform to Power Spectral Density VI, it was divided by 1000. I am getting my PSD output in dB.
    How could I undo the effect of the division? Is there any factor to scale by?
    The PSD used is the standard Labview VI, with all default values (except with dB on).

    Someone else many come along that's a lot more familiar with the underlying math, but I'm pretty sure you're hosed.
    The lesson that you need to learn here is: always, Always, ALWAYS save the raw data -- then after the analysis save the results in a different file. And backup everything.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Counter/Timer Waveform

    I would like to convert period measurements (RPM data) received from my counter/timer board into waveform data type so that I would be able to conduct frequency analysis on the data (e.g. FFT). Have tried with limited success interpolation & decimation techniques. Would be grateful for any suggestions.

    Malfesto,
    I had a look and can offer up a few comments:
    1. I don't understand your comment about "truncation error" in the slow speed pulses case. Perhaps your are remarking about the "glitches" in the slow data embedded in the block diagram array? More on this a bit later...
    2. At least at a quick glance, the interpolation seems a little funky. I didn't spend a ton of time wrapping my head around it so maybe it's actually ok, but I saw a finite difference that would act like a derivative of the period, and a scaling factor based on the average period -- things that make me go hmmmm.
    Also, if you zoom on the graphs for the Slow Data, you can kinda see that the "Post Processing Graph" looks like a derivative of the "Pre Processing Graph". I suspect you need to rework your interpolation method.
    3. When I did a similar project, I think I first converted all the periods to frequencies and also generated a "sample time" array that was the cumulative sum of the periods. (I toyed with tweaking the time array so that the timestamp would correspond to the midpoint of the interval that I had converted to a frequency. I don't recall now whether that tweak proved useful enough to bother with).
    Once I had laid out arrays for frequencies and (unequally-spaced) sample times for those frequencies, I could generate an equally-spaced time array at a desired "virtual sampling rate" and interpolate to create new "virtual frequency" values. Since I was merely post-processing data, I think I also used the native LabVIEW array functions 'Threshold 1D Array' and 'Interpolate 1D Array' in the interpolation process.
    Now, before going into an FFT you'll want to remove the huge DC offset. This may be as simple as subtracting the mean or median frequency from all entries if you are nominally at constant speed.
    4. Your raw dataset for Slow Data has suspiciously periodic glitches in the periods. There is a very strong and dominating pattern that repeats every 16 intervals. Your typical period is registering about 10 million timebase cycles. However, in every set of 16 periods, you get one period around 27 million and another around 35 million.
    I don't know how you gathered your "Slow Data" values, but there seems to be a systemic error in the measurement. That sort of one-sample discrepancy looks very suspicious. I'd urge you to determine the source of those glitches and try to eliminate them. They don't appear to be telling the truth about the motion you wish to characterize. The device you measure doesn't by chance start and stop or go back-and-forth during your measurement, does it?
    Hope this helps.
    -Kevin P.

  • How to load a custom waveform for use with DAQ voltage generation

    I would appreciate some advice on how to take a custom waveform (just a modified triangle wave with pauses at the tops and bottoms) and use that to control the voltage output from a DAQ. 
    Some background:  My intent is to use the waveform to control mirror scanning for a LADAR imaging application .  Because our DAQ (NI-6251) only has one clock, it cannot update the X and Y channel voltages independently. I'm using a triangle wave to control both axes, which works fine for the X direction.  However, to prevent the Y axis from incrementally steping up after every X pixel, I'd like to construct a waveform, similar to a step pyramid, so that the Y axis remains constant over the X sweep and only updates to the next row after all X pixels are collected.
    I assume I can make the desired plot in excel, and then read it in somehow - but this is where I start to get fuzzy.  Can any one point me to an example or tutorial on this?
    Some other questions:
    1. Do I needto worry about scaling? will my custom plot need to contain a specific number of points (perhaps the exact number of pixels in the image)?
    2. If I change the image dimensions, will I need to revise the control waveform in the Y axis?
    Thanks in advance,
    jimmy

    This thread didn't appear to go anywhere.  I am trying to do something similar and was looking for help.  I want to create a repeating output voltage wave based off the excel file attached(with times).  Is there a way to have my program match the output voltage and time with the table attached on a repeat and send that signal to the output?
    Thanks,
    T
    Attachments:
    Sig Gen.xlsx ‏34 KB

  • Best way of including timing in a waveform graph?

    Hello all,
    I've been toying with a number of different ways to do this, but so far I haven't had all that much luck. I've posted a picture so you can see what's going on. All I have is 4 plots that need to be plotted with accurate timing information on the x-axis. I guess I'm just wondering what the best way to go about this is. This method seems to be the most cluttered and messy that I've done, but is the only one I've gotten to have the actual correct timing info on the graph. I would put a wait in the loop, but I need to acquire this data as fast as possible. Thanks for any help!
    Geoff
    Attachments:
    Graphing Test.jpg ‏74 KB

    The display options you have chosen are OK on their own.
    If you're looking to get more speed out of the code, try only graphing the data every 10 iterations or so. You can save the processed data (your waveforms) in a shift register where they can then be appended every 10 iterations.
    This will obviously not clean up your code. The best way to clean up your code might be to simply throw the conversions you're performing into a sub-vi. Or create a time input for your "meters" VI and have thr processing done there with correctly-scaled values being outputted.
    Hope this helps
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Save waveform data with corresponding time array to spreadsheet file

    Hello to all
    I am looking for a possibility to save voltage data acquired and displayed continousely to a spreadsheet file. Acquiring and displaying is not a big problem, but I have troubble to save the data with the corresponding timestamp with more than seconds accuracy. I am acquiring the data at 1000 Hz and read packages of 500 samples. The recording time should not be limited, it will be started and stopped manually. In fact the acquired voltage data first has to be scaled and than saved. If I use the 'WRITE WAVEFORM TO SPREADSHEET' VI the time column is in seconds' accuracy and that is not what I need. If I create my own time array from the waveform parameters I have timing problems. The accuracy in time should reflect the sample rate. I will attach one of my not very successful trials for better understanding.
    please help a newcomer!
    Thanks in advance
    Thomas
    LV 7.1
    Attachments:
    display & record forces v.1.0.vi ‏181 KB

    I usually follow a simple method to generate time stamp
    I keep sampling rate and number of samples to read as equal and do as shown in the attached VI
    I also remember building a VI with a small modification to this time stamp generation logic to cater to acq, where number of samples to read is half/one fourth/one tenth of sampling rate specified, but cannot find that VI.
    Hope this helps
    Regards
    Dev
    Attachments:
    Acq_DAQmx_filesave_time stamp.vi ‏121 KB

  • Auto update waveform chart error

    Hi all!
    I have come across the problem when working on my VI. As you can see from the VI that I have attached, there is a waveform graph on the front panel for data acquisition. The value shown right now is from time, 00:00:00 to 00:05:00 (0-5minutes).
    The problem that I am faced right now is, everytime when I hit the run button, LABVIEW seems to automatically change my time value to some sort of generic time. What I want to accomplish here is that, I want to acquire data on the waveform graph from time 0 to 5 minutes. Also, I would like to specify the increments myself. For example on the time scale (x-axis) from 0-5 minuntes, I would like a 30 seconds interval between them. How do I actually accomplish it?
    I have tried absolute time format and changing my waveform chart to sweep chart.
    Thanks for any help!
    Jlam
    Attachments:
    PDaq- Modified_07-08-2010.vi ‏61 KB

    The problem here is that Waveform Charts and Graphs always assume a constant delta time between data points. If you are absolutely certain the data points are guaranteed to be sampled at consistent intervals, the Waveform Chart or Graph is a good fit for the data.
    On the other hand, if data points are sampled at arbitrary time intervals, it will be necessary to use the XY graph, where different timestamps for each data sample determine the t-axis (time, horizontal axis).
    The deal here is that your horizontal axis is N, Sample Number, not t, sample time. Your samples start at 0, and increment 1, 2, 3... Therefore, if you are taking 120S/sec, it will appear two minutes - 00:02:00 (HH:MMS) - have elapsed in the first second! One way to convert Sample Number to Time is by mulitplying that scale by the factor 1/120. To add a multiplier (or offset) to your scale, go to the properties of the Chart. Likewise, you can use a property node to programmatically set scaling factors on the scale.
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • Waveform Distortion after Multiplication?

    Hi all,
    Newbie on the line here. I wrote a VI that obtains the reading of channels 1 and 2 from an oscilloscope via GPIB. The readings come out to be decent looking sinusoids when plotted on a waveform graph. However, after multiplying the two, the product is quite distorted and looks nothing like what you would expect. The waveform of the product contains huge jumps from negative to positive values even when outputs #1 and #2 are very continuous. I've also noticed that if you adjust the scaling on the oscilloscope to a certain value, the distortion goes away and the product looks like a normal sinusoid as well. At all other scaling values, the product waveform is distorted. Since the output wires of channels 1 and 2 (to the individual plots) are from the same branch as those going into the multiplication block, I'm wondering how this would make sense. Anyone have an idea?
    The output graphs are attached as the following. Much thanks in advance for the help.
    Attachments:
    waveforms_decent.JPG ‏96 KB
    waveforms_notgood.JPG ‏107 KB
    block.JPG ‏109 KB

    What data type are you type casting too?  If it is I8, you are getting overflow when multiplying.  I'm looking at graph time 60.  One curve has a value of 10 and the other has a value of 24 at T-60.  The product would be 240.  Yet on the power graph at T-60, the value is a negative number.  If you are type casting to an I8, I would believe the result would be negative since I8 range is from -128 to 127.  240 would fall into the negative range in this case.  If this is the case, type case to U16 to prevent overflow.
    - tbob
    Inventor of the WORM Global

  • Best way to write waveforms to file

    I'm reading 7 waveforms from DAQ at 20kHz sample rate and wish to write the data to a binary file [e.g. timeval ch1val ch2val....etc, in format timestamp sgl sgl sgl etc].
    What is the easiest way to do this (without using the easy VIs)? The format of the file must be readable by other software - this is why I can't use the easy waveform VIs. The sgl and timestamp formats should be no trouble to read using e.g. MATLAB code.
    The other consideration is that this writing to file must not interfere with the data acquisition.

    To convert a floating-point value to it's binary equivalent all you have to do is use the flatten to string function. The tricky part is getting the application on the other end to recognize the format. As soon as you start writing binary data you have to start worrying about what processor the end user's machine is using because it makes a difference in how the bitstream is interpretted (bid-endian vs little-endian).
    Remember also that to represent LV timestamps (which in the wider world are very nonstandard) you have to use either a double-precision float or a U32 number. In the Microsoft world a slightly more standard representation of time is the number of days since Midnight Jan 1 1900--a value which can be represented in a single-precision float.
    T
    here are also datalogging examples that demonstrate writing binary files--though those tend to use very low-level binary representations. They aren't even scaled to floats. This would provide the most compact storage since no number would be more than 2 bytes (16-bits), and the fastest too since you aren't taking the time to scale it in LV.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Time scaling

    How can I perform Time scaling on a signal like getting X(2t) or X(t/2) from x(t) in labVIEW. PLease reply quick.

    Hi TWGOMEZ
    Thanks for the reply. but tell me one thing , Im reading the simulated waveform from .txt file and I want to time scale this waveform . Im attaching the VI and the required text file. I want to time scale the waveform coming to the waveform graph. Pls help.
    Attachments:
    Help.vi ‏14 KB
    New Text Document.txt ‏3 KB

Maybe you are looking for