Files
sics/site_ansto/hardsup/usbtmc.h
Ferdi Franceschini d2f57e4615 SICS-294 anstohttp.c
Histmem now only calls TaskYield after SICS has finished initalising, this stops the statusfile task from being called early and overwriting the status file. Created ANSTO_MakeHistMemory command to install ANSTO_HistAction
Added veto functions.  Mapped the HistDriver interface Pause() and Continue() commands to AnstoHttpVeto and AnstoHttpNoVeto. Implemented an ANSTO_Histaction to call AnstoHttpPause when sent a "pause" subcommand.

hmcontrol_ansto.c
Call AnstoHttpPause() directly when Pause_HM_After_Count is set to preserver current behaviour.

counterdriv.c
Now sends the correct "SICS RESUME" command to resume a paused count.

ansto_sctdriveadapter.c NEW
This lets you create driveable objects from script-context controllers which have one node for setting a parameter and another node for reading the parameter (eg temperature controllers, choppers, velocity selectors)

sctemonadapter.c NEW
This generates an environment monitor interface for script-context controllers so that the emon object in SICS will be able to pause counters if the controller goes out of tolerance.

sct_usbtmcprot.c, usbtmc.h NEW
First attempt at a protocol handler for USB Test and Measurement Class devices

sct_julabo_lh45.tcl NEW
Implements script-context controller for the Julabo LH45 temperature controller.

Makefile
Added ansto_sctdriveadapter and sctemonadapter

hardsup/makefile
Added velocity selector and usbtmc protocol handlers

hardsup/sct_velselprot.c
Simplified, don't worry about trying to implement a login handler for now, just implement a "Reading" handler.

site_ansto.c
Add the velocity selector and USBTMC protocol handlers.
Added the ANSTO_MakeHM command

instrument/config/hipadaba/common_instrument_dictionary.tcl
Added support for auxiliary data, ie extra meta-data entries in the "data" group of the nexus file.
Add new NXvelocity_selector object under /instrument.

instrument/config/hipadaba/hipadaba_configuration_common.tcl
Add the new "sct_object" script-context controller objects to the hdb tree.

instrument/config/hipadaba/instdict_specification.tcl
Define the new sct_object controllers.

instrument/config/hmm/hmm_configuration_common_1.tcl
Use the new ANSTO_MakeHM command to create histmem drivers which support veto.
Define allowed attributes and elements for the BAT_TABLE and FAT_TABLE
Stop between counts instead of pausing because setting pause now sends a veto.

instrument/config/motors/sct_jogmotor_common.tcl
You now need to specify klass when creating a jogmotor.

instrument/config/motors/sct_positmotor_common.tcl
You can now specify an optional function which calculates the instrument parameter (eg attenuation) from a posit table entry when defining a posit motor.

instrument/config/nexus/nxscripts_common_1.tcl
Report file status info in the /experiment section of the hdb tree.  Add auxiliary data to data file.
Handle saving data from script-context controller objects.

instrument/util/script_context_util.tcl
Added procedure to set required properties  for saving script-context object data.

instrument/util/utility.tcl
Added set_sct_object_attributes proc to automatically set required attributes on SCT_OBJECTs
Fixed hlistplainprop to deal with empty property fields on hdb nodes.

instrument/server_config.tcl
Call the new nexus initialisation command and set attributes on sct objects.

hrpd/config/motors/motor_configuration.tcl
New absenc home readings for mchi and mphi. New absenc home and range for mf1

hipd/config/commands/commands.tcl
Exported and published the new ajscmds so that they can be used in batch files.

hipd/config/motors/motor_configuration.tcl
New mchi absenc home

rsd/config/hmm/hmm_configuration.tcl
Provide support for saving corrected hmm data

rsd/config/motors/motor_configuration.tcl
Use simple names for motors.

SICS-329

sans/config/INSTCFCOMMON.TXT
Added julabo and lakeshore configuration files to list.

sans/config/optics/guide_configuration.tcl
Added entrance aperture positions to the configuration table and the cn_maps which map the index to the component ID.

sans/commands/commands.tcl
The "guide" command now set EApPosYmm after driving the guides in place.
The indexed position to component maps (cn_map) have been moved to the guide_configuration.tcl file.

