12-02-2010 10:34 PM
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
12-02-2010 10:51 PM
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.
12-02-2010 11:47 PM
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.
12-08-2010 10:45 PM
@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
12-08-2010 11:17 PM - edited 12-08-2010 11:21 PM
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.
12-08-2010 11:28 PM
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.