LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

crio usb first access slow

Hi all,
 
I just encountered a strange problem: I write about 1,5 MB of binary data to an external USB drive on a crio-9014 controller using the "write to binary file.vi" from the file palette. The write operation normally takes a few seconds, but the first write operation after controller restart takes about 45 seconds. I crosschecked everything else, it's definitely the write to binary vi that is causing this delay. Every write operation afterwards works at normal speed. The USB drive is not in sleep mode, so it cannot be the spinup time of the disk or something like this. Before writing, I perform a check if the drive is there by reading the drive info. Only if this test passes I start to perform the write.
 
Did anybody encounter this problem before?
 
Thanks & Regards,
 
Stefan
0 Kudos
Message 1 of 13
(5,893 Views)
Hello,

the customer found out that the speed is depending on the size of the USB device.
I tested it out with a normal USB Stick with 128MB and it works fine (also after reboot).
If you use a usb 320GB floppy dirver it takes about 45sec before you could write to the floppy.
In this case the software create a new file for the data.
But if the file already exist on the floppy drive it works fine (also after reboot).
It would be greate if you could send me more information about this behaviour.

Kind regards,

Elmar

System Info:
Windows XP SP2
LV 8.2.1
LV RT 8.2.1
new cRion driver
0 Kudos
Message 2 of 13
(5,855 Views)
Hi Stefan and Elmar,

My first question is whether you have installed the Boot Rom Field Update Utility for cRIO-901x Controllers?

Note that this update is independent of NI-RIO.  This addresses some disk I/O performance issues. If you install this utility and notice that the peformance is the same, let me know and I'll ask R&D for more information.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 3 of 13
(5,825 Views)
Hi again,

So apparently this field update utility doesn't affect File I/O via the USB port, though obviously it is still a good idea to install it.  What method are you using to measure the timing?  The best way is to use a three frame sequence structure, with the first frame taking a time stamp, the middle frame executing the code, which could just be creating a new file and writing a single character, and a final frame taking another time stamp...
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 4 of 13
(5,820 Views)
Hi, any update on this issue?
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 5 of 13
(5,506 Views)
Hey Doug,

thanks for the information. I think the customer now know how use usb storgare device with cRIO.
Thanks for the support.

Kind regards,

Elmar
0 Kudos
Message 6 of 13
(5,474 Views)

Hi Doug,

in fact, the issue is not solved yet - I still have the problem that the first USB drive write access needs about 30 - 45 seconds, all following write accesses are faster and comply with the speed figures that were posted by NI. It seems like the controller needs this long time to mount the file system.

The strange thing is that it's not really the first write access but the first creation of a new file which takes this long time.

This is an example sequence in which I found out about the creation issue:

- create a file "dummy.txt" --> takes 45 Seconds

- create a file "dummy2.txt" afterwards --> takes "zero" time

- reboot

- overwrite "dummy.txt" --> takes "zero" time

- delete "dummy.txt"

- reboot

- create a file "dummy.txt" --> takes 45 Seconds

 

Currently, I'm first deleting an then recreating a dummy file at controller startup and wait for this to finish. Anyway, I would really like to understand what is causing this long access time upon first write.

Regards,

Stefan

 

PS: My controller seems to already have the new boot ROM; Update Utility reports:

*****
Processing cRIO-901x at 172.123.456.789
The controller already has a boot ROM version >= 2.2.  Skipping update.

Message Edited by StGl on 09-26-2007 08:19 AM

Message Edited by StGl on 09-26-2007 08:24 AM

Message Edited by StGl on 09-26-2007 08:25 AM

0 Kudos
Message 7 of 13
(5,062 Views)

Hi Stefan,

You may want to post your test code your using to benchmark the Open/Create file.  I tried this with a USB stick of my own and didn't see the same behavior.  Does this also occur with other USB storage devices or just this one?  Different USB devices ( and CompactFlash devices) can have different timing ( e.g. read/write times, open/close files).

Regards,

Bassett

0 Kudos
Message 8 of 13
(5,042 Views)
Hey Bassett,
 
there's nothing much to post about the timing - I just let the Controller LED flash one time after the write was finished. As the first file creation takes about 45 seconds, I just looked onto my watch 😉
 
I attached the code which is executed at controller startup - the Check U: SubVI just reads the drive information and reports an error when the drive doesn't exist. Then, the dummy file is first deleted and then recreated - and this takes very long, as I already mentioned. Afterwards, all file creations are fast...
 
Indeed, this behavior seems to only occur when writing onto large FAT32 partitions - I have a 320 GB USB hard drive for my logger application. When using a smaller partition size, the wait time upon first write seems to drop down the smaller the partition is. On a memory stick, I wasn't able to "feel" the slow first write either.
 
It definitively seems to be an issue with big file systems - and of course I'm curious what is causing this behavoir. My data logger is functioning perfectly, but I want to be sure if there is not a bigger problem behind this.
 
Regards,
 
Stefan

Message Edited by StGl on 09-27-2007 09:26 AM

0 Kudos
Message 9 of 13
(5,034 Views)

Just to be clear I have to ask if your taking into account the amount of time it takes for the RT controller to boot and launch the startup exe.  It will take ~20 seconds for the cRIO controller to boot and launch a startup exe ( blinking the light ).  A better measurement would be to benchmark the open/create file IO VI to see if its different.

I attached the VI I used below.

Bassett

0 Kudos
Message 10 of 13
(5,021 Views)