Hi!
I guess the answer will be pretty obvious, but I thought to save myself some headaches by asking first.
I've used RTFIFO's a little bit on a previous project, so they sprang to mind quickly for this app, but when reading here on the forum, Queue keeps getting mentions. So far I have not seen or heard anything that singles out one over the other, so I'll ask here to see if there is any merit to one over the other.
I use LV 7.1 with the ETS RT and FPGA modules.
The application target will be a standard WinXP computer (no "true" RT environment in other words), but as far as I have been able to determin, I can still use RTFIFO on a windows target app... right?
The application goal/function (for the part concerning the buffer):
[estimate that a 1 to 2 second buffer will be plenty.. so, some 9600 to 19200 elements of "unsigned int8"'s..)
* Read serial port at 9600baud
--> log all data in "raw" bin file
--> search for header
-->extract (from header) packet length
-->read entiere packet and compare CRC16 to validate comm. packet
-->log data in a "high-level" way, using channel information etc.
-->present data as curves and indicators for user
What would be the recommended way to go here? RTFIFO's or Queue?
The way I'm thinking of doing it, is to read "chunks" from the serial port (using VISA Read), and branch the read string, one to the input buffer and one directly to a raw data file. Then in a sepparate loop, I'll poll the queue (to make sure I got enough elements) and search for "start of header sequence" etc.
The one thing I'm worried about, and which makes me lean towards the RTFIFO is how Queue handles "simultanious" writes and reads? Maybe I'm mixing in to many things from RT targets here, but it seems dangerous to "read" from a variable (the queue) in one loop, while another loop is potentially adding data. In the case of the RTFIFO, this is not a problem since it has built in "protection" to handle this, but with queue....?
I hope someone knows a bit more here and can recommend one or the other.. preferably with some "why's" to back up their recommandation.
(Maybe RTFIFO is more optimized and runs with a smaller overhead?)
---------------------------------------------------
Project Engineer
LabVIEW 2009
Run LabVIEW on WinXP and Vista system.
Used LabVIEW since May 2005
Certifications: CLD and CPI certified
Currently employed.