cancel
Showing results for 
Search instead for 
Did you mean: 

waveform graph problem

SOLVED
dineshmeena
Member

Re: waveform graph problem

Message contains an attachment

is there anyway to plot a time(X-axis) versus acquiring data(Y-axis) in a Xy graph the vi i have attached here? and also how can i configure a sampling rate using DAQmx timing palette so that i can acquire a 1 to 100 samples per channel per second.

Thanks in advance,

Regards,

Dinesh

Tags (1)
cbutcher
Trusted Enthusiast

Re: waveform graph problem

Message contains an image

Use a shift register, as I'm sure has been suggested.

 

sr.png

 

However, this won't do what you want when you change the X and Y values. You should have a case structure or event structure, so that if the X or Y values change, you reset the array to empty (+ new values). Alternatively, and more likely, you need to store all values over time, and index as needed from a 2D Array.


GCentral
dineshmeena
Member

Re: waveform graph problem

Hi Mr.Butcher,

          I need to know about the second thing that refers 'store values over time and indexing', i don't understand this.

 

 

Highlighted
cbutcher
Trusted Enthusiast

Re: waveform graph problem

What I mean is I assume you want to be able to change the values of X and Y, and display their historical values, not just new values starting when you set those values.

 

For this to work, you need to keep all of the data you acquire in memory. Use a Shift Register and the Build Array (with the mode set to Concatenate using right-click menu) to do this. Index out the appropriate rows of your 2D array (channel vs time) to get specific channels.

 

The tutorials at the top of this forum board should be helpful if you need more guidance. You already have almost all of the components. 


GCentral
dineshmeena
Member

Re: waveform graph problem

Hi butcher,

   I get it but what it denotes that 'Index out the appropriate rows of your 2D array (channel vs time) to get specific channels' i need some advice in this.

 

Thanks in advance,

Regards

Dinesh

dineshmeena
Member

Re: waveform graph problem

Hi butcher,

       I have find out the solution, thanks. But i need some example vi for some clarification, either you can send me some example code or i will send my own.

Thanks again,

regards,

Dinesh

jwscs
Active Participant

Re: waveform graph problem

he meant, that you should use the "index array" function


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
dineshmeena
Member

Re: waveform graph problem

Message contains an attachment

Hi butcher,

 I have send you a model vi but i'm not sure is it right or not, but whether it is right how i use this same function in a vi that i made how can i configure to see time vs any channel using enum control have used.

Regards,

Dinesh

jwscs
Active Participant

Re: waveform graph problem

Message contains an image

mpf5.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
cbutcher
Trusted Enthusiast

Re: waveform graph problem

Message contains an image Message contains an attachment

Improved version of your earlier VI, backsaved to 2013. Study the parts especially outside of the loop with the Initialize Array so that you understand the idea for the array sizing. Note the branching locations for the 2D Array so that the Chart doesn't receive the time array.

 

You need to fix your Enums, using a Typedef preferably. Currently the X and Y aren't the same and so it's not obvious why the XY Graph 1 gives strange results but checking to see the actual values makes it clear.

 

model 1_BD.png


GCentral