HTBasic Help
×
Menu
Index

Handling Service Requests

 
HTBasic can be programmed to branch to a service routine when a device requests service. The example at the start of this section shows how to set up and enable an interrupt for the SRQ line. When a device sets the SRQ line, your service routine needs to perform the following steps: 1) find out which device is requesting service, 2) find out what action needs to be taken, 3) perform the needed action, and 4) re-enable the IEEE-488 interrupts.
 
Step 1 uses either the PPOLL command or the SPOLL command. With the SPOLL command you have to start with the first address and step through all the addresses, until you find the device requesting service. If you only have one or two devices on the IEEE-488 bus, then this method is quite fast and it eliminates step two.
 
Step 2 uses a serial poll (SPOLL) to read the device response byte and tells the device that it is being serviced. The device then removes the request by clearing the SRQ line.
 
Step 3 is dependent on the response byte value. Its interpretation is determined by the device documentation.
 
Step 4 re-enables the interrupts with the ENABLE INTR command. Interrupts are disabled by the Controller until the current request has been serviced. Once serviced, the interrupts need to be re-enabled.