Manuals >Reference >Drivers Print version of this Book (PDF file) |
![]() ![]() |
|||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
Matrix DriversA matrix driver is a set of USERC functions designed to control the switching matrices through an HP 4084 controller from an IC-CAP Macro program. The matrix driver supports the matrices listed in the following table. External user functions and internal design functions are described in this section. They are designed to be compatible with HP 4062UX TIS where possible. Source files for this matrix driver are iceswm.h and iceswm.c. The header file iceswm.h is included in userc.c so that the function names can appear in the Function List of IC-CAP. Source code is provided with this open interface.
External Matrix Driver User FunctionsThis section describes the matrix driver external user functions. SWM_debug This function takes 1 argument and sets the internal debug flag. When the argument is 1, debugging information is printed out to the Status window; when the argument is 0, printing is turned off. It always returns 0. This function does not exist in TIS. An example call is: x = SWM_debug(1) Every function looks at this flag and prints out any GPIB commands it is going to send, or a string it just received from a matrix controller. SWM_init This function takes 2 GPIB addresses, a matrix name, and a raw GPIB interface name to which the matrix is connected. The first GPIB address is for the block 1 (usually 19) and the second is for the block 2 (22). However, a different address can be assigned for each matrix controller. For the HP 4085A and HP 4085B (both 48-pin systems), the second address is used as the controller address, and the first address is ignored. It returns 0 when successful and -1 when it fails. This function does not exist in TIS. An example call is: x = SWM_init (19, 22, "HP4089A", "hpib"); ! for 96-pin x = SWM_init (0, 22, "HP4085B", "hpib"); ! for 48-pin This function checks the matrix type and sets the internal type flag for subsequent matrix calls. It closes its private entity id from a previous matrix access (when it exists), and opens the given raw GPIB device file. Then it calls an internal function swm_init_unit to reset a controller. This clears all pins and ports. Connect This function takes a port address and a pin number and connects the given port to the pin. The port address is either 0 or from 32701 to 32711, inclusive. The pin number is 0 or from 1 to 48/96 inclusive. When a pin card does not exist for the given pin number, it gives an error message and aborts the Macro execution. x = Connect(32701, 25); This function sends GPIB commands to the matrix controller and either connects or disconnects the specified port and pin. The following table lists argument combinations.
As in TIS, multiple pins can be connected to 1 port by calling this function several times. Pin numbers 1 through 48 belong to block 1; pin numbers 49 through 96 belong to block 2. When a 96-pin matrix is used, do not connect block 1 and block 2 pins to 1 single port. Because this function does not include switching delay, allow enough wait time before and after measurement to prevent relay damage. Virtual Front Panel (VFP) is not supported. FNPort This function takes a port number and returns a port address for Connect. This allows compatibility with the HP 4062UX. An example call is: port = FNPort(1); Wait This function takes a wait time, in seconds, to give a necessary delay to wait until SMU outputs become zero for dry switching. This function does not exist in TIS. It returns 0 when successful or -1 when it fails. An example call is: x = Wait (0.1) ! 100ms delay; Internal Matrix Driver FunctionsThe internal functions described next support the user functions. Refer to the source file for each algorithm. swm_connect_pin This function takes a GPIB address of a controller, a port number, and a pin number. It sends a Pin Connect command to the controller, and is called from swm_connect (Connect) to actually perform the pin connection and disconnection. swm_connect_port This function takes a GPIB address and a port number to send a Port Connect command to the controller, which manages input relays of an HP 4089A matrix. swm_cut_port_pin This function takes a GPIB address and a pin number to cut the pin connection when a 96-pin matrix is used. It also checks if the port to which the pin was connected can be turned off; if it can (both Force and Guard are off), it turns off this port.
swm_init_unit This function takes a file designator (or eid, a small integer usually obtained by calling the open system function) and a GPIB address of a matrix controller. It is called from swm_init to initialize a controller and clear all pins and ports for which the controller is responsible. swm_parse_err This function takes a status byte sent from a matrix controller and determines the cause of an SRQ. If there is no error, it returns 0 to allow the caller to keep running. If there is an error, it returns -1 to abort the execution of the caller. swm_release_port This function takes a GPIB address and a port number to send a Port Disconnect command to the controller only when a 96-pin matrix is used. Because block 1 and block 2 pins should not be connected to a single port, a disconnect request such as Connect(32701, 0) not only cuts the connection between a port and a pin, but also disconnects the input relays of the port. |
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
![]() ![]() |