1 / 25

EPICS on Windows How to install and Application example with hands-on

Masanori Satoh/ KEK, Jan. 27-30, 2009 for EPICS seminar at RRCAT, Indore. EPICS on Windows How to install and Application example with hands-on. Some parts are quoted from Dr. Furukawa’s and Dr. Obina’s lecture materials. Why EPICS on Windows. EPICS on Windows Information:

sydnee-case
Download Presentation

EPICS on Windows How to install and Application example with hands-on

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Masanori Satoh/ KEK, Jan. 27-30, 2009 for EPICS seminar at RRCAT, Indore EPICS on WindowsHow to install and Application example with hands-on • Some parts are quoted from Dr. Furukawa’s and Dr. Obina’s lecture materials.

  2. Why EPICS on Windows • EPICS on Windows Information: http://www.aps.anl.gov/epics/base/win32.php http://www-linac.kek.jp/jk/win32/ • Recently, many devices are running on Windows (2000, XP, Vista) . • Digital oscilloscope (Tektronix, Agilent, LeCroy,…) • Network Analyzer • Many other measurement instruments • etc.

  3. EPICS IOC Example in KEK Linac • Tektronix Oscilloscope • DPO7104 for BPM-DAQ • Agilent Network Analyzer • E5061A for Vector voltmeter ( 571 MHz Phase)

  4. Building EPICS on Windows: • Some possible environments • Cygwin • Unix-like environment • GNU tools • cygwin1.dll • Microsoft Visual C++ (VC6, 2005, .NET, 2008) • Commercial • Free version (Express Edition) • MinGW • Minimalist GNU for Windows • Free GNU C compiler • msvcrt.dll (Microsoft C) • Borland C++

  5. Building EPICS on Windows: The simplest approach: Cygwin with the GCC compiler Recommend: Some Cygwin tools and Microsoft's commercial Visual C++ compiler (or free Visual C++ 2008 Express Edition). http://www.microsoft.com/express/vc/

  6. What’s Cygwin? • Cygwin is a Linux-like environment for Windows. • A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality. • A collection of tools which provide Linux look and feel. • You can get it http://www.cygwin.com/

  7. Cygwin Applications • Cygwin API • “Cygwin1.dll” provides function of POSIX system call. • Development of Windows-native Application is also Possible • Development of DLL is Possible • Most of the Open-Source tools on Unix are ported. • Fileutils, XXXutils, Compilers, Debuggers, Editors, Internet Clients, Interpreters, Dev. Tools, Doc. Tools. • Servers • Sshd, Apache (php, etc.), Squid, PostgreSQL, Xinetd, NFS,… • X11

  8. What Is Visual Studio Express? • You can get it. http://www.microsoft.com/express/download/ • Visual C++, Visual Basic, Visual C#, SQL Server, Visual Web Developer. • Freeware • Limited functionality • But enough for common usage • Needs about 1 GB of disk space • You don’t need: MS Shilverlight Runtime MS SQL Server

  9. Visual C++ 2008 GUI

  10. How to Build EPICS on Windows (1) • Using Cygwin: • The simple way to build EPICS on Windows • Hits for Cygwin setup: • Very slow response for some download sites. • If you failed to download, try from other Websites . • Default install option does not include the important commands: cc, make, perl, etc

  11. How to Build EPICS on Windows (1) • Install Cygwin:

  12. How to Build EPICS on Windows (1)

  13. How to Build EPICS on Windows (1) • Choose a download site. • If you failed, try from other download sites.

  14. How to Build EPICS on Windows (1) • Select Packages you want. • At least, select cc, vim, make, Perl, and so on. • X11 is also available if you select.

  15. How to Build EPICS on Windows (1) • Select Packages: • Editors • Vim, Emacs,… • Devel • make • gcc-g++, gcc-core • Perl • Other packages if you need

  16. How to Build EPICS on Windows (1) • Set EPICS_HOST_ARCH environment var. • bash: export EPICS_HOST_ARCH=cygwin-x86 • csh: setenv EPICS_HOST_ARCH cygwin-x86 • c.f.) for MinGW, export EPICS_HOST_ARCH=win32-x86-mingw • Then, in the base directory • Just type “make” • Typically, it takes about 10 minutes. (Intel Core2 1.2 GHz, 2 GB RAM)

  17. How to Build EPICS on Windows (2) • Cygwin tools and Microsoft's Visual Studio C++ compiler combination. • make, perl (Cygwin) • cl, link, (Visual Studio C++) • EPICS_HOST_ARCH: • bash: export EPICS_HOST_ARCH=win32-x86 • csh: setenv EPICS_HOST_ARCH win32-x86 • c.f.) for Borland compiler export EPICS_HOST_ARCH=win32-x86-borland

  18. How to Build EPICS on Windows (2) • EPICS_HOST_ARCH variable: • You can set it as the Windows Environment Variable. • “Control Panel” => “System” => “System Property” => “Environment Variables” => “System variables”

  19. How to Build EPICS on Windows (2) • You can find cygwin.bat file in c:\cygwin (default setting) or root directory you choosed. • In cygwin.bat file, add one line. @echo off C: chdir C:\cygwin\bin call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat“ bash --login -i

  20. How to Build EPICS on Windows (2) • Modify /etc/profile file PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH export PATH => PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin export PATH • You can check the path setting by “which” command. $ which link /cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/BIN/link $ which cl /cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/BIN/cl

  21. Hands-on (1) • Build EPICS base on Windows • Use Cygwin • export EPICS_HOST_ARCH=cygwin-x86 • Use Visual Studio C++ and Cygwin(make, perl) • export EPICS_HOST_ARCH=win32-x86 • Modify the /etc/profile file • PATH= $PATH:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin

  22. Hands-on (2) • Open a Cygwin command window • Check environment • printenv • printenv |grep EPICS • make –v • perl –v • cl

  23. Hands-on (3) • Create an Example Application on Windows /home/username>mkdir testApp /home/username>cd testApp /home/username/testApp>makeBaseApp.pl -t example myexample /home/username/testApp>makeBaseApp.pl -i -t example myexample /home/username/testApp>make ..... wait for a while ..... /home/username/testApp>cd iocBoot\iocmyexample /home/username/testApp/iocBoot/iocmyexample>vi st.cmd ..... edit "st.cmd" ..... dbLoadRecords("db/dbExample1.db","user=username") dbLoadRecords("db/dbExample1.db","user=your_favorite_name") /home/username/testApp/iocBoot/iocmyexample>../../bin/win32-x86/example.exe st.cmd ..... open another cmd window, try caget, camonitor

  24. Hits for Hands-on (3) • Set path configuration • /usr_epics_base_directory/bin/win32-x86 • e.g.) /epics/base-3.14.10/bin/win32-x86 • Modify .bashrc (bash), .cshrc (csh) • Or, Modify Environment Variables on Windows

  25. How to use CA.DLL • Dynamic-Link Library (DLL) • Microsoft’s implementation of the shared library concept in the Windows operating systems • *.so (In Linux or other UNIX-like operating system) • Example: caClient by VBA macro • Visual Basic for Application • In KEK Linac, VBA is used for E5061A(Agilent) for Vector voltmeter.

More Related