esrf

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

#%TITLE% icv716.mac
#%NAME%
#   Macros to work with the Vme board icv716 (Unipolar 16 bits DAC) via 
#   the Bit3 bus controller.
#%CATEGORY% Generic I/O
#
#%DESCRIPTION%
#%SETUP%
#
#%LOG%
#$Revision: 1.1 $
#$Log: icv716.mac,v $
#Revision 1.1  2008/07/17 14:32:48  rey
#Initial revision
#
#%END%

#%UU% <device_name>
#%MDESC% 
#
def icv716_setup '{
  global I716DEV
  if($# == 1) {
    I716DEV="$1"
  } else	{
    I716DEV= getval("\nICV716 device name", I716DEV)
  }
}'

#%UU%
#%MDESC% channel: [0 - 7] ; value in Volts [0 - 10]
#
def icv716_write(channel,value) '{
  global I716DEV
  local chanoffset, valhexa
  chanoffset = sprintf("%X",channel*2)
  valhexa = (6553.5 * value) + 0.5
  vmeds_put(I716DEV,chanoffset,valhexa,"D16")
}'

#%MACROS%
#%IMACROS%
#%TOC%
#%AUTHOR% G. Pepellin