LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel port interrupt

Is it possible to setup an interrupt routine whenever a line of the parallel port is triggered. i.e if strobe goes I labwindows will go in a interrupt routine and acquire the DATA from the port. Is this possible ?, I want to acquire data via the LPT1.

Thank you.
0 Kudos
Message 1 of 2
(2,857 Views)
Depends on how and where you want to achieve this...

Without going down to the lowest code level, ie. using CVI in a windows enviroment you could do the following:
(Simple method - not necessarily the best way)
Create a global (Say Data Ready)
Create a container to hold the data (representing each bit of the parallel port).
Create a thread that watches the required line becomes active and then upon detection of that line, read the data. After reading the data, set the global container to its value, and set the data ready global too.

You main execution thread can then act upon the flag and read the data in the main global...

You could have some sort of data hiding whereby a function returns the data from the 'interrupt thread' and at the same time clearing
the data ready flag...

Now depending on how fast your data is coming in, will depend if the above works.

It is not a true Interrupt Routine, since it will become sliced with all the other Windows Apps running.

You could give the thread High Priority to help, but utimately, creating an interrupt routine that is high priority enough for fast data transfer is a lot more complicated than above.

Hope this helps more than hinders,

If you need any more pointers, give me a shout and I will see if I can dig out some better references for you...

Regards

Chris
0 Kudos
Message 2 of 2
(2,857 Views)