09-23-2008 04:00 PM
I have a 1 KHz RT loop that occasionally has an event that I want to log to a file. I can't do a file write directly from my RT loop, so I want to use an RT FIFO to get the log message to another lower rate (and lower priority) loop that sits on the RT FIFO, pops off each message, and logs it to a file. Since strings are not supported by the FIFO, I followed the advice I found that said to convert it to a byte array. But all I get out of the FIFO is the first character. When I created the FIFO, I used an arbitrary string and converted that to a byte array to pass to the FIFO create VI. I tried an empty string and a large string, but I still only get the first character of each message. FWIW, attached are the main VI that creates the FIFO and passes it to the sub VI loops, the log loop VI, and an example of a VI that logs an event (digital channel state change).
What am I doing wrong? Is there a better way to do a logger thread?
Keith.
09-23-2008 04:24 PM
09-23-2008 04:27 PM
Never mind. I wasn't setting the number of elements in the array for the FIFO, so it defaulted to 1.