murali_vml wrote:
> Iam using In port and Out Port vi's in LV and iam using these vi's in
> for loop for some 10000 times.But with my h/w configured,i find that
> "for" loop execution
> takes approx 1 sec to execute.This is affecting my application.What
> could be the reason?
Well, PortIO is a priviliged operation and can not be done from an
application directly without some device driver intervention. There
are two possibilities to do that.
The one NI uses is the proper and documented one by relaying each
port access to a device driver to return or updtate the port value.
But this requires a context swith of the CPU from application level
to kernel and back, and that is expenisve in time.
There is another way by using some undocumented kernel services to
enable
IO access for certain port addresses for a particular process.
You still need a device driver to actually enable the desired
addresses for a specific process to be accessed, but the access can
then happen directly in the application context and therefore be
somewhere between 20 to 100 times faster.
I have developed such a device driver/user application dll and the
according VI library to do these things. It is available for free
download in the OpenG Toolkit, but not yet part of a distribution
binary. You will have to download the files individually from the
sourceforge CVS depository at
http://cvs.sourceforge.net/viewcvs.py/opengtoolkit/portIO/
You actually only need the files in the built/ subdirectory for
execution. The rest are source code and development versions.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390