07-08-2017 06:07 AM
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
07-08-2017 06:23 AM
Use a shift register, as I'm sure has been suggested.
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.
07-08-2017 07:41 AM
Hi Mr.Butcher,
I need to know about the second thing that refers 'store values over time and indexing', i don't understand this.
07-08-2017 09:51 AM
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.
07-10-2017 02:48 AM
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
07-10-2017 03:07 AM
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
07-10-2017 03:10 AM
he meant, that you should use the "index array" function
07-10-2017 03:18 AM
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
07-10-2017 03:26 AM
07-10-2017 04:11 AM
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.