Hi Hovanes,
Packages.org.csstudio.utility.pv.epics is not exported from BOY, so you cannot use this package. In utility.pv, you should always use PVFactory to create PV. Also, it is not recommended to create PV in BOY script, because you need to manage the whole life cycle of the PV carefully, such as start() and stop(). Why don't you attach the PV to the script or a widget?
Thanks,
Xihui
________________________________________
From: Hovanes Egiyan [[email protected]]
Sent: Thursday, December 13, 2012 10:15 AM
To: [email protected]
Cc: Beni Zihlmann
Subject: EPICSPVFactory in CSS JavaScript
Hi,
we are trying to connect to EPICS variables from a CSS JavaScript script.
By looking at the CSS source and some examples we figured that we would
need to use
"EPICSPVFactory" class to create an object to connect to our EPICS
variables.
This class is apparently defined in "org.csstudio.utility.pv.epics", so we
try the following short script:
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
importPackage(Packages.java.lang);
importPackage(Packages.org.csstudio.utility.pv);
importPackage(Packages.org.csstudio.utility.pv.epics);
//-----------------------------------
runnable = {
run:function()
{
var pv = EPICSPVFactory.createPV( "epics://value1" );
}
};
new Thread(new Runnable(runnable)).start();
//-----------------------------------------------
But when we run it, there is an error message:
Exception in thread "Thread-152" org.mozilla.javascript.EcmaError: ReferenceError: "EPICSPVFactory" is not defined. (script#11)
When we change "EPICSPVFactory.createPV" to "PVFactory.createPV", the
error disappears.
This is as if the "importPackage(Packages.org.csstudio.utility.pv.epics"
statement has no effect.
We are using SNS Basic EPICS CSS 3.1.2 product that we downloaded from
the SNS web site.
Is there something else or something different we need to do to be able
to use the
"EPICSPVFactory" and "EPICS_V3_PV" classes in our scripts?
Thanks in advance,
Hovanes.
- Replies:
- Re: EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- References:
- EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- Navigate by Date:
- Prev:
RE: Re:RE: "Connection refused" when running Ethernet/RS232 application Mark Rivers
- Next:
Re: EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- 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:
EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- Next:
Re: EPICSPVFactory in CSS JavaScript Hovanes Egiyan
- 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
|