LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem in decimating an array and ploting

Hi all

I am using lab view 7.1. data taken from serial port is split into three parts using decimate array function. then i plot these three arrays in wave form chart. Data splitted is correct and all is working well but plots are wavering that is first plot sives second plot data the second gives third data and after ten second it waver and process continuous after ten seconds what should i do. if i want to have my data for 5 minutes on the screen then what technique should i use

best regards

Mrs Saira Saleem

 

0 Kudos
Message 1 of 6
(2,931 Views)

I dont know what you mean

Data splitted is correct and all is working well but plots are wavering.

Please attach you code or screen shots for better understanding.

Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 2 of 6
(2,926 Views)

You are not showing any code and your description is not very clear, so we can only guess.

 

Can you show us how you are feeding the three parts to the chart? How many points do you receive per iteration?

 

Please attach your VI.

0 Kudos
Message 3 of 6
(2,914 Views)

@altenbach wrote:

You are not showing any code and your description is not very clear, so we can only guess.

 

Can you show us how you are feeding the three parts to the chart? How many points do you receive per iteration?

 

Please attach your VI.


hi all

 i am attaching my serial2.vi . as seen in the 1.bmp,2.bmp, 3.bmp that three analog to digital converter values are separated but they change the plot after some time. this is meant what is wavering. also error in serial read comes if i continue then program runs. what should i do also if i want my plot be on the screen for 5 minutes then what should i do

best regards

Saira Saleem

Download All
0 Kudos
Message 4 of 6
(2,864 Views)

The only thing that is really clear is that it appears you are using the run continuous button. DON'T do that. Put a loop around the read and write to chart code.

 

You mention an error but don't provide the error number. Can't suggest a cause or fix without that vital piece of information.

 

I also don't understand using the Bytes at Serial Port and also enabling the termination character. If your read string is terminated, you don't need to use the Bytes at Serial Port. Just set the read count to some high number. The read will automatically terminate.

0 Kudos
Message 5 of 6
(2,855 Views)

I'm guessing he means that sometimes the data shows up on the correct waveform chart, and sometimes to moves to other charts, (1st piece of data shows up on chart 2, data2 shows up on chart3, data 3 on chart1).

 

You are just reading data continuously, convert the bytes to an array, and each byte represents one piece of data.  How are you syncrhonizing and distinguishing the data bytes from each other?  How do you know the first byte you read is really intended for the first chart?  Do you always read exactly 3 bytes of data each iteration?  (and as Dennis says, don't use the run continuosly button)  If you only get 2 bytes, then those go to the first two charts.  Next read, let's say you get 4 bytes, well that first byte is really the third byte of the previous data packet, but will show up on the first chart, and everything will be shifted by one.

 

Also, you have the termination character enabled and set to the new line feed character decimal 10.  But you are reading binary data.  So if you wind up getting a byte with the value of 10 in the middle of your data packet, your VISA read is going to end early because it detected the termination character, and the other bytes in the buffer after that will remain there until the next time you do a VISA read.

 

It seems to me that you have a basic communication protocol problem where you receive data from the device, but you don't have any means of distinguishing the data bytes from each other.  And your use of a termination character with what is essentially binary data is complicating things even more.

0 Kudos
Message 6 of 6
(2,841 Views)