Manuals >Reference >Drivers
Print version of this Book (PDF file)
prevnext

Handling Signals and Exceptions

A variety of conditions may result in termination of a measurement. Among the most common exceptions for a driver is an I/O timeout. Timeouts usually occur when one or more of the following conditions is present:

    • Instruments are turned off
    • Cabling is incorrect
    • The driver software makes errors with respect to instrument protocol or the time required by the instrument's operations

There are numerous examples in the hp4194 and cvu_4194 functions code that demonstrate setting the timeout before making different queries to the instrument. A timeout is usually detected as a value of -1, returned from the spoll, readstring, or writestring functions of the hpib_io_port used by the driver software.

In addition to instrument I/O problems, either of the following signals may be generated:

    • SIGFPE  This signal occurs when the code executes an operation like a divide by zero. By default, there is no provision in IC-CAP for trapping this signal.


Note


If this signal occurs during Measure, the default handling of SIGFPE terminates the measurement; if it occurs during the execution of a transform, the function or macro will continue to execute and upon completion, an error message is displayed indicating a floating point error occurred.


    • SIGINT  This signal is generated when you issue the Interrupt command. By default, there is no provision in IC-CAP for trapping this signal. The measurement is terminated immediately. Note: For complex operations, it may take several minutes before control is returned.

If your application requires special error recovery for these signals, it is possible to trap them. For details, refer to "Handling Signals and Exceptions" in the User's Guide.


Note


Do not alter the handling of SIGUSR1 and SIGUSR2; both signals are used internally by IC-CAP for error trap and recovery purposes.



prevnext