Hi Gary,
On 2013-02-28 Carr, Gary wrote:
> I have an application that needs to monitor changes in the NORD field of a
> waveform record. Since we are running Channel Access 3.14.11, I cannot get
> a monitor on the field, so I use a simple "get" to poll the field in Java.
> Basically:
>
> Channel ic = context.createChannel("pvname.NORD");
> context.pendIO(timeout);
> ...
> int val = ((INT) ic.get(DBRType.INT,1)).getValue();
> context.pendIO(timeout);
>
> Using jca context this works fine either reading thechannel directly, or
> through a CA gateway. If I use a caj context in the same code, it works
> fine reading the channel directly, but if I read through a CA gateway I
> never see the NORD field change when the waveform processes.
That's because the gateway sets up a monitor on the channel and uses that
value when you do a ca_get from it. It does that to try and reduce the load
on the IOCs if lots of scripts do ca_get operations on random channels.
There may be a flag you can give the gateway to prevent that behavior (but it
will increase the load on your IOCs), or you could patch the waveform record
in Base to make it post monitors on NORD — we've done that in the 3.15 branch,
and it's just a one-line change (line-numbers may vary):
=== modified file 'src/std/rec/waveformRecord.c'
--- src/std/rec/waveformRecord.c 2010-10-05 19:27:37 +0000
+++ src/std/rec/waveformRecord.c 2012-02-17 23:32:25 +0000
@@ -191,6 +191,7 @@
if (prec->nord > prec->nelm)
prec->nord = prec->nelm;
+ db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
return 0;
}
- Andrew
--
There is no such thing as a free lunch. When invited for lunch,
it is best to check if you are there to eat, or to be eaten.
-- Clive Robinson
- Replies:
- Re: Strange Interaction between CA gateway and CAJ Eric Norum
- References:
- Strange Interaction between CA gateway and CAJ Carr, Gary
- Navigate by Date:
- Prev:
Re: What I learned today... Andrew Johnson
- Next:
Re: Strange Interaction between CA gateway and CAJ Eric Norum
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Strange Interaction between CA gateway and CAJ Carr, Gary
- Next:
Re: Strange Interaction between CA gateway and CAJ Eric Norum
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|