07-24-2016 06:38 AM
hi
i wrote a code for ARM lpc1768 (ADC) then tansfer data by serial port(9600 baud rate) then i recieve data correctly in labview
but there is an issue that when i wanna plot it labview because of the sampling frequency labview cant detect most of data and just detect the peak of the sin wave input
in matlab i can plot data correctly because matlab buffering data
can someone help me how should i do this in labview?
i attach my design and result
thanks
07-24-2016 08:27 AM
1. No need for the outside loop.
2. You should not open and close the serial port constantly. Just open it once (which is done with the Configure Serial Port) before your loop and close it once after the loop.
3. Since you are dealing with binary (raw) data, you will want to make sure the termination character is turned off.
4. That FOR loop is useless. You can just wire the byte array straight to the chart.
5. Does the ARM constantly output the data once commanded or does it only output so many bytes after the command? If it is a continuous output, how does it know when to stop? You also would only need to send the request for data once. If it is on X bytes after the command, then use a constant to tell the VISA Read to read that number of bytes.
The following snippet is assuming you only send X bytes per read request.
07-24-2016 10:01 AM
i omit the outside loop and for loop but it doesnt work!
since im new to labview would you exatcly tell me what to do?
i should deliver this project in a few days and still dont know how to solve this.
when i use datasocket for buffering data all of data detect correctly but there is problem that when it collect the highest value (255) then inestead of collecting next data (254) it start from the begining(0).
data transfer speed is so high(like 1KHz) that can make problem?
07-24-2016 12:49 PM
@benyamin wrote:since im new to labview would you exatcly tell me what to do?
My snippet wasn't clear enough?
@benyamin wrote:data transfer speed is so high(like 1KHz) that can make problem?
At 9600 baud rate, you are bascially getting a byte every 1ms. That is an eternity to a computer. That is not your problem.
Perhaps you should share your ARM code so that we can understand the actual protocol you are using. We can give a lot better advice with that information.
07-24-2016 01:13 PM
i cant figure it out what that (byte per second) function is !
i attach my code so you can realize the whole operation.
thank you very much
07-24-2016 07:21 PM
Ok, so your ARM is just constantly sending data. No command is needed to start it up. This should be all you need to do.
And since you should be sending data at about 1kHz rate (1ms per data point), I would use something like 50 in the Bytes per read which would give you 50ms worth of data with every read.
07-25-2016 12:16 AM
using visa for 1k /s rate with single data for every request is not wisdom method to work with visa in pc because it is maximum speed that is possible
so do this
design a memory (fifo) in your board and arm program that could save 10 data and send it in array mode to pc
then use visa with request every 100ms to solve this problem
07-25-2016 12:18 AM
also it is better to send a counter number beside your data to check and make sure that you do not lost any data
07-25-2016 12:20 AM
using costumer and consumer(queu) method in coding also recommended
07-25-2016 12:26 AM
for last help
it is better using send a comment to receive data instead of continuous sending data with your arm it could help you to better pc &arm synchronizing
for example send log on comment to arm to start sending data