From: Kasemir, K. <kas...@or...> - 2013-09-04 16:57:34
|
Hi: All network-based PVs are initially disconnected. On one hand, it's correct to reflect their initial disconnected state: Value is null, BOY widgets show disconnected, Data Browser plot starts with a 'No Value' indicator, alarm server sends alarm, formula has only data for some of its inputs, … Hopefully they connect soon, so now the widgets can show the value, formulas can be evaluated, ... Later, if the PV should disconnect because of a problem, you obviously need to see that, so it's back to BOY widgets show disconnected etc. Still, that initial handling of newly created PVs that have no data is not very practical. As you open a new display, all BOY widgets would flicker from 'disconnected' to the connected state, log shows warnings from formulas, operators get flurry of alarms when alarm server starts, strip-chart plots start with an error, … I think it's much more practical to have an initial grace period. For the alarm server, it simply doesn't do anything for the first 30 seconds on new PVs. Then, it would alarm if they're still disconnected. Unclear what to do exactly for displays, since you need to display something from the start, but the impression to the user should not be "Disconnected, panic, something is very wrong" but "Well, we don't know, yet, give it 30 seconds". On the PVManager level, maybe this can be handled by distinguishing between exceptions and null values, having guidelines how to handle them. Exception: Problem, needs to be displayed, logged, … The initial 'disconnected' exception, I think, is already delayed, so on a newly created PV you won't panic right away, there is a grace period. The null value simply means: We don't know, yet. In most cases, you don't do anything until you get a non-null value. If a channel starts, you may get null values, which you can ignore. If the channel really doesn't connect after a grace period, you get the exception, so you indicate the error. Hopefully, you get non-null values. If a functional channel suddenly disconnects, you get the exception and can display that right away. Could there be a case where there's no real error, nothing that results in an exception, and still you get null values? Thanks, Kay On Sep 4, 2013, at 12:15 PM, "Carcassi, Gabriele" <car...@bn...<mailto:car...@bn...>> wrote: Hi Nadine, You are doing nothing wrong: the pv for whatever reason is not connected, so it has a null value. Null handling within formulas is still not handled well because it’s not clear to me what’s the proper way to do it. The difference is probably that probe shows you everything that goes wrong. I hope that, after a while, the function connects, and the error is cleared… Gabriele From: Utzel Nadine [mailto:Nad...@it...<http://iter.org>] Sent: Wednesday, September 04, 2013 12:07 PM To: Carcassi, Gabriele; Chen, Xihui Subject: Formula in BOY - stupid question... >> java.lang.RuntimeException: Can't find match for function '+' and arguments [null, VInt] Hi again, I am testing the auto complete for formula in BOY and so I have a Text Update widget with PV Name: ='TEST-BST0:TANK-LEVEL'+100 And another one with: ='sim://sine'+100 When I run the OPI, I have the following error – twice: 2013-09-04 15:59:36.337 WARNING [Thread 142] org.csstudio.opibuilder.util.ErrorHandlerUtil (handleError) - Error from pv connection layer: java.lang.RuntimeException: Can't find match for function '+' and arguments [null, VInt] at org.epics.pvmanager.formula.FormulaReadFunction.readValue(Unknown Source) at org.epics.pvmanager.formula.ExpressionLanguage$1.readValue(Unknown Source) at org.epics.pvmanager.PVReaderDirector.notifyPv(Unknown Source) at org.epics.pvmanager.PVReaderDirector$2.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) But on the other hand, the OPI is running pretty well: <image001.png> So what am I doing wrong? Thanks, Nadine |