Jump to content

Passing an Interrupt from a DLL to LabVIEW


Recommended Posts

I have a DLL that monitors hardware. When an defined interrupt occurs, the DLL calls an interrupt handler by way of a pointer to the handler. I need to handle this from LabVIEW. Below is the API documentation for the function.

The vmeConnectLM() hooks an interrupt handler when a location monitor is signaled (interrupt occurred).

ULONG vmeConnectLM(

BYTE LMNumber, // LM number 0-3.

ULONG PtrToHandler. // Handler address for the LM INT.

);

Parameters

LMNumber - The LM number range of 0-3.

PtrToHandler - Pointer to a handler to be called when the INT occurs.

Return Values

Zero, if successful; otherwise an Error Code.

Remarks

A vmeAcquireInt() API call must be performed before any interrupt can be enabled or disabled. The handler suppose is to be declared as typedef void (*FUNC)(ULONG). If this command is successful, the Location Monitor interrupt specified by LMNumber will automatically be enabled. The parameter passed into the handler will be the LMNumber.

How/what can I associate to this DLL function? :wacko:

Link to comment

Wow. That sounds complicated.

Rolf! Where's Rolf!? He might know.

So you want to use LabVIEW code as an interrupt handler and then pass along a pointer to that LabVIEW code so it will be executed on an interrupt??

I have limited knowledge in this arena but I'm wondering if you can't implement your own interrupt handler in C using your own custom DLL or code interface node. That would let you come up with a block of code to execute as the handler that you could get a pointer to and pass along to your DLL. Then you could use that block of code in conjunction with some easier mechanism (Queue, Notifier, Occurence etc) to communicate back to LabVIEW that it needs to do something. That way you wouldn't have to directly have a pointer to a chunk of LabVIEW code, but it would still do nearly the same thing. You would also have the option of performing a poll then in LabVIEW which might even be easier than an interrupt driven chunk of code (but that might not be exactly what you need).

Can you expand on how fast you need this to execute? Do you think a dedicated parallel loop in LabVIEW that was polling at a certain rate would be adequate? That sounds a lot lot easier than getting an interrupt handler to directly run LabVIEW code.

Link to comment
Wow.  That sounds complicated.

Rolf!  Where's Rolf!?  He might know.

So you want to use LabVIEW code as an interrupt handler and then pass along a pointer to that LabVIEW code so it will be executed on an interrupt??

I have limited knowledge in this arena but I'm wondering if you can't implement your own interrupt handler in C using your own custom DLL or code interface node.  That would let you come up with a block of code to execute as the handler that you could get a pointer to and pass along to your DLL.  Then you could use that block of code in conjunction with some easier mechanism (Queue, Notifier, Occurence etc) to communicate back to LabVIEW that it needs to do something.  That way you wouldn't have to directly have a pointer to a chunk of LabVIEW code, but it would still do nearly the same thing.  You would also have the option of performing a poll then in LabVIEW which might even be easier than an interrupt driven chunk of code (but that might not be exactly what you need).

Can you expand on how fast you need this to execute?  Do you think a dedicated parallel loop in LabVIEW that was polling at a certain rate would be adequate?  That sounds a lot lot easier than getting an interrupt handler to directly run LabVIEW code.

5780[/snapback]

I will have three A/D channels generating single WORD data running at 1200 Hz each. These will not be synchronized. The channels are enabled and disabled manually, this is a monitoring function I may need to switch hardware and DLL at some pint (this is a VME Single Board Computer), but the alternate DLL offers the same functionality (pointer to a ISH routine). I really don't want to write a wrapper DLL.

I might be able to poll using timed loops, I'm evaluating this now...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.