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  2013  2014  <20152016  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  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Reading data from bo record?
From: <[email protected]>
To: <[email protected]>, <[email protected]>
Date: Mon, 2 Mar 2015 09:34:00 +0000
Hi Ryan,

I think the answers to your questions are:

1. You need to have both a bo record (to send a value) and a bi record (to receive the readback). There has been some recent work on having an output record to update their value via input links (see http://www.aps.anl.gov/epics/tech-talk/2015/msg00246.php), but you probably don't have that (and I haven't tried it).

2. OPI widget's are generally driven by monitoring the values of PV's. Hence you are right in your assumption. However, there is an exception, of course, if you actually manipulate the widget on the screen - then it changes as you manipulate it (enter in text etc), but if the result of sending thePV to the IOC results in processing that returns a different value, the widget gets changed again. normally updates of PV's that change as a direct result of the put happen with  no noticeable lag - because normally you put to scan Passive PV's that process immediately. I assume your lag is in a readback PV, that changes in the hardware as a result of the put, and the lag is the hardware polling delay.

3. I suspect you are getting a null return because you haven't filled in the ZNAM or ONAM of the bio record.

Cheers,

Nick Rees
Principal Software Engineer           Phone: +44 (0)1235-778430
Diamond Light Source                  Fax:   +44 (0)1235-446713

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ryan Pierce
Sent: 02 March 2015 06:36
To: [email protected]
Subject: Reading data from bo record?

I've just started building my first EPICS project (the computer 
controlled beer brewing system I mentioned, which recently made 
Hackaday's twitter feed: 
https://twitter.com/HackadayPrize/status/570791651620347904 ) and I am 
not sure about the behavior I'm observing.

The plan is to run a soft IOC on a Raspberry Pi using asyn, 
communicating via USB serial with an Arduino running custom code derived 
from cmd_response, and (for now at least) controlling this from CSS BOY.

I've succeeded in creating a PV of type bo, as well as defining a custom 
command and custom Arduino code for it. I can do a caput to the PV of 1 
or 0, or I can use one of many binary switch objects in CSS BOY, and 
when I switch it, the Arduino takes the appropriate action. That's 
great. But I've got a few questions:

1. I noticed that for a bo record, I can define an OUT but attempting to 
define an INP produces an error. Ideally, I'd really like something 
bidirectional, e.g. I can write a 1 or 0 to it, and that will trigger 
asyn to call the command to write to it, but other actions with the 
running Arduino code can also change the physical thing represented, it 
can be queried, and the result may be the same as, or different from, 
the last thing written to it.

Physical example: I've got three propane burners. I'd like PV's for each 
of them, so I can turn them on or off. But I may want to write to a 
different set of PVs that enables a thermostat mode, where code on the 
Arduino turns the burner on or off automatically based on fluid 
temperature. I'd like to be able to query that and display it on the 
control screen.

I get the feeling EPICS is a Swiss Army knife with a lot of tools, but 
being a beginner I really don't know what the best tool for the job 
would be here. I'm thinking either:

A. I create a pair of bi and bo PV's for each burner. The bo would be 
used to send commands to turn the burner off or on. But the bi would 
indicate whether the burner actually is on of off.

B. Do something I'm missing to make the bo truly bidirectional. I'm 
looking through the docs and am wondering if DOL and OMSL would do what 
I wanted.

2. I noticed that in CSS BOY, I can define an LED with the PV name of 
the bo in addition to a switch. When I flip the switch, there's a little 
lag (due to my SCAN time, I suppose), but the LED eventually reports 
correctly. In addition, the switch itself changes its appearance. I've 
wondered whether CSS BOY is latching the last thing it wrote, or if the 
IOC is latching the last write command it received. Seeing as I can 
restart CSS BOY and these are always correct, I'm assuming the latter, Yes?

3. Doing a caget on the bo PV returns nothing. This confuses me. I'd 
assume I'd get whatever the IOC is latching. Presumably, there's got to 
be a way to get this, otherwise CSS BOY wouldn't be able to display it. 
What's happening?

FYI: There has been a release of the Raspberry Pi 2, which seems to have 
vastly higher performance than the earlier Pi's. I don't have one yet, 
but that is eventually the plan. Right now, even the Arduino dev 
environment is sluggish on the older Pi, but I'm hearing the Pi 2 feels 
like a desktop. I'd really like to be able to run Apache, Tomcat, and 
Web OPI on the Pi so I wouldn't have to rely on any external server.

Thanks,
Ryan

-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom


Replies:
RE: Reading data from bo record? Mark Rivers
References:
Reading data from bo record? Ryan Pierce

Navigate by Date:
Prev: RE: Reading data from bo record? tom.cobb
Next: RE: Reading data from bo record? Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Reading data from bo record? tom.cobb
Next: RE: Reading data from bo record? Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·