EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Stream device question
From: "Luchini, Kristi L." <[email protected]>
To: Michael Davidsaver <[email protected]>
Cc: "'[email protected]'" <[email protected]>
Date: Tue, 7 Mar 2017 02:22:19 +0000
Hi Michael,

How can  get a copy of this? 

- Kristi

-----Original Message-----
From: Michael Davidsaver [mailto:[email protected]] 
Sent: Monday, March 06, 2017 6:11 PM
To: Luchini, Kristi L.
Cc: '[email protected]'
Subject: Re: Stream device question

On 03/06/2017 05:09 PM, Luchini, Kristi L. wrote:
> Hello,
> 
> I have an hpi 6032 Digital Area Monitor, which only provides 1-way 
> communication. The device sends out a packet of ata Every second that should look like this:
> 
>                       000001 0064 0000 0032 00 00 The data from left 
> to right is read as 6-groups of hex digits.

Not exactly an answer to your question, but this appears to be the same format as the hpi 6016 counter in use at NSLS2.  Note that HPI uses different part numbers for the counter electronics and the chamber.  I think 6032 is a chamber.

https://github.com/mdavidsaver/hpi6016/blob/master/hpi6016App/src/hpidrv.c#L269

For several reasons, I wanted tight control of timeouts and other failure modes.  After two iterations with stream+asyn I resorted to sockets (via libevent).

There's also a simulator for testing.


> The profile looks as follows:
> 
> Terminator  = CR LF;
> RReadTimeout = 200;
> ReplyTimeout = 800;
> PollPeriod = 800;
> 
> read {
>   in                                                                   # only 1-way communication
>   "%(A)x"                                                       # gamma dose rate
>   "%(\$1GammaTripLevel.A)x"            # high trip level
>   "%(\$1GammaTripLowLevel.A)x"    # low trip level
>   "%(\$1GammaFailCounter.A)x"        # fail count down
>   "%(\$1GammaDoseStatus.A)x"         # status byte
>   "%(\$1GammaHVStatus.A)x";           # second status byte
> }
> The first data (left most hex digit) I can read, the others pvs' don't 
> process.  I copied a profile from elsewhere that used this device, and 
> the read was setup the same With the exception only the 1st 3rd and 6th data elements were read (from left to right), so a "%*x" was used to skip those data points.  However, the file was for a different model And still only the 1st data point was processed in the db. I have been able to read the 1st and 2nd data points, but the rest won't follow, so I must be doing something wrong in the db or the profile.
> 
> I  know the device is working because if I connect up a serial port to my laptop and view the data, it looks fine.    Are there any suggestions as I am fairly new to using stream device.
> 
> Regards,
>   Kristi
> 
> record(calcout, "$(BL)GammaAct"){ 
>   field(DESC, "gamma dose rate")
>   field(DTYP, "stream")
> # SDIS is for alarm propogation only
>   field(SDIS, "$(BL)GammaCommLink CP MS")
>   field(OUT,  "@gamma.proto read($(BL)) $(PORT)")
>   field(SCAN, "I/O Intr")
> # .A-.F is filled in by gamma.proto
>   field(CALC, "A<8388608 ? 0.01*A : 0.01*(8388608-A)")
>   field(EGU,  "mR/hr")
>   field(PREC, "2")
>   field(FLNK, "$(BL)GammaActSec")
> }
> record(calcout, "$(BL)GammaTripLevel"){ 
>   field(DESC, "high trip level")
> # SDIS is for alarm propogation only
>   field(SDIS, "$(BL)GammaCommLink CP MS") # .A is filled in by 
> gamma.proto
>   field(CALC, "0.01*A")
>   field(EGU,  "mR/hr")
>   field(HIGH, "10.0")
>   field(HSV,  "MAJOR")
>   field(PREC, "2")
> }
> record(calcout, "$(BL)GammaTripLowLevel"){ 
>   field(DESC, "low trip level ")
>   field(OUT,  "@gamma.proto readTripLL($(BL)) $(PORT)") # SDIS is for 
> alarm propogation only
>   field(SDIS, "$(BL)GammaCommLink CP MS")
>   field(CALC, "(0.01*A)-B")
> # .A is filled in by gamma.proto
>   field(INPB, "$(BL)GammaOffset") 
>   field(EGU,  "mR/hr")
> }
> record(calcout,"$(BL)GammaFailCounter") {
>   field(DESC, "Fail Counter")
> # SDIS is for alarm propogation only
>   field(SDIS, "$(BL)GammaCommLink CP MS") # .A is filled in by 
> gamma.proto
>   field(CALC, "A")
>   field(EGU,  "sec")
> }
> record(calcout, "$(BL)GammaDoseStatus"){ 
>   field(DESC, "gamma dose fail status") # SDIS is for alarm 
> propogation only
>   field(SDIS, "$(BL)GammaCommLink CP MS") # .A is filled in by 
> gamma.proto
>   field(CALC, "A&2?1:0")
>   field(HIHI, "0.5")
>   field(HHSV, "MAJOR")
>   field(FLNK, "$(BL)GammaTripCalc")
> }
> record(calcout, "$(BL)GammaHVStatus"){
>   field(DESC, "gamma HV fail status")
> # SDIS is for alarm propogation only
>   field(SDIS, "$(BL)GammaCheckIO CP MS") # .A is filled in by 
> gamma.proto
>   field(CALC, "A&1?1:0")
>   field(FLNK,  "$(BL)GammaGammaAlarmSeverity") }
> 
> I've also tried setting each record with SCAN Intr I/O and the  OUT field the command in the profile and only the readRate works, which is the first hex ditgit, the others pvs never process.
> readRate     { in "%(A)x %*x %*x %*x %*x %*x"; }
> readTrip     { in "%*x %(A)x %*x %*x %*x %*x"; }
> readTripLL   { in "%*x %*x %(A)x %*x %*x %*x"; }
> readFailCnt  { in "%*x %*x %*x %(A)x %*x %*x"; }
> readStat     { in "%*x %*x %*x %*x %(A)x %*x;" }
> readHVStat   { in "%*x %*x %*x %*x %*x %(A)x;" }
> 
> debug {
>   ExtraInput = Ignore;
>   in "%39c";
> }
> 



References:
Stream device question Luchini, Kristi L.
Re: Stream device question Michael Davidsaver

Navigate by Date:
Prev: Re: Stream device question Michael Davidsaver
Next: Re: Question related to PV record Vandana Yadav
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Stream device question Michael Davidsaver
Next: EPICS make problem Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024