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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Reading data from bo record? |
From: | Ryan Pierce <[email protected]> |
To: | "[email protected]" <[email protected]> |
Date: | Mon, 02 Mar 2015 00:36:27 -0600 |
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