The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Nested For loops and Waveform Charts

SercoSteveB
Active Participant

Assuming that before execution the display of each was clear; which of the following Waveform Charts is displaying the data generated by the VI?

 

Graphs #1.png

a)

 

Graphs 1a.bmp

b)

 

Graphs 1b.bmp

c)

 

Graphs 1c.bmp

d)

 

Graphs 1d.bmp

Comments
mini09
Active Participant

I hope none maches my result... 90% of my result is C. explain ur concepts too....

w0utje
Member

don't know, I don't see the pictures

Wouter.
"LabVIEW for ARM guru and bug destroyer"
SercoSteveB
Active Participant

Apologies, was having trouble posting at work so tried at home.  Everything looks ok now?   Just realised I didn't make a note of the original order of the answers, be aware these may have changed!

mini09
Active Participant

The ans is C steve....

RustyStrings
Member

I thought the answer was C but then ran the code, now I say the answer is A

(these things are not intuitive)

mini09
Active Participant

Yeah Rusty you are correct i made a mistake by interchanging the N terminal values. the answer is A

SercoSteveB
Active Participant

Answer A:

It seems OK to me.  If I were to remove the inner loop and run the VI; I would get a 1D array (a single column) and a single plot of five points on the chart.  If I add an additional loop (so its like as shown in the question), I would expect it to add a column to my (now 2D) array for each iteration.  These additional columns should translate to additional plots of the Waveform Chart.

Some info on the data you can write to graphs and charts - from NI.com

SC_8
Member

ans d

RAMESHB
Member

ans D

crossrulz
Knight of NI

Rameshb, did you not read where Steve told you the answer is A?  Furthermore, did you try to run the code?

And on a final note, you know that the answer will have to do with 3 and 5 (the number of times the FOR loops are ran.  So is it 3 waveforms of 5 elements or 5 waveforms of 3 elements? That logic brings it down to A or C.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
erganesh
Member

Answer A

ashwinilele
Member

Ans is A .

I think that 3 plots 5 points . Because in waveform chart by default transpose array is ON.

While in waveform Graph it will be 5 plots and 3 points ...

Is this correct?

ra123
Member

ANS is D.

it is plotting of 3 colums as individual plots.

RustyStrings
Member

Why do you think it only plots 3 times in the x scale?

Read what SercoSteveB has written above

Another way to think about it is:

There is an inner loop that will creat an array with the values

0,1,2

this loop is run 5 times and a 2d array is created, and plotted

The data will be:

[0,1,2],[0,1,2],[0,1,2],[0,1,2],[0,1,2]

try writting the code to see what you get

if the plot was fomatted like this it may be easier to see


plots.PNG

RustyStrings
Member

I think the confusing thing is that the data that is in a column of an array is plotted on the x axis of the graph

array.PNG

xh218
Member

By default, the waveform chart treats each column in the array as a single plot. Wire a 2D array data type to the chart, right-click the chart, and select Transpose Array from the shortcut menu to treat each row in the array as a single plot.

--From LabVIEW help file.

ersmt444
Member

By reading comments,Question will be very interesting but i am not able to see the image.Image is broken.

 

Blake.N
Member

Ans A

skian
Member