LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does Close File need to be outside the while loop in Pocket PC applications?

Does "Close File" and its "Simple Error Handler" have to be outside the while loop in a Pocket PC application? 
0 Kudos
Message 1 of 5
(3,007 Views)

Why would they have to be outside the loop?

Isn't this like a normal LV application - If you're opening the file inside the loop you also close inside and if you open it outside the loop you also close it outside?


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(3,006 Views)

And to make another point, because OS calls on a PDA are particularly slow and File IO certainly involves OS calls, if you can write your program with the open/close file VIs outside of a loop you should.

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 3 of 5
(2,993 Views)
what are the factors that determine the speed of OS calls?  speed of processor?  size of RAM?
0 Kudos
Message 4 of 5
(2,991 Views)

The only short answer to that question is “everything” – that is, the speed at which the OS executes its functions is dependant on the code of the call, and the time it takes the computer to execute that code.  In the case of Windows, Microsoft has control of the first part – the actual code behind the calls – and they are free to change up that code any time they please (hence new OS versions, OS updates, etc….).  The second part of the equation is dependant on the hardware.  The biggest factors determining this are the RAM and the Processor, though the speed of the BUS and the speed of the hard-drive are often a big bottleneck in modern computer systems.

 

The fewer calls you have inside of a loop the better, every time you make a call to “open file” a function call is made to the OS.  If you can move that outside of a loop you can greatly enhance performance.

 

Hope it helps, and best of luck with your application!

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 5 of 5
(2,979 Views)