From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

different XY graphs for one waveform

I am inputting an external signal that changes every 1 second.

I am simulating that by "signal simulator".

Now, I want to have each "1 second" portion of the signal in an independent XY graph (or any other graph). 

My attempt: use shift registers and save the whole signal in an array, so that each 1 second is in one row. Then plot each row on XY graph. But that did not work with me. It only shows the first row.

 

0 Kudos
Message 1 of 5
(2,429 Views)

Some suggestions that will help both you and people who try to understand your code:

  • Keep it neat and compact.  Particularly when starting out using LabVIEW, use the Clean Up button (select your Block Diagram and use the "Broom" Icon to straighten wires and get rid of unneeded space).
  • Try to avoid Express VIs and their Evil Twins, the Dynamic Data Wires.  Look on the Waveform Palette where there are equivalent (and much simpler) VIs.
  • If you are generating Waveforms, consider using the Waveform Graph to plot them.
  • If you generate 3 identical Waveforms and plot them, you might have difficulty seeing all three (as the plots should lie "on top of" each other).  To see if this is the case, you can "drag up" the "Plot 1" indicator on the Graph to show "Plot 2" and "Plot 3", right-click it and select "Visible Items", then turn on the Plot Visibility Checkbox.  If you turn off Plot 1, you should see Plot 2.  Alternatively, you could arrange your plots so they aren't all identical (the simplest way would be to change the Frequency to 9.9).

I've taken the liberty of rewriting your code to illustrate what I just said.  You'll still see only one plot (for the reasons I explained), but I told you how to see all three.  I also hope you see that this version is a simpler and more direct example.  This is a LabVIEW 2016 "snippet" -- I think you are running LabVIEW 2013, so you won't be able to "drag and drop" this into your Block Diagram, but it should be simple enough for you to recreate it "from scratch".

Waveform Array Plot.png

 

Bob Schor

 

P.S. -- simulating "an external signal that changes every 1 second" with "a signal that is identical every 1 second" can lead you astray ...

0 Kudos
Message 2 of 5
(2,372 Views)

Firstly, let me thank you for your reply and for your important notes, as they are really helpful. I appreciate that you wrote the code again for me.

Regarding the dynamic data, I am using this simulator because I will be having DAQ.

To be more specific and accurate, this DAQ will show some SEQUENTIAL readings separated by a known time interval (say 1 second). I want to display all these readings, but each of them in a separate graph.

 

0 Kudos
Message 3 of 5
(2,362 Views)

@abdAllaHefny wrote:

Regarding the dynamic data, I am using this simulator because I will be having DAQ.

 


DAQmx is really very simple, very straight-forward, much easier to use and understand than the Dreaded DAQ Assistant and its Evil Twin, the Dynamic Data Wire, both of which are designed for the "Quick Fix, No Thinking Required".  Have you ever tried building a Task in MAX or in your Project (right-click My Computer in Project Explorer, choose New, NI-DAQmx Task, and follow directions)?  Have you read the tutorial material on DAQmx, including the excellent White Paper "Learn 10 Functions in NI-DAQmx ..." (a Web Search will show you videos, PDFs, the original Documentation, and others)?

 

If you are working with Sampled Data, Arrays and Waveforms are (at least, for me) much more convenient and transparent than Dynamic Data Wires, and also make for much "neater" (and hence comprehendable) Block Diagrams.  They also tend to work the first time (or require a modest "tweak", like the occasional Transpose 2D Array ...).

 

Bob Schor

0 Kudos
Message 4 of 5
(2,334 Views)

I do not have except to thank you gain for your helpful instructions.

Fortunately, I found I way to do what I have told you about previously. 

Thanks again!

 

I attached the file. If that can help somebody visiting this topic.

0 Kudos
Message 5 of 5
(2,333 Views)