LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I put strings into an RT FIFO?

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.

 

 

Download All
0 Kudos
Message 1 of 3
(3,392 Views)
OK, here's a much simpler example.
0 Kudos
Message 2 of 3
(3,387 Views)

Never mind.  I wasn't setting the number of elements in the array for the FIFO, so it defaulted to 1.

 

0 Kudos
Message 3 of 3
(3,385 Views)