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  <20142015  2016  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  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Defining enums to express state?
From: Mark Rivers <[email protected]>
To: Ryan Pierce <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 27 Nov 2014 17:43:46 +0000
You can also use the seq or sseq records to perform a sequence of steps with optional delays and waits for completion.  When things get more complex you can write an SNL program.

Mark 

Sent from my iPhone

> On Nov 27, 2014, at 11:27 AM, Ryan Pierce <[email protected]> wrote:
> 
> Thanks, Dirk, for the info!
> 
> Sorry if I wasn't clear, but I don't need text strings sent over USB serial to the Arduino. Integers are fine and are probably easier and faster to parse on the Arduino. What Mark suggested using mbbi/mbbo and mapping integers to the strings should be fine.
> 
> Now the mention of arguments is interesting here. I'm wondering what EPICS best practices would be to send conceptual commands with arguments? Do you generally set records with the arguments first and then set an mbbi record to command an action?
> 
> E.g. if I have a brewing controller "bc" and a mash tun filler "mtf", would best practice be to use an ai record for my set point called bc:mtf:setfill that I'd first set to 4.8, which in and of itself would do nothing, and then have an mbbi record for giving commands called bc:mtf:cmd that I'd set to "StartFill" to begin the filling process? And, say, have an mbbo status record called bc:mtf:status that would transition from "Idle" to "Filling" to "Filled", along with an ao record called bc:mtf:fillvol that I could watch climb from 0 to 4.8?
> 
> Thanks again,
> Ryan
> 
>> On 11/24/2014 03:12 AM, Dirk Zimoch wrote:
>> Hello Ryan,
>> 
>> With StreamDevice, you can format and parse strings (including enums) for devices connected via asyn.
>> 
>> You can write a "protocol file" with commands like this:
>> 
>> fill {
>>  out "Fill the mash tun with %.1f gallons of water";
>> }
>> 
>> set_state {
>>  out "%{Close|Open}";
>> }
>> 
>> get_state {
>>  out "state?";
>>  in "%{Closed|Opening|Open|Closing|Partially Open}";
>> # be careful with the order of sub strings: "Open" after "Opening" !
>> }
>> 
>> http://epics.web.psi.ch/software/streamdevice/
>> 
>> Dirk
>> 
>> 
>>> On 20.11.2014 20:58, Ryan Pierce wrote:
>>> This is probably a really basic question....
>>> 
>>> The computer controlled brewing project I mentioned on this list a few
>>> months back is coming along quite well. Much of the keg welding and
>>> plumbing is done, and I've made a lot of progress with the control box
>>> that holds the power supplies, relays, Raspberry Pi, Arduino Mega,
>>> status lights, etc. I'm still a long way from actually brewing with it,
>>> as I haven't welded the frame or built out the propane system, but I'd
>>> like to try some integration testing with what I have.
>>> 
>>> I've been experimenting with async, cmd_response on the Arduino /
>>> Raspberry Pi and have CSS BOY on my laptop. I think I understand how to
>>> use ao records to output temperature, flow rate, fluid levels, etc.
>>> 
>>> The next task is to model my solenoid valves and motor controlled ball
>>> valves. I'd like to express states, e.g. Open, Closed, Opening, Closing,
>>>  Partially Open, etc. and be able to send commands, e.g. Open, Close,
>>> Nudge Open, Nudge Closed. I also need to send commands with an argument,
>>> e.g. "Fill the mash tun with 4.8 gallons of water" and monitor the progress.
>>> 
>>> Right now I'd like to display and control this manually in BOY, and
>>> eventually I'd like to learn SNL to set up scripts to automate
>>> frequently used actions.
>>> 
>>> Does anyone have any suggestions on resources to learn about defining
>>> enums in the db, how they are represented over async, and how to define
>>> command buttons and state indicators in BOY?
>>> 
>>> Thanks,
>>> Ryan
> 


References:
Defining enums to express state? Ryan Pierce
Re: Defining enums to express state? Dirk Zimoch
Re: Defining enums to express state? Ryan Pierce

Navigate by Date:
Prev: Re: Defining enums to express state? Ryan Pierce
Next: Re: Defining enums to express state? Torsten Bögershausen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Defining enums to express state? Ryan Pierce
Next: Re: Defining enums to express state? Torsten Bögershausen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·