LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview realtime USB write

I am trying to write data ot a USB thumbdrive in LabVIEW realtime. After
having written 22 files to the USB stick, which is a 4GB, each file is 512
bytes. I get the following message displayed on the realtime target.
WARNING: flush from cache to disk failed - data discarded.

I am using labview RT 8.5.


Regards,

Tom


0 Kudos
Message 1 of 4
(3,438 Views)
What Real-Time platform are you using? (cRIO, PXI, Phar Lap ETS, FieldPoint)

Does this error show up on the host PC, or at a bootup screen in text?

Also, a word of caution to any customers reading this topic:  USB and Real-Time do not mix well because USB ruins determinism.  USB ports are polled roughly 1000 times/second, and this polling and disrupt your code and cause it to be late.

Trey B
Applications Engineering
National Instruments

0 Kudos
Message 2 of 4
(3,411 Views)
Does this mean that whenever the USB Stick (or memory) is plugged into say a cRIO unit, that you get this performance hit?  Or is that only when you try to actually access the USB port?  i.e. if we put the USB read/write in a non-critical loop are you saying that all the processes will be effected?
 
'Bonny' MacGreggor
0 Kudos
Message 3 of 4
(3,336 Views)
Reading and writing to USB in a non-critical loop would definitely lower determinism.  It will probably still be more deterministic than Windows, but it isn't optimal.  If that USB drive is a shared resource, then you also run the risk of a priority inversion.

How fast USB is polled depends on the particular system.  I usually pull out the number 1000 because I think that's the theoretical limit of the standard.  It would make sense for the USB drive to be polled less frequently when not actively transferring data, but I'm not familiar the USB standard to that degree.

These KBs, which should probably be merged, talk about jitter caused by USB and how to disable USB.

http://digital.ni.com/public.nsf/websearch/3cf9e0de9940b11e862568d200800739
http://digital.ni.com/public.nsf/allkb/9171AF026183A6EB862571AB00820757?OpenDocument

Trey B | Applications Engineering | National Instruments
0 Kudos
Message 4 of 4
(3,319 Views)