sans/motors/motor_configuration.tcl
Set samy home to 56.1mm

sans/config/velsel/sct_velsel.tc NEW
Implements script-context controller object for the NVS40 velocity selector. TODO tilt-angle control, driveable interface.

sans/config/hmm/hmm_configuration.tcl
Set 5.08mm spacing on detector width. Use pixel-offset for vertical and horizontal detector axes.

sans/config/motors/motor_configuration.tcl
Swap directions of beamstops 4 and 5 (the two smallest)
New config parameters for samx, samthet, apx, det, detoff, bsz,

sans/config/motors/positmotor_configuration.tcl
Added descriptive headers to positmotor configuration tables and new synstax for the make positmotor command.

sans/config/nexus/nxscripts.tcl
Implemented initialisation command.

sans/config/parameters/parameters.tcl
Added SampleThickness and TransmissionFlag.  Calculate SamplePosYmm from samy and SamyOffsetmm.
Added beamstops to hdb tree.

reflectometer/config/nexus/nxscripts.tcl
Implement the initialisation procedure.

r2767 | ffr | 2009-03-31 10:16:54 +1100 (Tue, 31 Mar 2009) | 123 lines
2012-11-15 16:57:04 +11:00

132 lines
5.2 KiB
C

// usbtmc.h
// This file is part of a Linux kernel module for USBTMC (USB Test and
// Measurement Class) devices
// Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
// See usbtmc.c source file for license details
#include <linux/ioctl.h> // For _IO macro
// Driver parameters that you might want to tune...
// Maximum number of USBTMC devices to be concurrently serviced by this module
#define USBTMC_MINOR_NUMBERS 16
// Size of driver internal IO buffer. Must be multiple of 4 and at least as
// large as wMaxPacketSize (which is usually 512 bytes).
#define USBTMC_SIZE_IOBUFFER 4096
// Default USB timeout (in jiffies)
#define USBTMC_DEFAULT_TIMEOUT 10*HZ
// Maximum number of read cycles to empty bulk in endpoint during CLEAR and
// ABORT_BULK_IN requests. Ends the loop if (for whatever reason) a short
// packet is never read.
#define USBTMC_MAX_READS_TO_CLEAR_BULK_IN 100
// Other definitions
// Request values for USBTMC driver's ioctl entry point
#define USBTMC_IOC_NR 91
#define USBTMC_IOCTL_GET_CAPABILITIES _IO(USBTMC_IOC_NR,0)
#define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR,1)
#define USBTMC_IOCTL_CLEAR _IO(USBTMC_IOC_NR,2)
#define USBTMC_IOCTL_ABORT_BULK_OUT _IO(USBTMC_IOC_NR,3)
#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR,4)
#define USBTMC_IOCTL_SET_ATTRIBUTE _IO(USBTMC_IOC_NR,5)
#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR,6)
#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR,7)
//#define USBTMC_IOCTL_TIMEOUT _IO(USBTMC_IOC_NR,8)
#define USBTMC_IOCTL_GET_ATTRIBUTE _IO(USBTMC_IOC_NR,9)
#define USBTMC_IOCTL_INSTRUMENT_DATA _IO(USBTMC_IOC_NR,10)
#define USBTMC_IOCTL_RESET_CONF _IO(USBTMC_IOC_NR,11)
// Request names for usbtmc_ioctl command line utility
#define USBTMC_IOCTL_NAME_GET_CAPABILITIES "getcaps"
#define USBTMC_IOCTL_NAME_INDICATOR_PULSE "indpulse"
#define USBTMC_IOCTL_NAME_CLEAR "clear"
#define USBTMC_IOCTL_NAME_ABORT_BULK_OUT "abortout"
#define USBTMC_IOCTL_NAME_ABORT_BULK_IN "abortin"
#define USBTMC_IOCTL_NAME_SET_ATTRIBUTE "setattr"
#define USBTMC_IOCTL_NAME_CLEAR_OUT_HALT "clearouthalt"
#define USBTMC_IOCTL_NAME_CLEAR_IN_HALT "clearinhalt"
#define USBTMC_IOCTL_NAME_GET_ATTRIBUTE "getattr"
#define USBTMC_IOCTL_NAME_RESET_CONF "reset"
// This structure is used with USBTMC_IOCTL_GET_CAPABILITIES.
// See section 4.2.1.8 of the USBTMC specification for details.
struct usbtmc_dev_capabilities {
char interface_capabilities;
char device_capabilities;
char usb488_interface_capabilities;
char usb488_device_capabilities;
};
// This structure is used with USBTMC_IOCTL_SET_ATTRIBUTE and
// USBTMC_IOCTL_GET_ATTRIBUTE.
struct usbtmc_attribute {
int attribute;
int value;
};
// Defines for attributes and their values
#define USBTMC_ATTRIB_AUTO_ABORT_ON_ERROR 0
#define USBTMC_ATTRIB_NAME_AUTO_ABORT_ON_ERROR "autoabort"
#define USBTMC_ATTRIB_READ_MODE 1
#define USBTMC_ATTRIB_NAME_READ_MODE "readmode"
#define USBTMC_ATTRIB_TIMEOUT 2
#define USBTMC_ATTRIB_NAME_TIMEOUT "timeout"
#define USBTMC_ATTRIB_NUM_INSTRUMENTS 3
#define USBTMC_ATTRIB_NAME_NUM_INSTRUMENTS "numinst"
#define USBTMC_ATTRIB_MINOR_NUMBERS 4
#define USBTMC_ATTRIB_NAME_MINOR_NUMBERS "numminor"
#define USBTMC_ATTRIB_SIZE_IO_BUFFER 5
#define USBTMC_ATTRIB_NAME_SIZE_IO_BUFFER "buffsize"
#define USBTMC_ATTRIB_DEFAULT_TIMEOUT 6
#define USBTMC_ATTRIB_NAME_DEFAULT_TIMEOUT "deftimeout"
#define USBTMC_ATTRIB_DEBUG_MODE 7
#define USBTMC_ATTRIB_NAME_DEBUG_MODE "debug"
#define USBTMC_ATTRIB_VERSION 8
#define USBTMC_ATTRIB_NAME_VERSION "version"
#define USBTMC_ATTRIB_TERM_CHAR_ENABLED 9
#define USBTMC_ATTRIB_NAME_TERM_CHAR_ENABLED "termcharenab"
#define USBTMC_ATTRIB_TERM_CHAR 10
#define USBTMC_ATTRIB_NAME_TERM_CHAR "termchar"
#define USBTMC_ATTRIB_ADD_NL_ON_READ 11
#define USBTMC_ATTRIB_NAME_ADD_NL_ON_READ "addnlread"
#define USBTMC_ATTRIB_REM_NL_ON_WRITE 12
#define USBTMC_ATTRIB_NAME_REM_NL_ON_WRITE "remnlwrite"
#define USBTMC_ATTRIB_VAL_OFF 0
#define USBTMC_ATTRIB_NAME_VAL_OFF "off"
#define USBTMC_ATTRIB_VAL_ON 1
#define USBTMC_ATTRIB_NAME_VAL_ON "on"
#define USBTMC_ATTRIB_VAL_FREAD 0
#define USBTMC_ATTRIB_NAME_VAL_FREAD "fread"
#define USBTMC_ATTRIB_VAL_READ 1
#define USBTMC_ATTRIB_NAME_VAL_READ "read"
// This structure is used with USBTMC_IOCTL_INSTRUMENT_DATA.
struct usbtmc_instrument {
int minor_number;
char manufacturer[200];
char product[200];
char serial_number[200];
};
// USBTMC status values
#define USBTMC_STATUS_SUCCESS 0x01
#define USBTMC_STATUS_PENDING 0x02
#define USBTMC_STATUS_FAILED 0x80
#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS 0x81
#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS 0x82
#define USBTMC_STATUS_SPLIT_IN_PROGRESS 0x83
// USBTMC requests values
#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT 1
#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS 2
#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN 3
#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS 4
#define USBTMC_REQUEST_INITIATE_CLEAR 5
#define USBTMC_REQUEST_CHECK_CLEAR_STATUS 6
#define USBTMC_REQUEST_GET_CAPABILITIES 7
#define USBTMC_REQUEST_INDICATOR_PULSE 64