EPICS Controls 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  2012  <20132014  2015  2016  2017  2018  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: CAJ can't handle DBR_String
From: Carsten Winkler <[email protected]>
To: "Kasemir, Kay" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 22 Aug 2013 12:28:04 +0200
Hi,

thank you very much for all help! Now I found the reason of my problem.
I instantiated a DBR_TIME_String before I created the CA context. If you
do that you are in trouble.
For all those interested here comes an extract of the error case and the
simple resolution.

public class CAJBugTest {
    public static void main(String[] args) throws Exception {
        String varName = "INFOCL:hd"; //record(stringout, "INFOCL:hd")
{field(DESC, "user support") field (PINI, "YES") }
        System.setProperty("CA_DISABLE_REPEATER", "TRUE"); // In this
case I don't want use any repeater

        // bad idea :(
        /*
        DBR_TIME_String dummy = new DBR_TIME_String(new String[]{"???"});
        dummy.setStatus(Status.UDF_ALARM);
        dummy.setSeverity(Severity.INVALID_ALARM);
        dummy.setTimeStamp(new TimeStamp());
        */

        Context ctxt
=JCALibrary.getInstance().createContext(JCALibrary.CHANNEL_ACCESS_JAVA);

        // right place :)
        DBR_TIME_String dummy = new DBR_TIME_String(new String[]{"???"});
        dummy.setStatus(Status.UDF_ALARM);
        dummy.setSeverity(Severity.INVALID_ALARM);
        dummy.setTimeStamp(new TimeStamp());

        Channel ch = ctxt.createChannel(varName, new ConnectionListener() {
            @Override
            public void connectionChanged(ConnectionEvent ev) {
                CAJChannel channel = (CAJChannel) ev.getSource();
                try {
                    System.out.println("event of " + channel.getName()
+ " with data type " +
((channel.getFieldType()!=null)?channel.getFieldType().getName():"UNKNOWN")
+ " has state " + channel.getConnectionState().getName());
                } catch(Exception e) {
                    e.printStackTrace();
                }
            }
        });
        ctxt.flushIO();
        Thread.sleep(3000);
        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


References:
CAJ can't handle DBR_String Carsten Winkler
Re: CAJ can't handle DBR_String Kasemir, Kay
AW: CAJ can't handle DBR_String Winkler, Carsten

Navigate by Date:
Prev: EPICS and MEDM with eclipse Vikram Bhagat
Next: Re: EPICS and MEDM with eclipse Pete Jemian
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: CAJ can't handle DBR_String Hugo Slepicka
Next: CSS DataBrowser/Trend : legend font Takashi OBINA
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·