LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i present 100 samples per second in a Graph?

Solved!
Go to solution

Hello,

 

I am taking through CANBus 100 samples per second and i would like to present those data in a realtime graph.I want to see all the 100 samples and the graph refresh every 1 sec,i am using a waveform chart.

I would like my chart to be updated with new data every one second(1 SEC 100 samples,2 sec 200 samples etc) and be able to see in the graph all the 100 samples we take in real time.My question is this possible?I think some how i have to alter the x scale of the graph?I have done a small code in which i change the x scale of the graph and put real time but in the graph is shown only one sample from 100 samples i am taking every second,can you please suggest a code solution for this?

0 Kudos
Message 1 of 18
(4,911 Views)

Instead of a chart, you want to use a waveform graph.  A chart keeps track of its history and will start to scroll while a graph will simply refresh.


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
Message 2 of 18
(4,904 Views)

and by using  a waveform graph by problem would be solved?are you sure?I am not taking an array just reading simple values,ok i can build an array with those values.How can i have real time in x scale in a waveform graph?

0 Kudos
Message 3 of 18
(4,901 Views)

If you are not taking an array, then you are not taking 100 samples per second. Your code is meaningless since you do not show the actual acquisition. You are, in fact, only writing a single sample to the chart.

 

If you really are using a chart and if you really are taking a single sample at a time, you can simply look at the shipping example called Real-Time Chart. If you are really taking 100 samples per second, then use the same property nodes to add the timing information or create a waveform data type from the array.

0 Kudos
Message 4 of 18
(4,898 Views)
Hello to all,
Ipost an image of  my Vi you can see an example of how i am taking my data through CANBUS. With a sampling time of 10ms between each iteration of the loop I am taking 1 sample per iteration so in 1 second I have 100 iterations that means 100 samples per second. In my program I am using a waveform chart and if I zoom in(see picture with name waveform) I don’t see 100 samples per second but I only see 1 sample per second. Why? How can I fixed that to see 100 samples per second? I would like my graph to start from zero second and to be refresh with data every to 2 sec(that means 200 samples for 2 seconds).Somehow I have to change the x scale? Can anyone please provide a suggestion code for this? If i use a waveform graph i will take something as shown in the picture waveform graph and this is not something i want.
 
Download All
0 Kudos
Message 5 of 18
(4,865 Views)

The image of my graph in which i am seeing only 1 sample per second instead of 100 per second

0 Kudos
Message 6 of 18
(4,864 Views)

You are NOT doing anything to scale the x axis. Where do you think the scaling information is going to come from if you do not provide it? Did you even bother to look at the example I mentioned?

0 Kudos
Message 7 of 18
(4,849 Views)

I just found the example you mention and try to understand how it works,this vi you mention take a point every ms.Ok probably is something i want and as you see in the picture i post i doing something like that.How can i refresh the chart every 2 sec to read my samples.I would like to have a graph startin from o sec till 1 sec to see 100 samples in my graph from 1-2 sec to see 200 samples in my graph,can you please post a code example to help me.

0 Kudos
Message 8 of 18
(4,842 Views)

If you want to refresh every x number of  seconds to show all of your samples, then you need to build an array of samples and display them in a graph. That is not at all what you are doing now. So you could put your acqisition VI inside a for loop and wire the data out with autoindexing enabled) and to the graph. That still will not fix your problem of reflecting real time on the x axis.

 

Your last statements are confusing. If you display 0-1 sec, you would see 100 samples and if you displayed 1-2 sec, you would also see 100 samples.

0 Kudos
Message 9 of 18
(4,836 Views)

Ok i understand this part you are saying (If you want to refresh every x number of  seconds to show all of your samples, then you need to build an array of samples and display them in a graph) in my program i am reading my data in a while loop and there is a delay of 10ms in each iteration of the loop and each iteration i am able to take 100 samples with tha sampling time.Let me also post a vi according to what you suggest if understand correct.As you said the question for the x axis remains.

The laste sentence i made a mistake sory i mention 0-1 sec 100 samples 1-2 sec 200 samples etc

0 Kudos
Message 10 of 18
(4,833 Views)