esrf

Beamline Instrument Software Support
SPEC Macro documentation: [ Macro Index | BCU Home ]

lockin.mac
See other macros in category: Other hardware
Description:
    Stanford Research SR830 Lockin-Amplifier
Documentation:
    DESCRIPTION
    These macros allow you to read out the Stanford Research SR830 Lockin-Amplifier via GPIB interface and to define its two channels as "software counters".

    SETUP
    Configure SPEC for GPIB: Make sure that the GPIB-ENET software is correctly installed. Run the diagnostics program "/usr/bin/ibtsta".
    In "config", press "c" to go to the "Interface Configuration" menu. Under GPIB enter "y" for YES. Under TYPE press "+" and choose "Nat Inst GPIB-ENET (shared)" for the menu. DEVICE should be "gpib0". After saving with "w" and exiting with "Control-C" you shoud se the message "Using National Instruments GPIB."
    Define a new counter in "config". Type "c" until you to get to the "Scaler (Counter) Configuration" menu. Increment "Number of counters" by 1 and rename "counter n" by "adc1". "Device" should be NONE, "Unit" and "Chan" 0, "Ase As" should be "counter" and "Scale factor" 1.
    After exiting the "config" editor type "setup" and include into your setup file a line like the following:
      lockin_define gpib=8 channel=1 adc1
    
    The factory preset GPIB address is 8. You can chage it via the SETUP button on the front panel.

    INTERNALS
    The following GPIB command is used:
    OUTR?i
    Read the value of the CH1 or CH2 display. The parameter i selects the display (i=1 or 2). Values are returned as ASCII floating point numbers with units of the display.



Macros:
    lockin_define
    Usage: lockin_define gpib=n channel=1|2 counter
    associates a SPEC counter mnemonic to one of the channels channels A or B of the ADC module.
    Use this macro in your "setup" file.

    lockin_info
    Usage: lockin_info
    print status info

    lockin_undefine
    Usage: lockin_undefine
    undo "lockin_define"

    lockin_off
    Usage: lockin_off
    disable all Lock-in amplifier software counters

    lockin_on
    Usage: lockin_on
    undo "lockin_off" - re-enable all Lock-in amplifier software counters

Internal Macros:
    lockin_check
    Usage: lockin_check counter
    Hook macro for "reconfig"
    checks whether device is accessible on the GPIB bus and clears the error status, if necessary.

    lockin_read
    Usage: lockin_read counter
    hook macro for "user_getcounts" , called implicitly when you use "ct", "count" or a scan macro. Reads the lock-in amplifier output via GPIB.
    The result is stored in the global array S in S[counter].

    lockin_voltage
    Usage: lockin_voltage (gpib_address,channel)
    Reads the lock-in amplifier output via GPIB and returns the result. Channel can be "A" or "B". Which parameter is read (X,Y,R,theta) is detemined by the front panel settings. The result can be a voltage in units of V, a current in units of A or a phase in deg. If an error occurrs NaN (not a number) is returned.

    NaN
    Usage: NaN %MDESC% "Not a Number" - placeholder for invalid numeric value


    isNaN
    Usage: isNaN (x)
    check whether x is an ivalid numeric value, "Not a Number"

Filename: lockin.mac
Author: Friedrich Schotte, 29 Mar 2000
Last mod.: 17/07/2008 17:08 by rey