<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12"><TITLE>Interrupts</TITLE></HEAD><BODY><P><FONT FACE="Arial">Good morning,</FONT></P><P><FONT FACE="Arial">I have two third party data i/o cards that I am trying to integrate into my VEE application. I am running VEE 5.0. Both of the cards sit on the PCI bus. One is a 32 channel digital input the other is 32 channel digital output. The 32 channel digital input has COS (change of state) detection. The card will generate an interrupt on the PCI bus when it sees a transition high/low or low/high.</FONT></P><P><FONT FACE="Arial">My question : Is there a function or panel in VEE to capture this interrupt ? Ideally I want to capture the interrupt, execute a thread, and then reenter my program at the spot that the interrupt occurred and continue.</FONT></P><P><FONT FACE="Arial">Thanks in advance</FONT><BR><FONT FACE="Arial">Ross Bledsoe</FONT><BR><FONT FACE="Arial">rbledsoe@coinco.com</FONT></P></BODY></HTML>
>The card will generate an interrupt
>on the PCI bus when it sees a
>transition high/low or low/high.
Convenient.
>My question : Is there a function
>or panel in VEE to capture this interrupt
*Maybe*
>Ideally I want to capture the interrupt,
>execute a thread, and then reenter my
>program at the spot that the interrupt
>occurred and continue.
Conditions: Windows Whatever, VEE 5.01
Hopefully the third party supplied an ActiveX control to interface with
their driver. If so, there's probably an event that represents the
interrupt. If so, all you have to do is:
Make sure VEE's Compatibility Mode is set to Standard.
Check the control in Device -> ActiveX Control References.
Plop the control on your work area.
Right click the control and select Create Event Handler.
Pick the interrupt event and click Ok.
That's it. VEE will dump you in the event function. Anytime the event fires
VEE will call this function to handle it. This can occur at any time
anywhere in your VEE program. This would behave exactly as you want with the
exception that the function would not be executing in the context of a
separate thread. However, VEE would not time-slice away from the handler
function before it's done.
If they did not supply an ActiveX control or it doesn't contain an event
fired by this interrupt, you're still not out of luck. At the very least,
they will have supplied a dll to talk to the driver. Somewhere in there will
be a mechanism that notes the interrupt. It will probably be in the form of
a callback. Depending on the parameter list to this callback, you might be
able to use the CallVee api to propogate the interrupt from your callback
directly to VEE. Alternatively, create your own ActiveX control to propogate
the event to VEE.
The important thing is that whatever mechanism you use to propogate the
interrupt back to VEE, it can't be a blocking call. For instance, if you set
up a function in a dll to wait on a Win32 event object (signaling the event
in the interrupt callback and reseting it when VEE is done processing the
event) the thread that waits can't be from VEE.
Keep in mind that "multithreading" in VEE means that VEE itself timeslices
one and only one Win32 thread. If you call a wait function directly from
VEE, VEE will stop dead until the wait returns.
-SHAWN-
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo. To send messages to
this maillist, just email to "vrf@lvld.agilent.com". Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.agilent.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.agilent.com".
---------------------------------------------------------------------