Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: Re: Oxford/Danfysik power supply
From: Dirk Zimoch <dirk.zimoch@psi.ch>
To: Gournay Jean-Francois <Gournay@dapnia.cea.fr>
Cc: "'tech-talk@aps.anl.gov'" <tech-talk@aps.anl.gov>
Date: Wed, 19 Jan 2005 09:37:24 +0100
Hi,

I have developped the Stream Device driver to talk to a lot of serial/GPIB/... devices. I also have a protocol file for the Danfysik 8000 PS. You probably need a driver interface for your serial board to Stream Device (Stream Device itself is hardware independent). Pete Owens from Diamond has written one. Look at www.delta.uni-dortmund.de/controls. Pete's tty driver is in the download area under unsupported.

I have attached the protocol file and the template I used at DELTA. Try this as a starting point.

Dirk.


Gournay Jean-Francois wrote:
Hello all,

I have to talk to the magnet power supply system 8000 from O.D.
Not surprisingly the controller has a clumsy protocol over a serial line.
After spending some time to fight with it, I am wondering if somebody has already developed something for it ?


If no, perhaps somebody can make some suggestions ...
1. Some commands give responses, some other not ... but drvAscii / drvSerial seems OK to accomodate this. What is not so nice is that I have a semTake error due to the timeout (the PS is connect to a vxWorks serial port and I am with R3.13) when I have no response from the PS which means no error !!! But OK I can live with this.


2. The most difficult problem I have is the following : I have to write DAC values with a string which looks like : <WA 999999> (999999 is an integer value with 6 digits). This command gives a response in a string.

I tried to implement this with an ao record with a flnk to a sub record and finally with a stringin record which talks to the PS. The idea is to modify the INP field of the stringin record in psDACProcess, to reflect the desired DAC value.

The DB looks like this :

record(ao, "PS_DAC_OUT_ao") {
        field(FLNK,"PS_DAC_sb")
}
record(sub,"PS_DAC_sb") {
        field(INAM,"psDACInit")
        field(SNAM,"psDACProcess")
}

record(stringin, "PS_DAC_OUT_si") {
field(DESC,"PS DAC output I")
field(DTYP,"Ascii SIO")
field(INP,"@/tyCo/2 <WA 999999><%s>") }


The sub record works and I am able to reflect the desired value coming from the ao record in the INP field of the stringin record.

The problem is that the INP field of the stringin record is stored by devAscii at the init of the record and any subsequent changes are ignored when the record is processed.

Thans for any help.
Jean-François

J.F. Gournay
CEA Saclay
DAPNIA/SIS

tel +33 (0)1 69 08 70 32
fax +33 (0)1 69 08 63 01


-- Dr. Dirk Zimoch Swiss Light Source Paul Scherrer Institut Computing and Controls phone +41 56 310 5182 fax +41 56 310 4413
# Danfysik Netzgeraet fuer Solenoiden

outTerminator = CR;
inTerminator = LF CR;
ReplyTimeout=2000;
ReadTimeout=500;

command { out "%s"; }
info    { out "%s"; in "%39c"; }
reset   { out "RS"; }

current     { out "AD 8"; in "%d"; } # 1E-3 A
current.set { out "WA %05d"; }       # 1E-3 A
current.rb  { out "RA"; in "%d"; }    # 1E-4 A

ExtraInput = ignore;

switch      { out "S1"; in "%{!|.}"; }
switch.set  { out "%{F|N}"; }

interlock.sum         { in "%*9c%{.|!}"; }
interlock.overcurrent { in "%*10c%{.|!}"; }
interlock.overload    { in "%*11c%{.|!}"; }
interlock.regmodule   { in "%*12c%{.|!}"; }
interlock.preregul    { in "%*13c%{.|!}"; }
interlock.phase       { in "%*14c%{.|!}"; }
interlock.mpswater    { in "%*15c%{.|!}"; }
interlock.earth       { in "%*16c%{.|!}"; }
interlock.fuse        { in "%*17c%{.|!}"; }
interlock.mpstemp     { in "%*18c%{.|!}"; }
interlock.panicbutton { in "%*19c%{.|!}"; }
interlock.magnetwater { in "%*20c%{.|!}"; }
interlock.magnettemp  { in "%*21c%{.|!}"; }
interlock.mpsready    { in "%*22c%{!|.}"; }



