LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Fast acquisition on serial port problem

Hi,

I'm using CVI 6.0 FULL and Windows 2000

I have some troubles to find the best end efficient way to acquire, manage and display the values on a graph.

Here is the problem, I receive data from a MCU (Cygnal F020) the data is acquired 500Kps, and I want to send it via serial Rs232 115200 bps to my PC, I know that I need a circular buffer, but I can't find the formula to calculate the exact minimum size to ensure a safe data transfer without over writing my buffer.

Then what would be the fastest method to display my data on a graph so I can have a virtual scope effect. Should I plot it by 1000 data values or 1 value at a time ? if someone have done something similar that could help me I will appreciate.

Should I u
se ActiveX graph or the normal graph ?

Thank you,
0 Kudos
Message 1 of 3
(3,034 Views)
As for the graphing questions, you should plot full buffers at a time, it would be much faster. The more data you can plot at a time (up to the X range on the graph) the faster. Unless you have a specific graphing need that requires the ActiveX graph functionality, the native CVI graph should be slightly faster and easier to program.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 3
(3,034 Views)
As for the serial buffer question, there is specific formula persay and is very dependent on what on the format of the incoming data and how you intend to process it. As with the graphing, lager data transfers are usulay more efficient. Your buffer should probably be about twice as big as yoiu average read is going to be.

If i were to guess from what you've said, you'll just have a loop which will do a commrd and then plot the points think about how fast this loop will run, you'll probably want to read just a bit more then you expect to aquire in the loop. Remember also that really fast loops will keep your computer from doing anything else. it is highyl advisable to throw in a process system events into the loop.

Also if you are really woried about overwriting yo
ur buffer, you should look into wether your instrument is capable of handshaking. Also, doing a couple test runs and playing with your loop time and buffer size is really the best way of doing it.

Good luck,
Amaury R.
Applications Engineer
0 Kudos
Message 3 of 3
(3,034 Views)