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

Subject: Re: Creating a Simple EPICS Sequencer Program
From: Bradley Pietrzak <[email protected]>
To: Jay Steele <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 7 Jul 2011 16:42:40 -0400
Thank you for the explanation.  However, I feel like I am still a bit confused on some key concepts.  Let's say that in an empty directory, I run "makeBaseApp.pl -t example example" followed by "makeBaseApp.pl -i -t example example".  I now have the following directories: "configure", "exampleApp", and "iocBoot".  Each of those directories contain several files and/or sub directories.  First, I go into configure/RELEASE and set SNCSEQ=/home/ops/seq-2.0.13.  Let's say that I now wish to create a state program called "Test.st".  I go into exampleApp/src and create a file called "Test.st".  In that file I enter the following text:

program snctest
float v;
assign v to "grw:xxxExample"; monitor v;

ss ss1 {
  state low {
    entry {
      printf("Will do this on entry");
      printf("Another thing to do on entry");
    }
    when (v>5.0) {
      printf("now changing to high\n");
    } state high
    when (delay(.1)) { } state low
    exit {
      printf("Something to do on exit");
    }
  }

  state high {
    when (v<=5.0) {
      printf("changing to low\n");
    } state low
    when(delay(.1)) { } state high
  }
}
Notice that I have not performed a "make" anywhere as of yet, nor have I edited any Makefiles.  Exactly what do I do in order to execute the program "Test.st".  Does "grw:xxxExample" refer to some .db file?  I know absolutely nothing about what a .db or .dbd file does.  Do I have to edit more than one Makefile in order to execute "Test.st"?

I guess what I need most is a complete, step-by-step description of how to start from a totally blank directory and end up with something that allows me to execute the program "Test.st"  I have checked the online document "State Notation Language and Sequencer Users Guide" and have found no such thing.  If this is not abundantly clear by now, I am an utter newbie when it comes to EPICS, linux, and this kind programming in general.  I really appreciate your help!

Brad Pietrzak

On Thu, Jul 7, 2011 at 3:07 PM, Jay Steele <[email protected]> wrote:

Yes – put the .st file in the SRCS list in the src/Makefile and rebuild the application.

 

For example, here’s a section from my Makefile with my own st files for compiling a cygwin32 IOC.

 

#testapp_SRCS_cygwin32 += sncExample.st

#testapp_SRCS_cygwin32 += sample_changer.st

testapp_SRCS_cygwin32 += cryorobotmotors.st

testapp_SRCS_cygwin32 += cryorobotseq.st

testapp_SRCS_cygwin32 += cryorobotsample.st

 

Cheers,

Jay Steele

Xradia Corporation

 

From: Bradley Pietrzak [mailto:[email protected]]
Sent: Thursday, July 07, 2011 7:35 AM
To: Jay Steele; [email protected]


Subject: Re: Creating a Simple EPICS Sequencer Program

 

Thank you for you're help, Jay.  I have now successfully built and ran the example program called "sncExample.stt" that is created when I run "makeBaseApp.pl -t example example" followed by "makeBaseApp.pl -i -t example example".  When you say I can simply create my own EPICS application by putting the .st file in the SRCS list in the application's Makefile, exactly what list are you referring to? Are you referring to this Makefile: "<top>/exampleApp/src/Makefile"?  In that Makefile, there is a section that builds sncExample as a component of example and as a standalone application.  Is that where I add my own .st program?

 

Thanks,

 

Brad Pietrzak

Indiana University Center for the Exploration of Energy and Matter

On Thu, Jun 16, 2011 at 2:22 PM, Jay Steele <[email protected]> wrote:

Hi Bradley,
   I just went through the process of coming up to speed on State Notation Language myself with EPICS for a robot control application and it is very useful. After you experiment around a little with the example IOC template (per Eric's suggestion below), and then build your own EPICS application, you can simply put the .st file in the application's src directory and add the .st file to the SRCS list in the application makefile. Also, for non-VxWorks OS's such as Linux, add a registrar(stnameRegistrar) statement to your appCommonInclude.dbd file. Then start the SNL task by calling the seq function from your application's startup script after iocInit. See the online document "State Notation Language and Sequencer Users Guide" for a well-written introduction.

   I recommend drawing up your state diagram first if it is complicated.

Cheers,
Jay Steele
Xradia Corporation


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Eric Norum
Sent: Thursday, June 16, 2011 11:08 AM
To: Bradley Pietrzak
Cc: [email protected]
Subject: Re: Creating a Simple EPICS Sequencer Program

The example IOC template includes a sequencer program.  I suggest that you use that as a starting point:

makeBaseApp -t example example
makeBaseApp -t example -i example

then edit configure/RELEASE and set SNCEQ
then 'make' and you should have a runnable IOC with an operational sequencer.

On Jun 16, 2011, at 10:47 AM, Bradley Pietrzak wrote:

> Hello,
>

> I am a student working at the Indiana Univeristy Center for the Exploration of Energy and Matter.  Recently, a collegue and I have been tasked with using the EPICS sequencer to cycle some magnets.  However, neither of us are at all familiar with using state notation language.  Our setup is this: we have a computer with a virtual machine on it that contains EPICS and the sequencer.  We do all of our work from a different machine that runs Red Hat Linux.  Using that machine, we ssh into the EPICS virtual machine.  While I have read a couple State Notation Language tutorials, I am still unclear on some key concepts.  What I would most like to know is how to start from nothing and make a program that does nothing more than print the text "Hello World".  I think what confuses us most is how to go from a file named "HelloWorld.st" to something we can actually execute.  At least for now, lets assume that all of the relevant compilers are successfully installed on the EPICS virtua!

 l machine.
>
> Sincerely,
>
> Brad Pietrzak

--
Eric Norum
[email protected]


 The information in this email, including any attachments, is confidential and intended only for the recipient(s) listed.  Any use of this email for any other purpose is prohibited.  If you have received this email in error, please notify me immediately by reply email, delete this email, and do not disclose its contents to anyone.

 



The information in this email, including any attachments, is confidential and intended only for the recipient(s) listed. Any use of this email for any other purpose is prohibited. If you have received this email in error, please notify me immediately by reply email, delete this email, and do not disclose its contents to anyone.


References:
Creating a Simple EPICS Sequencer Program Bradley Pietrzak
Re: Creating a Simple EPICS Sequencer Program Eric Norum
RE: Creating a Simple EPICS Sequencer Program Jay Steele
Re: Creating a Simple EPICS Sequencer Program Bradley Pietrzak
RE: Creating a Simple EPICS Sequencer Program Jay Steele

Navigate by Date:
Prev: Re: Errors building EPICS with MinGW Andrew Johnson
Next: RE: Errors building EPICS with MinGW Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Creating a Simple EPICS Sequencer Program Jay Steele
Next: Creating an IOCs and CA cleints for beginners Cid, Florencio A
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·