# Macros: NAME BUS DESC SCAN_PERIOD

record (ai, "$(NAME)-i") 
{
    field (DESC, "$(DESC) current")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 current $(BUS)")
    field (SCAN, "$(SCAN_PERIOD)")
    field (LINR, "LINEAR")
    field (EGU,  "A")
    field (LOPR, "0")
    field (HOPR, "99.999")
    field (PREC, "3")
    field (EGUF, "100")
    field (EGUL, "0")
    field (ESLO, "1e-3")
    field (FLNK, "$(NAME)-i:comp")
    field (PRIO, "HIGH")
}

record (ao, "$(NAME)-i:set") 
{
    field (DESC, "$(DESC) current")
    field (DTYP, "stream")
    field (OUT,  "@Danfysik-8000 current.set $(BUS)")
    field (LINR, "LINEAR")
    field (EGU,  "A")
    field (LOPR, "0")
    field (HOPR, "99.999")
    field (PREC, "3")
    field (DRVL, "0")
    field (DRVH, "99.999")
    field (EGUF, "100")
    field (EGUL, "0")
    field (ESLO, "1e-3")
}

record (ai, "$(NAME)-i:rb") 
{
    field (DESC, "$(DESC) current")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 current.rb $(BUS)")
    field (SCAN, "$(SCAN_PERIOD)")
    field (LINR, "LINEAR")
    field (EGU,  "A")
    field (LOPR, "0")
    field (HOPR, "99.999")
    field (PREC, "3")
    field (EGUF, "100")
    field (EGUL, "0")
    field (ESLO, "1e-4")
    field (PRIO, "HIGH")
}

record (bo, "$(NAME):reset") {
    field (DESC, "$(DESC) reset")
    field (DTYP, "stream")
    field (OUT,  "@Danfysik-8000 reset $(BUS)")
    field (SEVR, "NO_ALARM")
}

record (bo, "$(NAME)-sw:set") {
    field (DESC, "$(DESC) switch")
    field (DTYP, "stream")
    field (OUT,  "@Danfysik-8000 switch.set $(BUS)")
    field (ZNAM, "OFF")
    field (ONAM, "ON")
}

record (bi, "$(NAME)-sw")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "$(SCAN_PERIOD)")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 switch $(BUS)")
    field (ZNAM, "OFF")
    field (ONAM, "ON")
    field (PRIO, "HIGH")
}

record (bi, "$(NAME)-ilock")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "I/O Intr")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 interlock.sum $(BUS)")
    field (ZNAM, "OK")
    field (ONAM, "ERROR")
    field (PRIO, "HIGH")
}

record (bi, "$(NAME)-ilock-water")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "I/O Intr")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 interlock.magnetwater $(BUS)")
    field (ZNAM, "OK")
    field (ONAM, "ERROR")
    field (PRIO, "HIGH")
}

record (bi, "$(NAME)-ilock-fuse")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "I/O Intr")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 interlock.fuse $(BUS)")
    field (ZNAM, "OK")
    field (ONAM, "ERROR")
    field (PRIO, "HIGH")
}

record (bi, "$(NAME)-ilock-earth")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "I/O Intr")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 interlock.earth $(BUS)")
    field (ZNAM, "OK")
    field (ONAM, "ERROR")
    field (PRIO, "HIGH")
}

record (bi, "$(NAME)-ilock-overload")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "I/O Intr")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 interlock.overload $(BUS)")
    field (ZNAM, "OK")
    field (ONAM, "ERROR")
    field (PRIO, "HIGH")
}

record (bi, "$(NAME)-ilock-temp")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "I/O Intr")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 interlock.magnettemp $(BUS)")
    field (ZNAM, "OK")
    field (ONAM, "ERROR")
    field (PRIO, "HIGH")
}

