LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot data following receiving from VISA

Highlighted

Hello,

 

I am reading data from a microcontroller using VISA function in labview. I can convert these data to decimal values (this is what I want).

I want to build a X-Y graph in this way:

Every time I receive a value from VISA, I want to put this value on the graph (Y value) with respective number of reading (X value).

For ex. if the first time after reading VISA, I receive 128, I want to have X=1, Y=128 on my graph. If the second value from VISA is 154, I want to have X=2, Y=154, etc...

Could you please help me how to do that.

My main concern is how to build the X axis.

 

Thank you very much.

0 Kudos
Message 1 of 2
(761 Views)
Highlighted

You could build the X array the same way you build the Y array.  Keep the previous value of X in a shift register and add 1 every time you put an element in Y.

 

If X is always going to be the reading number, then you could use a waveform graph and just feed Y to it.  The only issue you would have is that the first element will have x = 0 rather than 1. The default condition for a graph is to use the index values of the Y array for the X-axis.

 

If you need the X-axis to start at 1, you have other possibilities.

1. Place a dummy element at location zero in the Y array. Turn off Autoscaling for the X axis. Set the X minimum value = 1.

2. Use Ramp Pattern.vi to generate the X array. (X-Y Graph).

3. Use a for loop and autoindex "i" to the X array. Add 1 to the array. (X-Y Graph).

 

Lynn

0 Kudos
Message 2 of 2
(724 Views)