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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: CAJ can't handle DBR_String |
From: | Hugo Slepicka <[email protected]> |
To: | "Winkler, Carsten" <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Wed, 21 Aug 2013 11:37:49 -0300 |
-- Hugo Henrique Slepicka Engenheiro de Computação SOL - Software de Operação das Linhas de Luz LNLS - Laboratório Nacional de Luz Síncrotron CNPEM - Centro Nacional de Pesquisa em Energia e Materiais 5913 - [email protected] www.lnls.br
Hi,my initial version used the connection listener to add monitor with native data type. But it didn't work.Carsten
"Kasemir, Kay" <[email protected]> schrieb:
Looks like you are asking for a DBRType.DOUBLE in the addMonitor, but the actual value (string) cannot be converted.
Ask for the 'native' value by adding a connection listener, then inside the connection listener do the addMonitor with the native data type.
-Kay
On Aug 21, 2013, at 5:44 AM, Carsten Winkler <[email protected]> wrote:
> Hi all,
>
> it seems CAJ can't handle DBR_String.
> If you request the value of a stringout or stringin EPICS variable you
> always get a NullPointerException.
> Also if you ask for the DESC field of any PV you'll get same error.
> If you dig deeper you see the DBRType of the created channel is
> UNKNOWN. Where comes this type come from? You find the problem in
> "com.cosylab.epics.caj.CAJChannel.connectionCompleted(int sid, short
> typeCode, int elementCount) ". This function gets the parameter
> "typeCode" and the value of this parameter is "UNKNOWN" instead of
> "STRING". But who sets the "typeCode"? The "typeCode" will be extracted
> from the CA response header (AbstractCAResponseHandler) and here ends my
> trace.
> Did I miss something? Please check my source code and tell me what to do
> to get strings.
>
> public class CAJBugTest {
> public static void main(String[] args) throws Exception {
> JCALibrary jca = JCALibrary.getInstance();
> Context ctxt = jca.createContext(JCALibrary.CHANNEL_ACCESS_JAVA);
> Channel ch = ctxt.createChannel("INFOCL:scale.DESC");
> ch.addMonitor(DBRType.DOUBLE, 1, Monitor.VALUE, new
> MonitorListener() {
> @Override
> public void monitorChanged(MonitorEvent ev) {
> System.out.println(ev.getDBR().getValue());
> }
> });
> ctxt.flushIO();
> Thread.sleep(5000);
> ch.destroy();
> ctxt.destroy();
> }
> }
>
> Cheers,
> Carsten
>
> ________________________________
>
> Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
>
> Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.
>
> Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
> Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking
>
> Sitz Berlin, AG Charlottenburg, 89 HRB 5583
>
> Postadresse:
> Hahn-Meitner-Platz 1
> D-14109 Berlin
>
> http://www.helmholtz-berlin.de
>
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.
Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking
Sitz Berlin, AG Charlottenburg, 89 HRB 5583
Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin
http://www.helmholtz-berlin.de