AnsweredAssumed Answered

VRf - ActiveX and time-slicing

Question asked by aufenanger on Apr 27, 1999
Latest reply on Apr 27, 1999 by aufenanger
Hi all Vee-Users,

I feel always that's a missing feature in HP VEE this software interrupts.
The Rocky Mountain Basic was able to handle several software interrupts with
different priorities. This would be fine in HP VEE too. Although it is hard
to get it to work correctly if your programming structure is not good
enough, it would be very useful to have it. 

Take care to leave the interrupt function as quickly as you can to give the
interrupt system the chance to work correctly.

Best regards
B. Aufenanger
------------------------------------------------------------
Somatec B. Aufenanger & M. Bernhardt
Jagdweg 7a
D-82041 Deisenhofen

Telefon          : (089) 613 984 91
Fax.               : (089) 613 981 23
Email             : Aufenanger@somatec.de <mailto:Aufenanger@somatec.de>
homepage     : http://www.somatec.com <http://www.somatec.com>
------------------------------------------------------------

-----Original Message-----
From:     David Paslay [mailto:DPASLAY@Coinco.com]
<mailto:[mailto:DPASLAY@Coinco.com]>
Sent:     Tuesday, April 27, 1999 5:11 PM
To:     'BRUCE_WENNER@hp-usa-om22.om.hp.com'
Cc:     'VRf mailing list'
Subject:     VRf - ActiveX and time-slicing

The interrupt handler was called via the formula control pin to disable
multi-threading so interrupts could be handled in a reasonable amount of
time.

At first I made a flag so that when I was interrupted I checked it, if it
was set I re-enabled the interrupt and exited without calling any other
userfunctions. To call a function that the interrupt handler calls I just
set the flag, then called it, then cleared the flag. Sort of like an
interrupt mask on a micro controller. This works, but I thought it would be
more appropriate to create a Force Interrupt function.

I wrote these register based functions in order to use the PIR (peripheral
Interrupt) function of the E1458A digital I/O module. The VXI interrupt for
this card is jumper set to 2. In the command module there is a user defined
interrupt table that sets VXI Int #2 to set the STAT:OPER:ENAB bit 8 and
then I enable an SRQ by the commander on this event. So my 1406 SRQ's on
behalf of a registered based instrument.

Now instead of calling a function that the interrupt handler calls to force
a measurement, I force an interrupt on that port and the same thing happens,
only more appropriately I thought.

It is analogous to using a software interrupt in an MCU so you're important
registers will get pushed to the stack instead of calling a subroutine which
does not.

-----Original Message-----
From: BRUCE_WENNER@HP-USA-om22.om.hp.com
<mailto:BRUCE_WENNER@HP-USA-om22.om.hp.com>
[mailto:BRUCE_WENNER@HP-USA-om22.om.hp.com]
<mailto:[mailto:BRUCE_WENNER@HP-USA-om22.om.hp.com]>
Sent: Tuesday, April 27, 1999 9:58 AM
To: hpvxd_xc@hpislsup.lvld.hp.com <mailto:hpvxd_xc@hpislsup.lvld.hp.com>
Subject: RE: ActiveX and time-slicing


> I am currently struggling with a similar problem. I have an interrupt
> handler that is caused by an SRQ. It is a user function that
> is called by a
> formula control pin, which makes it non-multithreaded. The
> problem is that
> if this function calls any other function that was executing when the
> interrupt occured, vee will lock up. I don't know if this
> happens with the
> event handlers, but you may want to see.
>

This problem appears to be due to the fact that a call to a function will
block
until any earlier call to the same function has completed.  Performing the
second call non-multithreaded does not allow VEE to return to complete the
first call.

The "easy" solutions include:

- Duplicate the function and dedicate one copy to the interrupt handler.
Not
so easy if the function is large and complex or if it calls other functions
that could result in additional lockups.

- Are you using the Formula control pin to force a non-multithreaded
handler? 
If not, can you modify the handler to call the formula in a multithreaded
manner?

Let us know if you come up with a good solution.

Regards,
Bruce Wenner
HP St. Paul

Outcomes