EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS and IDL
From: "Ben-chin K. Cha" <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Fri, 12 Nov 1999 13:55:59 -0600 (CST)
>>>>> Thomas Fechner wrote ...

> we have some problems with using the ezcaIDL(Widget) extensions. R/W
> access to PVs operate very well but monitoring didn't succeed any time.
> We are using EPICS 3.13.0beta7 on Solaris 2.6, last ezcaIDL extension
> release form EPICS software server and IDL5.0 .
> Has anyone analogous problems or any suggestion or perhaps written another
> IDL channel access software?   
> Thanks in advance
> Thomas
> 

I have been using the caMonitor from ezcaIDL extensions
for monitoring a vector of PVs.
The caMonitor currently monitor the value change as a double
therefore it can only return the double value correctly. 
It returns one double value for each PV name in the vector. 

caMonotor can return the event flag vector for any other type of
PV value, which tells you whether the value change event happened. 
To get the non real/double number you have to use caget/cagetArray
to get the current values.

I have just written a simple example of IDL widget program
monitorPV.pro for you (see attachment), which uses the WIDGET_TABLE
to show you how to use caMonitor and timer to display the
CA monitoring result. You use the PVNAMES, and TIMER keyword to run
this program. (Be aware that the problem with IDL WIDGET_TABLE
it only display 10 digits in each table cell.) 

I hope this helps. 

Ben-chin


PRO MAIN13_Event, Event


  WIDGET_CONTROL,Event.top,GET_UVALUE=Info
  WIDGET_CONTROL,Event.Id,GET_UVALUE=Ev

  pvs = info.pvs
  vals = info.vals

  if (event.id eq event.handler) then begin
	WIDGET_CONTROL,event.id, TIMER=info.poll_timer
	ret = camonitor(pvs,vals,/check)			; event flags
print,'event_flags=',vals
	if ret eq 0 and total(vals) gt 0. then begin
	rt = camonitor(pvs,vals,/get)
	WIDGET_CONTROL,info.table,SET_VALUE=transpose(vals)
;	print,cagetArray(pvs,vals)
;	WIDGET_CONTROL,info.table,SET_VALUE=vals
;	print,vals
	info.vals = vals
	end
  endif else begin

  CASE Ev OF 

  'MONITOR_TABLE': BEGIN
	WIDGET_CONTROL,Event.id,GET_VALUE=v
	print,caputarray(pvs,v)
	END
  ENDCASE
  end

  WIDGET_CONTROL,Event.top,SET_UVALUE=Info
END




PRO monitorPV, GROUP=Group,timer=timer,pvNames=pvNames
 

  IF N_ELEMENTS(Group) EQ 0 THEN GROUP=0

  junk   = { CW_PDMENU_S, flags:0, name:'' }

pvs = ['chademoai1','chademoai2','chademoai3']

if keyword_set(pvNames) then begin
	if n_elements(pvNames) gt 1 then begin
		pvs = string(pvNames)
	endif else begin
	str = ["Usage:     monitorPV, pvnames=['pvname1','pvname2',...] ,timer=...",$
		'', '        At least two PV names required', $
		'        Default timer is 1 second.']
	res = dialog_message(str,/Info)
	return
	end
end

ret = caMonitor(pvs,/add)
ret = caMonitor(pvs,vals,/get)

  MAIN13 = WIDGET_BASE(GROUP_LEADER=Group, $
      ROW=1, $
      MAP=1, $
      UVALUE='MAIN13')

  BASE2 = WIDGET_BASE(MAIN13, $
      COLUMN=1, $
      MAP=1, $
      UVALUE='BASE2')

  LABEL3 = WIDGET_LABEL( BASE2, $
      UVALUE='LABEL3', $
      VALUE='Monitor PVs')

  table = widget_table(BASE2, $
		value=transpose(vals), $  
		UVALUE='MONITOR_TABLE',$
		ROW_LABELS=pvs,/EDITABLE)

  info = { $
	base: MAIN13, $
	poll_timer: 1., $           ; default timer
	table: table, $
	pvs: pvs, $
	vals: vals $
	}
	
  if keyword_set(timer) then info.poll_timer = timer
  WIDGET_CONTROL, MAIN13, /REALIZE
  WIDGET_CONTROL, MAIN13, TIMER= info.poll_timer
  WIDGET_CONTROL, MAIN13, SET_UVALUE=info

  XMANAGER, 'MAIN13', MAIN13
END

Navigate by Date:
Prev: Re: database limits Dennis M Reichhold
Next: Re: database limits Burkhard Kolb
Index: 1994  1995  1996  1997  1998  <19992000  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: EPICS and IDL Thomas Fechner
Next: database limits Burkhard Kolb
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·