Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: [StreamDevice] ?
From: Pavel Masloff <pavel.masloff@gmail.com>
To: Rod Nussbaumer <bomr@triumf.ca>, EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Tue, 5 Jun 2012 11:04:30 +0400
WORKS!

On Mon, Jun 4, 2012 at 7:32 PM, Pavel Masloff <pavel.masloff@gmail.com> wrote:
Oh, thanks Rod!
I knew I had to try this, the only confusion was how to get the macro into the protocol file :)
Thanks.

~Pavel


On Mon, Jun 4, 2012 at 7:23 PM, Rod Nussbaumer <bomr@triumf.ca> wrote:
If I understand your question correctly, I think it may be solved by using one StreamDevice protocol to do multiple set and query commands. In your case, setting the probe attenuation record has the side effect of altering the vertical sensitivity of the respective scope channel. You can use one protocol to write multiple commands, and to process the results into multiple records. See the StreamDevice docs for 'redirection',
<http://epics.web.psi.ch/software/streamdevice/doc/formats.html#redirection>

Using this method, you can set the attenuation on the scope, and at the same time update the scale record in you database to keep everything in sync.


setY {
   ReplyTimeout = 5000;
    out 'CH\$1:SCA %g';
   #in "CH\$1:SCA?";
   @init {
       out "CH\$1:SCA?";
       in ":CH\$1:SCALE %g";
   }
}

probe {
   ReplyTimeout = 5000;
   out 'CH\$1:PRO %g';
   out 'CH\$1:SCALE?";
   in  '%(\$2)g';

   @init {
       out 'CH\$1:PRO?';
       in ':CH\$1:PROBE %g';
   }
}

#
# New argument to the 'probe' protocol is name of accordant
# scope vertical scale record.

#
record(ao, "$(P)$(R)probe_ch1") {
 field(DESC, "Probe voltage attenuation 1")
 field(DTYP, "stream")
 field(OUT, "@devTPS20xx.proto probe(1,$(P)$(R)setY1) $(PORT) $(A)")
}


  ---   rod.




Pavel Masloff wrote:
Hi Rod,


You mentioned you are using StreamDevice to talk to your Tek scopes. I
am having difficulties with the Probe Attenuator setting. So you
basically change it say from 1 to 10, and the scope automatically
changes the voltage on a channel from say 1V to 10V/DIV.
I don't want StreamDevice to poll the scope once a second (or even worse
I/O interrupt) to get this change (wanna leave it Passive), so I can
change my Attenuator PV (Passive record) it then forwards the
CHx_Voltage to ask the scope the current Y-axis resolution.
The problem is that the AO record can be either closed-loop (via db
links) or open-loop (via CA).
I don't know what to do.

In other words:
On the screenshot is my HMI
(http://imageshack.us/photo/my-images/337/scope.jpg/). So when I change
the Attenuator_1 setting (probe_ch1) from 1 to 10, my CH_1 voltage
(setY1) remains the same = 0,2 V, when in fact on the scope it is 2 V.
Is there a way my setY1 could update its value, but not process?

record(ao, "$(P)$(R)setY1")
{
    field(DESC, "Set VOLTS/DIV channel 1")
    field(DTYP, "stream")
    field(OUT, "@devTPS20xx.proto setY(1) $(PORT) $(A)")
    field(EGU, "V")
}

record(ao, "$(P)$(R)probe_ch1") {
  field(DESC, "Probe voltage attenuation 1")
  field(DTYP, "stream")
  field(OUT, "@devTPS20xx.proto probe(1) $(PORT) $(A)")
}


setY {
    ReplyTimeout = 5000;
     out 'CH\$1:SCA %g';
    #in "CH\$1:SCA?";
    @init {
            out "CH\$1:SCA?";
        in ":CH\$1:SCALE %g";
    }
}

probe {
    ReplyTimeout = 5000;
    out 'CH\$1:PRO %g';
    @init {
            out 'CH\$1:PRO?';
        in ':CH\$1:PROBE %g';
    }
}


#getY {
#    out 'CH\$1:SCA?';
#    in "%g";
#}

Hope everything is understandable.

--
Best regards,


Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia

Mobile: +7 (951) 672 22 19
Landline: +7 (812) 461 01 01




--
Best regards,


Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia

Mobile: +7 (951) 672 22 19
Landline: +7 (812) 461 01 01




--
Best regards,


Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia

Mobile: +7 (951) 672 22 19
Landline: +7 (812) 461 01 01


References:
[StreamDevice] ? Pavel Masloff
Re: [StreamDevice] ? Pavel Masloff

Navigate by Date:
Prev: counter of clients for specific PV in IOC Yingbing Yan
Next: ASYN 4-19 createParam return status Hinko Kocevar
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: [StreamDevice] ? Pavel Masloff
Next: Quiz for C experts Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·