record (bi, "$(NAME)-ilock-ready")
{
    field (DESC, "$(DESC) switch")
    field (SCAN, "I/O Intr")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 interlock.mpsready $(BUS)")
    field (ZNAM, "NO")
    field (ONAM, "YES")
    field (PRIO, "HIGH")
}

# status records

record (ao, "$(NAME)-i:setup") {
    field (EGU, "A")
}


record (calc, "$(NAME)-setup:comp")
{
    field (DESC, "compare value and setup")
    field (INPA, "$(NAME)-i")
    field (INPB, "$(NAME)-i:setup")
# Max. allowed absolute and relative setup<->read difference
    field (INPC, "0.2")
    field (INPD, "0.01")
    field (CALC, "ABS(A-B)<C || ABS(A-B)/(ABS(A)+0.001)<D")
    field (LOW,  "0" )
    field (LSV,  "MAJOR")
}

record (calc, "$(NAME)-i:comp")
{
    field (DESC, "$(DESC) compare")
    field (INPA, "$(NAME)-i")
    field (INPB, "$(NAME)-i:set")
# Max. allowed absolute and relative set<->read difference
    field (INPC, "0.2")
    field (INPD, "0.01")
    field (CALC, "ABS(A-B)<C || ABS(A-B)/(ABS(A)+0.001)<D")
    field (LOW,  "0" )
    field (LSV,  "MAJOR")
}

#initialization

record (ai, "$(NAME)-i:init") 
{
    field (DESC, "$(DESC) current")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 current.rb $(BUS)")
    field (PINI, "YES")
    field (LINR, "LINEAR")
    field (EGU,  "A")
    field (LOPR, "0")
    field (HOPR, "99.999")
    field (PREC, "3")
    field (EGUF, "100")
    field (EGUL, "0")
    field (ESLO, "1e-4")
    field (PRIO, "HIGH")
    field (FLNK, "$(NAME)-i:copy")
}

record (ao, "$(NAME)-i:copy")
{
    field (DESC, "$(DESC) current")
    field (DOL,  "$(NAME)-i:init MS")
    field (OUT,  "$(NAME)-i:set PP") 
    field (OMSL, "closed_loop")
    field (IVOA, "Don't drive outputs")
    field (EGU,  "A")
    field (HOPR, "99.999")
    field (PREC, "3")
    field (FLNK, "$(NAME)-sw:init")
}

record (bi, "$(NAME)-sw:init")
{
    field (DESC, "$(DESC) switch")
    field (DTYP, "stream")
    field (INP,  "@Danfysik-8000 switch $(BUS)")
    field (ZNAM, "OFF")
    field (ONAM, "ON")
    field (PRIO, "HIGH")
    field (FLNK, "$(NAME)-sw:copy")
}

record (bo, "$(NAME)-sw:copy")
{
    field (DESC, "$(DESC) switch")
    field (DOL,  "$(NAME)-sw:init MS")
    field (OUT,  "$(NAME)-sw:set PP")
    field (OMSL, "closed_loop")
    field (IVOA, "Don't drive outputs")
    field (ZNAM, "OFF")
    field (ONAM, "ON")
}

# debug records

record (stringout, "$(NAME):command") {
    field (DESC, "- $(DESC) debug -")
    field (DTYP, "stream")
    field (OUT,  "@Danfysik-8000 command $(BUS)")
}

record (stringout, "$(NAME):info") {
    field (DESC, "- $(DESC) debug -")
    field (DTYP, "stream")
    field (OUT,  "@Danfysik-8000 info $(BUS)")
}


References:
Oxford/Danfysik power supply Gournay Jean-Francois

Navigate by Date:
Prev: RE: CA Connect rates under RTEMS (vxWorks, too) Jeff Hill
Next: RE: Oxford/Danfysik power supply Owens, PH (Peter)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: Oxford/Danfysik power supply Gournay Jean-Francois
Next: RE: Oxford/Danfysik power supply Owens, PH (Peter)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·