Hello all,
Thank you for all your info. Let me explain what I've found so far.
Using the local variables as input PV to the script makes the PV has a null value. Even setting it inside the script makes no difference. If I use the local PV name inside the X/Y PV properties of the XY graph and using this for example in the script's input PVs:
Loc://x(0,10)
Loc://y(0,10)
A trace appears on the graph, but still changing the PV values inside the script makes no difference.
For more info, I will receive 4096-item array from a PV and need to process them all then display them on the graph.
Thanks!
Abdalla.
-----Original Message-----
From: Kasemir, Kay [mailto:[email protected]]
Sent: Wednesday, August 10, 2016 5:23 PM
To: Pearson, Matthew R. <[email protected]>; Abdalla Ahmad <[email protected]>
Cc: Márcio Paduan Donadio <[email protected]>; [email protected] list <[email protected]>
Subject: Re: Drawing on XY graph widget without the use of a PV in CSS
Hi:
There's some history behind local variables that goes back to EDM.
When you use a variable
loc://x
then there is of course the question of initial value.
I think EDM used zero, and way back CSS also used 0 as the initial value.
... but we wanted to allow initialization of local variables with something other than zero, and also to allow local variables that hold strings (and later enums etc.).
So we supported
loc://x(42.3)
loc://y("Fred (Pete) Hammersmith, Jr.")
That brought up the question:
What if you open one display that uses
loc://x(42.3)
and another that uses
loc://x(3.14)
at the same time?
What will be the initial value of that local PV?
Should whatever runs first initialize the PV, and whatever happens next then leaves the value as found, because it's already initialized? That's what EDM and the first CSS utility.pv did.
The PVManager decided to throw an exception if you used the same variable with different initializer values, because you can't really predict what runs first, so you better make all initializers match.
The vtype.pv considers them different variables, i.e. loc://x(42.3) == 42.3 and loc://x(3.14) == 3.14 and they're different variables, writing to loc://x(42.3) will not change loc://x(3.14) and vice versa.
==>
If you use local variables, either use "loc://x" and beware that the initial value is null, so you need to somehow set it.
Or use "loc://x(42.3)" and assert that you always use the PV exactly like that, considering "loc://x(42.3)" with that initializer to be the full name of the PV, because that way it will behave the same way in all the tools & versions.
-Kay
________________________________________
From: [email protected] <[email protected]> on behalf of Pearson, Matthew R. <[email protected]>
Sent: Wednesday, August 10, 2016 9:48 AM
To: Abdalla Ahmad
Cc: Márcio Paduan Donadio; [email protected] list
Subject: [EXTERNAL] Re: Drawing on XY graph widget without the use of a PV in CSS
Try this instead:
loc://x(0)
which will default it to zero.
Cheers,
Matt
> On Aug 10, 2016, at 3:51 AM, Abdalla Ahmad <[email protected]> wrote:
>
> How to use these variables loc://x and loc://y ? I added them as input PVs to the script but it gives me loc://x has a null value. Am I missing something?
>
> Best Regards,
>
> Abdalla Ahmad
> Control Engineer
> SESAME
> Allan, Jordan.
> Tel: (+962-5) 3511348 , ext. 265
> Fax: (+962-5) 3511423
> Mob: (+962-7)88183296
> www.sesame.org.jo
>
>
>
> From: [email protected]
> [mailto:[email protected]] On Behalf Of M?rcio Paduan
> Donadio
> Sent: Monday, August 08, 2016 3:38 PM
> To: [email protected]
> Cc: Márcio Paduan Donadio <[email protected]>
> Subject: Re: Drawing on XY graph widget without the use of a PV in CSS
>
>
> You can use loc variables in X PV and Y PV parameters. Eg: loc://x and loc://y.
>
> Inside the script you can do something like this:
>
> from java.util import Arrays
> from jarray import zeros
> from java.lang import Double
>
> x = zeros(NUM_OF_STEPS, Double)
> y = zeros(NUM_OF_STEPS, Double)
>
> for i in range (NUM_OF_STEPS):
> x[i] = 0
> y[i] = 0
>
> # Do processing....
>
> pvs[0].setValue(x)
> pvs[1].setValue(y)
>
>
> --
> Márcio Paduan Donadio
> Engenheiro de Computação - Software de Operação das Linhas de Luz
> Laboratório Nacional de Luz Síncrotron - (LNLS) Centro Nacional de
> Pesquisa em Energia e Materiais (CNPEM)
> + 55 (19) 3512-3520 - [email protected]
> www.lnls.cnpem.br
>
>
> ------------------------------------------------------------------
> Hello
>
> Is it possible to draw some data on an XY graph widget from a script/rule without using a PV? I mainly tried setting the property 'pv_value' but nothing appears on the graph. I'm not sure if this is even possible or not. The thing is I will receive a waveform PV value and I want to do some processing on it then displaying the output on the XY graph.
>
> Best Regards,
>
> Abdalla.
>
- Replies:
- Re: Drawing on XY graph widget without the use of a PV in CSS Kasemir, Kay
- References:
- Re: Drawing on XY graph widget without the use of a PV in CSS Márcio Paduan Donadio
- RE: Drawing on XY graph widget without the use of a PV in CSS Abdalla Ahmad
- Re: Drawing on XY graph widget without the use of a PV in CSS Pearson, Matthew R.
- Re: Drawing on XY graph widget without the use of a PV in CSS Kasemir, Kay
- Navigate by Date:
- Prev:
synApps 5.8 build issue Abdalla Ahmad
- Next:
Re: synApps 5.8 build issue Michael Davidsaver
- 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:
Re: Drawing on XY graph widget without the use of a PV in CSS Kasemir, Kay
- Next:
Re: Drawing on XY graph widget without the use of a PV in CSS Kasemir, Kay
- 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
|