09-29-2003 05:01 AM
09-29-2003 08:45 AM
09-29-2003 09:27 AM
10-01-2003 04:08 AM
06-06-2005 08:17 AM - edited 06-06-2005 08:17 AM
Message Edited by dsbuxi on 06-06-2005 08:18 AM
06-06-2005 08:55 AM
@dsbuxi wrote:
Hello! Ive had the same problem, and when I use the Flush I/O command, i do not seem to get any data back.
Is this because Ive placed the Flush I/O buffer at a wrong place? Ive tried placing it before the write VISA or after Read Visa palette.
dsbuxi,
'Flush I/O buffer.vi' does clear everything that's already in the buffer. Old data, probably overwritten several times, bulk. Use this vi after having configured your port and before trying to read any reasonable data. In plain semicode:
* configure port
* clear shift register
* Flush buffer
* While not finished do
+ N = Bytes at serial port
+ if N > 0 VISA read N bytes, append to shift register
+ detect any complete messages in the shift register,
+ remove such complete messages (and delete their predecessing bytes)
+ send complete messages to an 'independend processing loop' (by a named queue or whatever you like)
+ Check finish condition, wait some ms if unfinished
While end
* stop the 'independend processing loop'
* release the serial port
* In the 'independend processing loop', read and process your complete messages
This is just a raw idea, but it should work.
The important points are:
1. Flush just once at startup
2. Have one process or loop receiving data and sorting out complete messages
3. Have na eindependent process or loop processing your messages
4. Have an apropriate wait in both processes or loops to give the other some CPU cycles.
HTH and Greetings from Germany!
--
Uwe
06-07-2005 04:07 AM
06-07-2005 09:43 AM
06-07-2005 09:47 AM
06-08-2005 04:31 PM