LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the x axis on the waveform chart

I'm using a USB6000 where i have 8 analog sensors connected, I'm using the DAQ assistant to connect their signals to a waveform chart.

JulesvH_0-1657716588458.png

The default of this chart is not 0 to 10 for example which I see in all youtube videos using this chart. For me, it is the real-time and the date on both sides. I tried everything and now I changed it to decimals but then it will start at 3740557141 because it will really wants the dates and real-time.

 

What I need:

 

A graph where I can call the time from 0 to whatever, for example, 0 to 1000. So that I can log results over a 1000 seconds and analyze the graph. Right now it is really annoying to read.

 

Also, I would like that the data points correspond to the position on the time axis. Right now, all data points will move from left to right, so I don't know when that data point occurred.

 

Also is it possible to get 8 different graphs? Instead of all in one?

 

Lastly, I would also like to scae the signals because all of the zero idle voltages are different which is confusing and ideally I want to map the voltages to a unit (i know the calculations for each corresponding sensor)

 

Thanks for answering!

 

0 Kudos
Message 1 of 9
(7,903 Views)

Welcome to the LabVIEW Forum, @JulesvH.

 

Here are some comments/suggestions.

  • It is much easier to examine/test/modify/run a piece of LabVIEW code that you've written if you attach the LabVIEW code (a file with the extension .vi) rather than a "picture" of (part of?) its Front Panel and Block Diagram.
  • LabVIEW Front Panel Objects (like Charts) have "properties".  Right-click the Chart and choose "Properties".  Look at the Tab called "Display Format".  You can choose the format for the X or Y Axis -- it defaults to "Time (X-Axis)".  Now look at "Type", and notice there are two "Time" Types, "Absolute Time" (which means "Date and Time" or "Time in seconds relative to 1 Jan 1904 UTC") or "Relative Time" (which means "Seconds since the Chart started accepting points".  You want the latter option.
  • You can certainly create 8 "skinny" plots and plot each channel on a different Chart.  If you want to emulate an 8-channel Chart Recorder or a 4-channel Oscilloscope, where each "channel" has a different offset of the Y axis, simply add an appropriate offset to each Channel's data.  For example, if you are taking 2 channels of data, plot Channel 0 "as is", but when you go to plot Channel 1, add an offset of 1 to each point before plotting it (note this puts the highest Channel on top -- I leave it as an Exercise for the Reader to figure out how to put Channel 0 on top and Channel 1 one "unit" below it).
  • If you need to scale different Channels differently, you can also implement this on a Channel-by-channel manner by multiplying each Channel's Array of Values by an appropriate scale factor.

Bob Schor

0 Kudos
Message 2 of 9
(7,888 Views)

Thanks for your answer!

I've tried the properties but every time when I run the program, the x-axis changes back:

This is when changing it myself (0 to 1000)

JulesvH_0-1657783958035.png

When i Run (3740627787 to 3740628787):

JulesvH_1-1657783997883.png

 

Also the data will come from the right and each point will keep moving. I want a constant x-axis where each point stays at its corresponding position above the x-axis.

 

Lastly, could you (or somebody else) emphasize how I can scale and offset (and maybe invert) individual graphs? 

Right now I can only connect 1 graph to the DAQ assistant which will output all the data to the same graph. Therefore I do not see how I can add the LabVIEW mathematical operators.

JulesvH_2-1657784242041.png

I tried adding multiple DAQ assistants to add different waveforms to each one but it doesn't allow me to add multiple DAQ assistants.

JulesvH_3-1657784391244.png

 

 

I've added the code in the appendix now 😉

 

Thanks!

 

P.s. I'm totally new to LabVIEW

 

0 Kudos
Message 3 of 9
(7,884 Views)

It sounds like you want the X-Axis to be Relative Time from 0 to 1000 seconds?

x4Capture.PNG

 

Try this:

Turn off auto scale X-Axis, set your min/max, and chose this Style

X3Capture.PNG

 

Set the X-Axis Display Format to Relative Time

X2Capture.PNG

 

Use the Advanced Editing Mode to set the Format String to show only seconds (remove hours %H and minutes %M)

x1Capture.PNG

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 9
(7,872 Views)

To add to @RTSLVU's excellent comments, here are a few more:

  • It looks like RTSLVU is plotting each "row of data" in a separate Chart (which certainly prevents plots lying "on top of" each other), rather than the "add an offset to each plot and plot all channels on a single Chart".  I've done this both ways -- "You Pays Your Money, and You Makes Your Choice").
  • If you know you have a fixed number of points for each plot (1000, say), it makes great sense to set a fixed X Scale.
  • Are you aware that Charts have an "interesting feature"?  If you look at the "Update Mode" on the Appearance Tab for the Chart, there are three choices:
    • Strip Chart (the default).  When the Plot reaches the right-hand edge, the "paper starts to move to the left" as though you are looking at the most recent (say, 1000) points of the data.
    • Scope Chart.  [Hmm -- I may get these next two mixed up, and am too lazy to use LabVIEW Help to check ...].  This simulates an Oscilloscope -- when it reaches the end, the display is "blanked" (all the points are erased) and the next points start being displayed from left to right..
    • Sweep Chart.  Like Scope Chart, but at the end of the Sweep, the next points are displayed from left to right, but only the previously-displayed point is erased (you can see "the moving finger" writing ...).
    • Well, I got "Scope" and "Sweep" backwards -- I was using the "wrong analogy"
  • Another "interesting feature" of Charts is that they have "memory".  If you plot, say, 100 points (of a 1000-point Chart), the next point you plot won't be at 0, but will be "the next point to be plotted", i.e. at 100.  If you want to always start from the beginning when you plot, you have to clear the Chart History.  If you right-click the Chart and choose "Properties" from the Drop Down, scroll all the way to the bottom and you'll find the "History" property.  Right-click it and choose "Change to Write" (or "Change All to Write".  Now right-click the input on the left and type "Create Constant".  This will create an empty 1D or 2D Array (depending how you've configured the Chart".  Place this code where-ever you want to clear the Plot (I recommend you do this before (rather than after) you plot your data.

Bob Schor

  •  
0 Kudos
Message 5 of 9
(7,860 Views)

@Bob_Schor wrote:

To add to @RTSLVU's excellent comments, here are a few more:

  • It looks like RTSLVU is plotting each "row of data" in a separate Chart (which certainly prevents plots lying "on top of" each other), rather than the "add an offset to each plot and plot all channels on a single Chart".  I've done this both ways -- "You Pays Your Money, and You Makes Your Choice").

Yeah when I opened the VI the Chart was already set to "Stack Plots" so I didn't bother changing it back to "overlay plots"

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 9
(7,856 Views)

Wow!  I never heard (or else I "forgot") about Stacked Plots!  What a cool idea ...  Hmm, I should look at my old code from a Project I largely completed a decade ago where I had Chart data to plot -- did I use Stacked Plots and just "forgot" about this feature?  Can you spell Altzheimer?

 

Forgetful Bob

0 Kudos
Message 7 of 9
(7,849 Views)

Thanks for your comment! 

 

I've tried this and once I run the code then all graph settings will reset.

Any idea on how to solve this?

 

P.s.

 

Excuse me for my late reply, just got back from a holiday.

Download All
0 Kudos
Message 8 of 9
(7,758 Views)

Show me the Chart Properties Scales tab:

X3Capture.PNG

 

Also make sure you don't have any property nodes in your code that could be changing things

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 9
(7,750 Views)